Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit 7fcea58

Browse files
committed
Merge pull request #382 from appirio-tech/feature/SUP-2130-colorful-handles
colors for handles
2 parents 36611ab + 16b9202 commit 7fcea58

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

app/directives/profile-widget/profile-widget.directive.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
(function() {
22
'use strict';
33

4-
angular.module('tcUIComponents').directive('profileWidget', ['CONSTANTS', profileWidget]);
4+
angular.module('tcUIComponents').directive('profileWidget', ['CONSTANTS', '$filter', profileWidget]);
55

6-
function profileWidget(CONSTANTS) {
6+
function profileWidget(CONSTANTS, $filter) {
77
return {
88
restrict: 'E',
99
templateUrl: 'directives/profile-widget/profile-widget.html',
@@ -16,7 +16,9 @@
1616
link: function(scope, elem, attrs) {
1717
scope.DOMAIN = CONSTANTS.domain;
1818
scope.ASSET_PREFIX = CONSTANTS.ASSET_PREFIX;
19-
19+
// get max rating or default to 0
20+
var rating = _.get(scope.profile, 'maxRating.rating', 0);
21+
scope.handleColor = $filter('ratingColor')(rating);
2022
scope.$watch('editProfileLink', function(newValue, oldValue, scope) {
2123
if (newValue) {
2224
scope.editProfileLink = newValue;

app/directives/profile-widget/profile-widget.jade

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
img.profile-circle(ng-if="!profile.photoURL", src="/images/ico-user-default.svg")
55

66
.info
7-
h1.handle {{profile.handle}}
7+
h1.handle(style="color:{{handleColor}};") {{profile.handle}}
88

99
h3.tenure(ng-if="profile.startMonth")
1010
| Member Since {{profile.startMonth}}

0 commit comments

Comments
 (0)