mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-04-14 19:56:23 +00:00
add star/tower glyphicons for mods/staff in Hall; in Hall, change admin's description of levels; create migration script for increasing admin tiers
This commit is contained in:
parent
0f5ef3a1ea
commit
73cd71d74b
4 changed files with 44 additions and 2 deletions
30
migrations/20140810_upgrade_admin_contrib_tiers.js
Normal file
30
migrations/20140810_upgrade_admin_contrib_tiers.js
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
// https://github.com/HabitRPG/habitrpg/issues/3801
|
||||
// Convert contributors of Tier 7 with admin flag to Tier 8 (moderators).
|
||||
// Convert contributors of Tier 8 to Tier 9 (staff) (all Tier 8s are admins).
|
||||
|
||||
db.users.update(
|
||||
{
|
||||
'contributor.admin':true,
|
||||
'contributor.level':{$gte:7}
|
||||
},
|
||||
{
|
||||
$inc: { 'contributor.level': 1 }
|
||||
},
|
||||
{ multi: true }
|
||||
);
|
||||
|
||||
/*
|
||||
db.users.find({_id : ObjectId("6")})
|
||||
db.users.find(
|
||||
{
|
||||
'contributor.admin':true,
|
||||
'contributor.level':{$gte:7}
|
||||
},
|
||||
{
|
||||
'username':1,
|
||||
'profile.name':1,
|
||||
'contributor.level':1,
|
||||
'contributor.admin':1
|
||||
}
|
||||
);
|
||||
*/
|
||||
|
|
@ -48,6 +48,15 @@ habitrpg.controller("RootCtrl", ['$scope', '$rootScope', '$location', 'User', '$
|
|||
style += ' label-contributor-'+user.contributor.level;
|
||||
return style;
|
||||
}
|
||||
$scope.userAdminGlyphiconStyle = function(user,style){
|
||||
style = style || '';
|
||||
if(user && user.contributor && user.contributor.level)
|
||||
if(user.contributor.level==8)
|
||||
style += ' glyphicon glyphicon-star'; // moderator
|
||||
if(user.contributor.level==9)
|
||||
style += ' glyphicon glyphicon-tower'; // staff
|
||||
return style;
|
||||
}
|
||||
|
||||
$rootScope.playSound = function(id){
|
||||
if (!user.preferences.sound) return;
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ var UserSchema = new Schema({
|
|||
},
|
||||
|
||||
contributor: {
|
||||
level: Number, // 1-7, see https://trello.com/c/wkFzONhE/277-contributor-gear
|
||||
level: Number, // 1-9, see https://trello.com/c/wkFzONhE/277-contributor-gear https://github.com/HabitRPG/habitrpg/issues/3801
|
||||
admin: Boolean,
|
||||
sudo: Boolean,
|
||||
text: String, // Artisan, Friend, Blacksmith, etc
|
||||
|
|
|
|||
|
|
@ -28,7 +28,10 @@ script(type='text/ng-template', id='partials/options.social.hall.heroes.html')
|
|||
label=env.t('contribLevel')
|
||||
input.form-control(type='number', step="any", ng-model='hero.contributor.level')
|
||||
small=env.t('contribHallText')
|
||||
|
|
||||
a(target='_blank', href='https://trello.com/c/wkFzONhE/277-contributor-gear')=env.t('moreDetails')
|
||||
|,
|
||||
a(target='_blank', href='https://github.com/HabitRPG/habitrpg/issues/3801')=env.t('moreDetails2')
|
||||
.form-group
|
||||
textarea.form-control(cols=5, placeholder=env.t('contributions'), ng-model='hero.contributor.contributions')
|
||||
include ../../shared/formatting-help
|
||||
|
|
@ -88,7 +91,7 @@ script(type='text/ng-template', id='partials/options.social.hall.heroes.html')
|
|||
span(ng-if='hero.contributor.admin',popover=env.t('gamemaster'),popover-trigger='mouseenter',popover-placement='right')
|
||||
a.label.label-default(ng-class='userLevelStyle(hero)', ng-click='clickMember(hero._id, true)')
|
||||
| {{hero.profile.name}}
|
||||
span.glyphicon.glyphicon-star
|
||||
span(ng-class='userAdminGlyphiconStyle(hero)')
|
||||
span(ng-if='!hero.contributor.admin')
|
||||
a.label.label-default(ng-class='userLevelStyle(hero)', ng-click='clickMember(hero._id, true)') {{hero.profile.name}}
|
||||
td(ng-if='user.contributor.admin') {{hero._id}}
|
||||
|
|
|
|||
Loading…
Reference in a new issue