refactor: Reduce duplication of stat setting

This commit is contained in:
Blade Barringer
2016-06-05 07:21:40 -05:00
parent 0e5f748c9a
commit 39aa0b489f

View File

@@ -56,23 +56,9 @@ div(ng-if='::task.type!="reward"')
div(ng-if='::(user.preferences.allocationMode == "taskbased" && user.preferences.automaticAllocation) || $state.is("options.social.challenges")') div(ng-if='::(user.preferences.allocationMode == "taskbased" && user.preferences.automaticAllocation) || $state.is("options.social.challenges")')
legend.option-title.pull-left=env.t('attributes') legend.option-title.pull-left=env.t('attributes')
ul.task-attributes ul.task-attributes
li each attribute, short in {str: 'strength', int: 'intelligence', con: 'constitution', per: 'perception'}
button(type='button', ng-class='{active: task.attribute=="str"}', li
ng-click='task.attribute="str"', button(type='button', ng-class='{active: task.attribute=="#{short}"}',
popover=env.t('strengthExample'), popover-trigger='mouseenter', popover-placement='top') ng-click='task.attribute="#{short}"',
=env.t('strength') popover=env.t('#{attribute}Example'), popover-trigger='mouseenter', popover-placement='top')
li =env.t(attribute)
button(type='button', ng-class='{active: task.attribute=="int"}',
ng-click='task.attribute="int"',
popover=env.t('intelligenceExample'), popover-trigger='mouseenter', popover-placement='top')
=env.t('intelligence')
li
button(type='button', ng-class='{active: task.attribute=="con"}',
ng-click='task.attribute="con"',
popover=env.t('constitutionExample'), popover-trigger='mouseenter', popover-placement='top')
=env.t('constitution')
li
button(type='button', ng-class='{active: task.attribute=="per"}',
ng-click='task.attribute="per"',
popover=env.t('perceptionExamples'), popover-trigger='mouseenter', popover-placement='top')
=env.t('perception')