refactor(avatar): avatar separated into two mixins: +heroBox() and

+avatar(). Mobile will be sharing jade files with web, we'll need more
modular markup
This commit is contained in:
Tyler Renelle 2014-04-26 15:12:03 -06:00
parent 61649d1e5a
commit 979d7d85a4
4 changed files with 16 additions and 11 deletions

View file

@ -20,6 +20,7 @@ html(ng-app="habitrpg", ng-controller="RootCtrl", ng-class='{"applying-action":a
body(ng-cloak, ng-controller='GroupsCtrl')
include ./shared/header/avatar
include ./shared/header/menu
include ./shared/modals/index
include ./shared/header/header

View file

@ -3,7 +3,7 @@
Removing it will remove the user's name, but will allow more room for mounts & helms. IMO this is the lesser of two evils, revisit
//-figure.herobox(ng-click='clickMember(profile._id)', data-name='{{profile.profile.name}}', ng-class='{isUser: profile.id==user.id, hasPet: profile.items.currentPet}', data-level='{{profile.stats.lvl}}', data-uid='{{profile.id}}', rel='popover', data-placement='bottom', data-trigger='hover', data-html='true', data-content="<div ng-hide='profile.id == user.id'> <div class='progress progress-danger' style='height:5px;'> <div class='bar' style='height: 5px; width: {{percent(profile.stats.hp, 50)}}%;'></div> </div> <div class='progress progress-warning' style='height:5px;'> <div class='bar' style='height: 5px; width: {{percent(profile.stats.exp, tnl(profile.stats.lvl))}}%;'></div> </div> <div>Level: {{profile.stats.lvl}}</div> <div>GP: {{profile.stats.gp | number:0}}</div> <div>{{count(profile.items.pets)}} / 90 Pets Found</div> </div>")
figure.herobox(ng-click='spell ? castEnd(profile, "user", $event) : clickMember(profile._id)', data-name='{{profile.profile.name}}', ng-class='{isUser: user._id==profile._id, hasPet:profile.items.currentPet, hasMount:profile.items.currentMount, "cast-target": applyingAction, isLeader: party.leader==profile._id}')
mixin avatar
.character-sprites
// Mount Body
span(ng-if='profile.items.currentMount', class='Mount_Body_{{profile.items.currentMount}}')
@ -66,10 +66,14 @@ figure.herobox(ng-click='spell ? castEnd(profile, "user", $event) : clickMember(
span(ng-class='{zzz:profile.preferences.sleep}')
// 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.label.label-default(ng-class='userLevelStyle(profile)')
span.glyphicon.glyphicon-circle-arrow-up(ng-show='profile.stats.buffs.str || profile.stats.buffs.per || profile.stats.buffs.con || profile.stats.buffs.int || profile.stats.buffs.stealth', tooltip=env.t('buffed'))
|&nbsp;&nbsp;
=env.t('lvl')
|&nbsp;{{profile.stats.lvl}}
|&nbsp;
span.glyphicon.glyphicon-plus-sign(ng-show='profile.achievements.rebirths', tooltip=env.t('reborn', {reLevel: "{{profile.achievements.rebirthLevel}}"}))
mixin herobox
figure.herobox(ng-click='spell ? castEnd(profile, "user", $event) : clickMember(profile._id)', data-name='{{profile.profile.name}}', ng-class='{isUser: user._id==profile._id, hasPet:profile.items.currentPet, hasMount:profile.items.currentMount, "cast-target": applyingAction, isLeader: party.leader==profile._id}')
+avatar()
.avatar-level.label.label-default(ng-class='userLevelStyle(profile)')
span.glyphicon.glyphicon-circle-arrow-up(ng-show='profile.stats.buffs.str || profile.stats.buffs.per || profile.stats.buffs.con || profile.stats.buffs.int || profile.stats.buffs.stealth', tooltip=env.t('buffed'))
|&nbsp;&nbsp;
=env.t('lvl')
|&nbsp;{{profile.stats.lvl}}
|&nbsp;
span.glyphicon.glyphicon-plus-sign(ng-show='profile.achievements.rebirths', tooltip=env.t('reborn', {reLevel: "{{profile.achievements.rebirthLevel}}"}))

View file

@ -4,7 +4,7 @@
header.site-header(ng-hide='user.preferences.hideHeader', role='banner', data-partysize='{{party.members.length>1 ? truarr(party.members.length) : 0}}')
// avatar
.herobox-wrap.main-herobox(ng-controller='UserCtrl')
include avatar
+herobox()
// stat bars
.hero-stats
@ -35,4 +35,4 @@
// party
span(ng-controller='PartyCtrl')
.herobox-wrap(ng-repeat='profile in partyMinusSelf')
include avatar
+herobox()

View file

@ -25,7 +25,7 @@ script(type='text/ng-template', id='modals/member.html')
.label.label-info {{ {warrior:'Warrior',wizard:'Mage',healer:'Healer',rogue:'Rogue'}[profile.stats.class] }}
include ../profiles/stats
.col-md-6
include ../header/avatar
+herobox()
h3 Achievements
include ../profiles/achievements
.modal-footer