habitica/views/shared/header/header.jade

39 lines
2 KiB
Text
Raw Normal View History

// @TODO ui:connectionAlert
.header-wrap
a.label.undo-button(x-bind='click:undo', ng-show='_undo') Undo
include menu
header.site-header(ng-class='{hidden: user.preferences.hideHeader}', role='banner', data-partysize='{{party.members.length>1 ? truarr(party.members.length) : 0}}')
// avatar
.herobox-wrap.main-herobox(ng-controller='UserAvatarCtrl')
include avatar
//app:avatar:avatar(profile='{{user}}', main='true')
2013-08-25 14:57:19 +00:00
// stat bars
.hero-stats
.meter.health(title='Health')
.bar(style='width: {{percent(user.stats.hp, 50)}}%;')
span.meter-text
2013-08-26 01:04:54 +00:00
i.icon-heart
| {{user.stats.hp | number:0}} / 50
.meter.experience(title='Experience')
.bar(style='width: {{percent(user.stats.exp,tnl(user.stats.lvl))}}%;')
span.meter-text
2013-08-26 01:04:54 +00:00
i.icon-star
| {{user.stats.exp | number:0}} / {{tnl(user.stats.lvl)}}
// FIXME doesn't look great here, but the "Experience" CSS title rollover covers it where it was before
span(ng-show='user.history.exp')
a(x-bind='click:toggleChart', data-id='exp', tooltip='Progress')
i.icon-signal
// party
// I have an idea to use this loop for the user's herobox/avatar as well
NOTE TO SELF: Ask Tyler if some kind of inter-leaving is possible
where we can put ONE of the results of this loop BEFORE the progress bars, and the rest after
.herobox-wrap(ng-repeat='memberId in _party.members', ng-class='{hidden: memberId == userId}')
app:avatar:avatar(ng-hide='memberId == userId', profile='{{_members[memberId]}}', party='true')
// Would be way cleaner as a Derby template `data-content="<app:groups:member-stats profile={{:member}} />"`, but it was just printing HTML as text
//
I've re-implemented the rollover using the actual `herobox`/avatar template and data-attributes.
This Derby template idea would have been really handy but this is pretty versatile, and keeps it all in the avatar section
app:alerts:hiding-bailey