Add support for targeting notifications to organizations and remove the password_required notification for new orbs

This commit is contained in:
Joseph Schorr 2014-03-12 19:00:24 -04:00
parent 578add3b9e
commit 525ef8d14f
8 changed files with 61 additions and 16 deletions

View file

@ -18,6 +18,16 @@
max-width: 320px;
}
.notification-view-element .orginfo {
margin-top: 8px;
float: left;
}
.notification-view-element .orginfo .orgname {
font-size: 12px;
color: #aaa;
}
.notification-view-element .circle {
position: absolute;
top: 14px;
@ -30,12 +40,16 @@
}
.notification-view-element .datetime {
margin-top: 10px;
margin-top: 16px;
font-size: 12px;
color: #aaa;
text-align: right;
}
.notification-view-element .message {
margin-bottom: 4px;
}
.notification-view-element .container {
padding: 10px;
border-radius: 6px;

View file

@ -44,6 +44,7 @@
ng-class="notificationService.notificationClasses"
bs-tooltip=""
title="{{ notificationService.notificationSummaries }}"
data-html="true"
data-placement="left"
data-container="body">
{{ notificationService.notifications.length }}

View file

@ -1,7 +1,11 @@
<div class="notification-view-element">
<div class="container" ng-click="showNotification();">
<div class="message">{{ getMessage(notification) }}</div>
<div class="datetime">{{ parseDate(notification.created) | date:'medium'}}</div>
<div class="circle" ng-class="getClass(notification)"></div>
<div class="message">{{ getMessage(notification) }}</div>
<div class="orginfo" ng-if="notification.organization">
<img src="//www.gravatar.com/avatar/{{ getGravatar(notification.organization) }}?s=24&d=identicon" />
<span class="orgname">{{ notification.organization }}</span>
</div>
<div class="datetime">{{ parseDate(notification.created) | date:'medium'}}</div>
</div>
</div>

View file

@ -3356,11 +3356,16 @@ quayApp.directive('notificationView', function () {
'notification': '=notification',
'parent': '=parent'
},
controller: function($scope, $element, $location, NotificationService) {
controller: function($scope, $element, $location, UserService, NotificationService) {
$scope.getMessage = function(notification) {
return NotificationService.getMessage(notification);
};
$scope.getGravatar = function(orgname) {
var organization = UserService.getOrganization(orgname);
return organization['gravatar'] || '';
};
$scope.parseDate = function(dateString) {
return Date.parse(dateString);
};