-
Notifications
You must be signed in to change notification settings - Fork 640
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
199 additions
and
55 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
(function() { | ||
'use strict'; | ||
angular.module('theHiveDirectives') | ||
.directive('user', function(UserInfoSrv) { | ||
return { | ||
scope: { | ||
user: '=userId', | ||
iconOnly: '@', | ||
iconSize: '@' | ||
}, | ||
templateUrl: 'views/directives/user.html', | ||
link: function(scope) { | ||
scope.userInfo = UserInfoSrv; | ||
scope.userData = {}; | ||
|
||
scope.$watch('user', function(value) { | ||
scope.userData = scope.userInfo.get(value); | ||
}); | ||
} | ||
}; | ||
}); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,30 @@ | ||
(function() { | ||
'use strict'; | ||
angular.module('theHiveServices').factory('UserInfoSrv', function(UserSrv) { | ||
var userCache = {}; | ||
return function(login) { | ||
if (angular.isDefined(userCache[login])) { | ||
return userCache[login]; | ||
} else { | ||
userCache[login] = UserSrv.getInfo(login); | ||
return userCache[login]; | ||
} | ||
}; | ||
}); | ||
angular.module('theHiveServices') | ||
.service('UserInfoSrv', function(UserSrv) { | ||
|
||
this.userCache = {}; | ||
|
||
this.get = function(userId) { | ||
if (angular.isDefined(this.userCache[userId])) { | ||
return this.userCache[userId]; | ||
} else { | ||
this.userCache[userId] = UserSrv.getInfo(userId); | ||
return this.userCache[userId]; | ||
} | ||
}; | ||
|
||
this.clear = function() { | ||
this.userCache = {}; | ||
}; | ||
|
||
this.remove = function(userId) { | ||
delete this.userCache[userId]; | ||
}; | ||
|
||
this.update = function(userId, userData) { | ||
this.userCache[userId] = userData; | ||
}; | ||
|
||
}); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<span class="avatar avatar-{{iconSize || 'xs'}}"> | ||
<img ng-if="userData.avatar" class="avatar-icon" alt="{{userData.name}}" tooltip="{{userData.name}}" data-ng-src="{{'data:image/jpeg;base64,' + userData.avatar}}"/> | ||
<img ng-if="!userData.avatar" class="avatar-icon" alt="{{userData.name}}" tooltip="{{userData.name}}" src="images/no-avatar.png"/> | ||
<span ng-if="!iconOnly" class="avatar-name">{{userData.name}}</span> | ||
</span> |
Oops, something went wrong.