From 1a567ce82fa9bca1aa43ffcebb9affba05765059 Mon Sep 17 00:00:00 2001 From: pollockjj Date: Sat, 29 Nov 2014 12:25:21 -0600 Subject: [PATCH 1/3] Changes to address github ticket: Differentiate Locked and Unlocked Backgrounds (#4261). Added two new background-specific styles to customizer.styl and utilized them in profile.jade by checking for ownership of the asset and displaying a border or not, as appropriate --- public/css/customizer.styl | 13 ++++++++++++- views/options/profile.jade | 7 ++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/public/css/customizer.styl b/public/css/customizer.styl index 9a3e8253cc..6247f5cc9b 100644 --- a/public/css/customizer.styl +++ b/public/css/customizer.styl @@ -65,4 +65,15 @@ menu .well.limited-edition padding: 5px - margin: 25px 0 0 \ No newline at end of file + margin: 25px 0 0 + +.background-unlocked + border 4px solid white + width: 144px !important + height: 152px !important + +.background-locked + border 4px solid gray + width: 144px !important + height: 152px !important + diff --git a/views/options/profile.jade b/views/options/profile.jade index 5920b9df78..d3d8bd9fce 100644 --- a/views/options/profile.jade +++ b/views/options/profile.jade @@ -188,8 +188,8 @@ mixin profileStats td= env.t('allocatePer') + ' {{user.stats.per}}' td a.btn.btn-primary(ng-show='user.stats.points', ng-click='allocate("per")', popover-trigger='mouseenter', popover-placement='right', popover=env.t('allocatePerPop')) + - - + + div(ng-class='user.flags.classSelected && !user.preferences.disableClasses ? "col-md-4" : "col-md-6"') button.btn.btn-default(ng-if='user.preferences.disableClasses', ng-click='user.ops.changeClass({})', popover-trigger='mouseenter', popover-placement='right', popover=env.t('enableClassPop'))= env.t('enableClass') hr(ng-if='user.preferences.disableClasses') @@ -250,7 +250,8 @@ mixin backgrounds(mobile) //-button.btn.btn-xs(ng-hide="ownsSet('background',Content.backgrounds['#{k}'])",ng-click="unlock(setKeys('background',Content.backgrounds['#{k}']))")!= env.t('unlockSet',{cost:15}) + ' ' button.btn.btn-xs(ng-hide="ownsSet('background',#{JSON.stringify(bgs)})",ng-click="unlock(setKeys('background',#{JSON.stringify(bgs)}))")!= env.t('unlockSet',{cost:15}) + ' ' each bg,k in bgs - button.customize-option(type='button',class='background_#{k}',ng-click='unlock("background.#{k}")',popover-title=bg.text(),popover=bg.notes(),popover-trigger='mouseenter') + button.customize-option(type='button',class='background_#{k}',ng-click='unlock("background.#{k}")',popover-title=bg.text(),popover=bg.notes(),popover-trigger='mouseenter').background-unlocked(ng-if='user.purchased.background.#{k}') + button.customize-option(type='button',class='background_#{k}',ng-click='unlock("background.#{k}")',popover-title=bg.text(),popover=bg.notes(),popover-trigger='mouseenter').background-locked(ng-if='!user.purchased.background.#{k}') - } script(type='text/ng-template', id='partials/options.profile.backgrounds.html') From 9abaedc7c5e94121660dd3a4fefd446ba7055c92 Mon Sep 17 00:00:00 2001 From: pollockjj Date: Sat, 29 Nov 2014 13:17:54 -0600 Subject: [PATCH 2/3] Modified two-line solution for ticket #4261 to one-line based on feedback/solution from B. Barringer --- views/options/profile.jade | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/views/options/profile.jade b/views/options/profile.jade index d3d8bd9fce..5774a80d7d 100644 --- a/views/options/profile.jade +++ b/views/options/profile.jade @@ -250,8 +250,7 @@ mixin backgrounds(mobile) //-button.btn.btn-xs(ng-hide="ownsSet('background',Content.backgrounds['#{k}'])",ng-click="unlock(setKeys('background',Content.backgrounds['#{k}']))")!= env.t('unlockSet',{cost:15}) + ' ' button.btn.btn-xs(ng-hide="ownsSet('background',#{JSON.stringify(bgs)})",ng-click="unlock(setKeys('background',#{JSON.stringify(bgs)}))")!= env.t('unlockSet',{cost:15}) + ' ' each bg,k in bgs - button.customize-option(type='button',class='background_#{k}',ng-click='unlock("background.#{k}")',popover-title=bg.text(),popover=bg.notes(),popover-trigger='mouseenter').background-unlocked(ng-if='user.purchased.background.#{k}') - button.customize-option(type='button',class='background_#{k}',ng-click='unlock("background.#{k}")',popover-title=bg.text(),popover=bg.notes(),popover-trigger='mouseenter').background-locked(ng-if='!user.purchased.background.#{k}') + button.customize-option(type='button',class='background_#{k}',ng-class="user.purchased.background.#{k} ? 'background-unlocked' : 'background-locked'", ng-click='unlock("background.#{k}")',popover-title=bg.text(),popover=bg.notes(),popover-trigger='mouseenter') - } script(type='text/ng-template', id='partials/options.profile.backgrounds.html') From 6520caed7d1eda81e81cc7c58a047144995ec199 Mon Sep 17 00:00:00 2001 From: pollockjj Date: Sat, 29 Nov 2014 21:56:10 -0600 Subject: [PATCH 3/3] Modified to 15px border and lock icon based on feedback from dev team --- public/css/customizer.styl | 21 +++++++++++++++------ views/options/profile.jade | 3 ++- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/public/css/customizer.styl b/public/css/customizer.styl index 6247f5cc9b..4c8a513448 100644 --- a/public/css/customizer.styl +++ b/public/css/customizer.styl @@ -68,12 +68,21 @@ menu margin: 25px 0 0 .background-unlocked - border 4px solid white - width: 144px !important - height: 152px !important + border 15px solid white + width: 170px !important + height: 177px !important .background-locked - border 4px solid gray - width: 144px !important - height: 152px !important + border 15px solid gray + width: 170px !important + height: 177px !important +.background-locked + position: relative + +.background-locked i + position: absolute; + right: -13px; + bottom: -13px; + color: white; + top: auto; \ No newline at end of file diff --git a/views/options/profile.jade b/views/options/profile.jade index 5774a80d7d..abf1aa31a2 100644 --- a/views/options/profile.jade +++ b/views/options/profile.jade @@ -250,7 +250,8 @@ mixin backgrounds(mobile) //-button.btn.btn-xs(ng-hide="ownsSet('background',Content.backgrounds['#{k}'])",ng-click="unlock(setKeys('background',Content.backgrounds['#{k}']))")!= env.t('unlockSet',{cost:15}) + ' ' button.btn.btn-xs(ng-hide="ownsSet('background',#{JSON.stringify(bgs)})",ng-click="unlock(setKeys('background',#{JSON.stringify(bgs)}))")!= env.t('unlockSet',{cost:15}) + ' ' each bg,k in bgs - button.customize-option(type='button',class='background_#{k}',ng-class="user.purchased.background.#{k} ? 'background-unlocked' : 'background-locked'", ng-click='unlock("background.#{k}")',popover-title=bg.text(),popover=bg.notes(),popover-trigger='mouseenter') + button.customize-option(type='button', class='background_#{k}', ng-class="user.purchased.background.#{k} ? 'background-unlocked' : 'background-locked'", ng-click='unlock("background.#{k}")', popover-title=bg.text(), popover=bg.notes(),popover-trigger='mouseenter') + i.glyphicon.glyphicon-lock(ng-if="!user.purchased.background.#{k}") - } script(type='text/ng-template', id='partials/options.profile.backgrounds.html')