mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 07:37:25 +01:00
fix for #1920, again. this is very 'un-angular' but it *actually* works. the proper way to do this is make a directive for 'userlevel' or something and have that apply the proper styles
This commit is contained in:
@@ -21,6 +21,16 @@ habitrpg.controller("RootCtrl", ['$scope', '$rootScope', '$location', 'User', '$
|
||||
return haystack && ~haystack.indexOf(needle);
|
||||
}
|
||||
|
||||
// styling helpers
|
||||
$scope.userLevelStyle = function(user,style){
|
||||
style = style || '';
|
||||
if(user.backer.npc)
|
||||
style += ' label-npc';
|
||||
if(user.contributor.level)
|
||||
style += ' label-contributor-'+user.contributor.level;
|
||||
return style;
|
||||
}
|
||||
|
||||
// count pets, mounts collected totals, etc
|
||||
$rootScope.countExists = function(items) {return _.reduce(items,function(m,v){return m+(v?1:0)},0)}
|
||||
|
||||
|
||||
@@ -27,5 +27,5 @@ figure.herobox(ng-click='clickMember(profile._id)', data-name='{{profile.profile
|
||||
// Pet
|
||||
// FIXME handle @minimal, this might have to be a directive
|
||||
span.current-pet(class='Pet-{{profile.items.currentPet}}', ng-show='profile.items.currentPet && !minimal')
|
||||
.avatar-level(ng-class='{label:profile, "label-contributor- + profile.contributor.level": profile.contributor, "label-npc": profile.backer.npc}')
|
||||
.avatar-level(ng-class='userLevelStyle(profile,"label")')
|
||||
| Lvl {{profile.stats.lvl}}
|
||||
|
||||
Reference in New Issue
Block a user