refactor(profile): character customizations as mixin so can be used on mobile

This commit is contained in:
Tyler Renelle 2014-04-27 00:21:27 -06:00
parent 3a7c994f1a
commit 82eb9a0632

View file

@ -4,17 +4,21 @@ mixin twoGem
= ' ' + env.t('locked')
block
script(id='partials/options.profile.avatar.html', type='text/ng-template')
.row
.col-md-4
// Make it a mixin so we can call it from mobile
mixin customizeProfile(mobile)
div(class='#{mobile ? "" : "row"}')
if mobile
.item.item-divider Body
.col-md-4.item
h3=env.t('bodyBody')
menu(type='list')
li.customize-menu
menu(label=env.t('bodySize'))
.btn-group
button.btn.btn-sm.btn-default(ng-class='{active: user.preferences.size=="slim"}', ng-click='set({"preferences.size":"slim"})')=env.t('bodySlim')
button.btn.btn-sm.btn-default(ng-class='{active: user.preferences.size=="broad"}', ng-click='set({"preferences.size":"broad"})')=env.t('bodyBroad')
.btn-group.button-bar
button.button.btn.btn-sm.btn-default(ng-class='{active: user.preferences.size=="slim"}', ng-click='set({"preferences.size":"slim"})')=env.t('bodySlim')
button.button.btn.btn-sm.btn-default(ng-class='{active: user.preferences.size=="broad"}', ng-click='set({"preferences.size":"broad"})')=env.t('bodyBroad')
li.customize-menu
menu(label=env.t('shirts'))
@ -28,7 +32,9 @@ script(id='partials/options.profile.avatar.html', type='text/ng-template')
button.customize-option(type='button', class='{{user.preferences.size}}_shirt_'+shirt, ng-class='{locked: !user.purchased.shirt.'+shirt+'}', ng-click='unlock("shirt.'+shirt+'")')
.col-md-4
if mobile
.item.item-divider Head
.col-md-4.item
h3=env.t('bodyHead')
menu(type='list')
// For special events code, see commit dfa27b3
@ -97,7 +103,9 @@ script(id='partials/options.profile.avatar.html', type='text/ng-template')
each num in [1,2]
button(class='hair_mustache_#{num}_{{user.preferences.hair.color}} customize-option', type='button', ng-class='{locked: !user.purchased.hair.mustache.#{num}}', ng-click='unlock("hair.mustache.#{num}")')
.col-md-4
if mobile
.item.item-divider Skin
.col-md-4.item
h3=env.t('bodySkin')
// skin
li.customize-menu
@ -120,6 +128,9 @@ script(id='partials/options.profile.avatar.html', type='text/ng-template')
each color in ['monster','pumpkin','skeleton','zombie','ghost','shadow']
button.customize-option(type='button', class='skin_#{color}', ng-if='user.purchased.skin.#{color}', ng-click='unlock("skin.#{color}")')
script(id='partials/options.profile.avatar.html', type='text/ng-template')
+customizeProfile()
script(id='partials/options.profile.stats.html', type='text/ng-template')
.container-fluid
.row