habitica-self-host/website/views/shared/mixins.jade
Josh Holland cdeb498c0b Align guild gems box with other page elements (#7829)
* Align guild gems box with other page elements

Fixes #7796.

* Fix issues caused by aligning guild gems box

* Remove unnecessary comment

* Connect gem total box and plus/add gems button

When the add gems button is displayed, set border-radius on touching
corners between the two buttons to 0, so that they are displayed as a
unit rather than two separate buttons.
2016-08-11 07:45:21 -05:00

53 lines
2.8 KiB
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

mixin gemButton(isGemsModal)
a.pull-right.gem-wallet(ng-click=( isGemsModal ? '' : 'openModal("buyGems",{track:"Gems > Wallet"})'), popover-trigger='mouseenter', popover-title=env.t('gemsPopoverTitle'), popover=env.t('gemsWhatFor'), popover-placement='bottom')
if !isGemsModal
span.task-action-btn.tile.flush.bright.add-gems-btn
span.task-action-btn.tile.flush.neutral(class={"has-add-gems": !isGemsModal})
.Pet_Currency_Gem2x.Gems
=env.t('gemButton', {number: '{{user.balance * 4 | number:0}}'})
mixin aLink(url, label)
if mobile
a(href="", ng-click="externalLink('#{url}')")= label
else
a(href='#{url}', target='_blank')= label
mixin previewMarkdown(text)
.panel.panel-warning
.panel-heading=env.t('msgPreviewHeading')
.panel-body.markdown-preview
markdown(text='#{text}')
mixin ownedQuests(popoverAppend, popoverPlacement)
menu.inventory-list
li.customize-menu
p.muted(ng-show='questCount < 1')=env.t('noScrolls')
div(ng-repeat='type in Content.userCanOwnQuestCategories track by $index')
menu.pets-menu(ng-if='Shared.count.questsOfCategory(user.items.quests,type) > 0', label='{{::env.t(type + "Quests")}}')
div(ng-repeat='(quest_key,points) in ownedItems(user.items.quests)', ng-init='quest = Content.quests[quest_key]', ng-if='Content.quests[quest_key].category === type')
button.customize-option(ng-class='lockQuest(quest) ? "inventory_quest_scroll_locked inventory_quest_scroll_{{::quest.key}}_locked locked" : "inventory_quest_scroll inventory_quest_scroll_{{::quest.key}}"',
ng-click='$close(); showQuest(quest_key)',
data-popover-html="{{::lockQuest(quest) ? env.t('scrollsPre') : questPopover(quest) | markdown}}",
popover-title='{{::quest.text()}}',
popover-trigger='mouseenter',
popover-append-to-body='#{popoverAppend}',
popover-placement='#{popoverPlacement}')
.badge.badge-info.stack-count {{points}}
mixin statAllocation
-
var stats = {
str: { title:"allocateStr",popover:'strengthText',allocatepop:'allocateStrPop' },
int: { title:"allocateInt",popover:'intText',allocatepop:'allocateIntPop' },
con: { title:"allocateCon",popover:'conText',allocatepop:'allocateConPop' },
per: { title:"allocatePer",popover:'perText',allocatepop:'allocatePerPop' }
}
each statInfo, stat in stats
tr
td
span.hint(popover-trigger='mouseenter', popover-placement='right', popover=env.t(statInfo.popover))
=env.t(statInfo.title) + ' {{user.stats.' + stat + '}}'
td
a.btn.btn-primary(ng-show='user.stats.points', ng-click='allocate("#{stat}")',
popover-trigger='mouseenter', popover-placement='right', popover=env.t(statInfo.allocatepop)) +