diff --git a/app/directives/profile-widget/profile-widget.directive.js b/app/directives/profile-widget/profile-widget.directive.js index 9173cb17a..f0ca4812b 100644 --- a/app/directives/profile-widget/profile-widget.directive.js +++ b/app/directives/profile-widget/profile-widget.directive.js @@ -1,9 +1,9 @@ (function() { 'use strict'; - angular.module('tcUIComponents').directive('profileWidget', ['CONSTANTS', profileWidget]); + angular.module('tcUIComponents').directive('profileWidget', ['CONSTANTS', '$filter', profileWidget]); - function profileWidget(CONSTANTS) { + function profileWidget(CONSTANTS, $filter) { return { restrict: 'E', templateUrl: 'directives/profile-widget/profile-widget.html', @@ -16,7 +16,9 @@ link: function(scope, elem, attrs) { scope.DOMAIN = CONSTANTS.domain; scope.ASSET_PREFIX = CONSTANTS.ASSET_PREFIX; - + // get max rating or default to 0 + var rating = _.get(scope.profile, 'maxRating.rating', 0); + scope.handleColor = $filter('ratingColor')(rating); scope.$watch('editProfileLink', function(newValue, oldValue, scope) { if (newValue) { scope.editProfileLink = newValue; diff --git a/app/directives/profile-widget/profile-widget.jade b/app/directives/profile-widget/profile-widget.jade index b17cf93eb..67c207a0b 100644 --- a/app/directives/profile-widget/profile-widget.jade +++ b/app/directives/profile-widget/profile-widget.jade @@ -4,7 +4,7 @@ img.profile-circle(ng-if="!profile.photoURL", src="/images/ico-user-default.svg") .info - h1.handle {{profile.handle}} + h1.handle(style="color:{{handleColor}};") {{profile.handle}} h3.tenure(ng-if="profile.startMonth") | Member Since {{profile.startMonth}}