mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 07:37:25 +01:00
refactor: Reduce duplication of stat setting
This commit is contained in:
@@ -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')
|
|
||||||
|
|||||||
Reference in New Issue
Block a user