mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-01 15:31:16 +00:00
add pets count on character popover. also, static bindings wherever
possible - saves CPU
This commit is contained in:
parent
9e86248120
commit
3a64c1104a
2 changed files with 7 additions and 4 deletions
|
|
@ -151,4 +151,6 @@ viewHelpers = (view) ->
|
|||
|
||||
view.fn 'ownsPet', (pet, userPets) -> userPets?.indexOf(pet) != -1
|
||||
|
||||
view.fn 'count', (arr) -> (arr?.length - 1) or 0
|
||||
|
||||
module.exports = { viewHelpers, removeWhitespace, randomVal, daysBetween, dayMapping, username }
|
||||
|
|
|
|||
|
|
@ -48,11 +48,11 @@
|
|||
|
||||
<avatar:>
|
||||
<figure class="herobox"
|
||||
data-name="{username(@profile.auth)}"
|
||||
data-name="{{username(@profile.auth)}}"
|
||||
data-level="{@profile.stats.lvl}"
|
||||
data-checkpet="{#if @profile.items.pet}hasPet{/}"
|
||||
data-checkuser="{#if equal(@profile.id, _user.id)}isUser{/}"
|
||||
data-toggle='modal' data-target='#avatar-modal' data-uid="{@profile.id}" x-bind="click:profileChangeActive"
|
||||
data-checkuser="{{#if equal(@profile.id, _user.id)}}isUser{{/}}"
|
||||
data-toggle='modal' data-target='#avatar-modal' data-uid="{{@profile.id}}" x-bind="click:profileChangeActive"
|
||||
rel="popover" data-placement="bottom" data-trigger="hover" data-html="true" data-content="
|
||||
<div>
|
||||
<div class='progress progress-danger' style='height:5px;'>
|
||||
|
|
@ -62,7 +62,8 @@
|
|||
<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: {{floor(@profile.stats.gp)}}</div>
|
||||
<div>GP: {floor(@profile.stats.gp)}</div>
|
||||
<div>{count(@profile.items.pets)} / 90 Pets Found</div>
|
||||
</div>
|
||||
">
|
||||
<div class='character-sprites'>
|
||||
|
|
|
|||
Loading…
Reference in a new issue