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

colors for handles #382

Merged
merged 1 commit into from
Oct 16, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions app/directives/profile-widget/profile-widget.directive.js
Original file line number Diff line number Diff line change
@@ -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',
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion app/directives/profile-widget/profile-widget.jade
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand Down