From 3f16cd4fbf49af4c90b347ccd6965eb778fc16d7 Mon Sep 17 00:00:00 2001 From: Blade Barringer Date: Wed, 16 Mar 2016 22:06:13 -0500 Subject: [PATCH] refactor: Adjust stat allocation modal --- common/locales/en/character.json | 3 ++- website/views/shared/mixins.jade | 13 +++++++++++-- website/views/shared/modals/level-up.jade | 6 ++++-- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/common/locales/en/character.json b/common/locales/en/character.json index 778d26fcda..e1548be916 100644 --- a/common/locales/en/character.json +++ b/common/locales/en/character.json @@ -161,6 +161,7 @@ "con": "CON", "per": "PER", "int": "INT", - "showHideQuickAllocation": "Show/hide stat allocation", + "showQuickAllocation": "Show stat allocation", + "hideQuickAllocation": "Hide stat allocation", "quickAllocationLevelPopover": "Each level earns you one point to assign to an attribute of your choice. You can do so manually, or let the game decide for you using one of the Automatic Allocation options found in User -> Stats." } diff --git a/website/views/shared/mixins.jade b/website/views/shared/mixins.jade index b7b5d261f8..442e1ab5e9 100644 --- a/website/views/shared/mixins.jade +++ b/website/views/shared/mixins.jade @@ -35,10 +35,19 @@ mixin ownedQuests(popoverAppend, popoverPlacement) .badge.badge-info.stack-count {{points}} mixin statAllocation - each statInfo, stat in { 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'} } + - + 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)) + + a.btn.btn-primary(ng-show='user.stats.points', ng-click='allocate("#{stat}")', + popover-trigger='mouseenter', popover-placement='right', popover=env.t(statInfo.allocatepop)) + diff --git a/website/views/shared/modals/level-up.jade b/website/views/shared/modals/level-up.jade index 7bf58bc095..2b1d44ebe9 100644 --- a/website/views/shared/modals/level-up.jade +++ b/website/views/shared/modals/level-up.jade @@ -17,9 +17,11 @@ script(type='text/ng-template', id='modals/levelUp.html') p=env.t('fullyHealed') br div(ng-if='user.flags.classSelected && !user.preferences.disableClasses && !user.preferences.automaticAllocation') - a.btn.btn-default(data-toggle='collapse', data-target='#stat-allocation', aria-expanded=false, aria-controls='stat-allocation')=env.t('showHideQuickAllocation') + a.btn.btn-default(ng-click='statsAllocationBoxIsOpen = !statsAllocationBoxIsOpen', + data-toggle='collapse', data-target='#stat-allocation', aria-expanded=false, aria-controls='stat-allocation') + | {{statsAllocationBoxIsOpen ? env.t('hideQuickAllocation') : env.t('showQuickAllocation')}} p   - div.collapse#stat-allocation + .collapse#stat-allocation table.table.text-left tr td