From f7503f5dba449303baf39bc0205e36011a63a039 Mon Sep 17 00:00:00 2001 From: Matt Lott Date: Tue, 28 Apr 2015 10:31:35 -0700 Subject: [PATCH] Expanded progress private clans toggle Expand option for level bubbles in the private clan dashboard. --- app/styles/clans/clan-details.sass | 31 ++++++++++++++++++++++++++ app/templates/clans/clan-details.jade | 8 +++++-- app/views/clans/ClanDetailsView.coffee | 10 ++++++++- 3 files changed, 46 insertions(+), 3 deletions(-) diff --git a/app/styles/clans/clan-details.sass b/app/styles/clans/clan-details.sass index 69c3638e4..8ad366396 100644 --- a/app/styles/clans/clan-details.sass +++ b/app/styles/clans/clan-details.sass @@ -1,5 +1,8 @@ #clan-details-view + th + font-size: 16px + .join-clan-link width: 390px @@ -51,6 +54,34 @@ .latest-achievement-cell vertical-align: middle + + .progress-header + margin-right: 14px + + .progress-key + cursor: default + display: inline-block + white-space: nowrap + font-size: 9pt + font-weight: normal + border: 1px solid gray + border-radius: 5px + margin: 0px + padding: 2px + + .progress-key-started + background-color: lightgreen + + .progress-key-complete + background-color: lightgray + + .expand-progress-checkbox + margin-left: 14px + + .expand-progress-label + font-weight: normal + font-size: 14px + .progress-cell padding: 2px padding-bottom: 10px diff --git a/app/templates/clans/clan-details.jade b/app/templates/clans/clan-details.jade index c0c35b7ef..416ac7b23 100644 --- a/app/templates/clans/clan-details.jade +++ b/app/templates/clans/clan-details.jade @@ -83,8 +83,12 @@ block content tr th Hero th - span.spr Progress - small (gray=completed, green=started, white=not started) + span.progress-header Progress + span.progress-key not started + span.progress-key.progress-key-started started + span.progress-key.progress-key-complete complete + input.expand-progress-checkbox(type='checkbox') + span.spl.expand-progress-label Expand levels tbody each member in members tr diff --git a/app/views/clans/ClanDetailsView.coffee b/app/views/clans/ClanDetailsView.coffee index cb62449d9..4992d9919 100644 --- a/app/views/clans/ClanDetailsView.coffee +++ b/app/views/clans/ClanDetailsView.coffee @@ -21,6 +21,7 @@ module.exports = class ClanDetailsView extends RootView template: template events: + 'change .expand-progress-checkbox': 'onExpandedProgressCheckbox' 'click .delete-clan-btn': 'onDeleteClan' 'click .edit-description-save-btn': 'onEditDescriptionSave' 'click .edit-name-save-btn': 'onEditNameSave' @@ -39,6 +40,7 @@ module.exports = class ClanDetailsView extends RootView @stopListening?() initData: -> + @showExpandedProgress = false @stats = {} @campaigns = new CocoCollection([], { url: "/db/campaign", model: Campaign, comparator:'_id' }) @@ -99,7 +101,7 @@ module.exports = class ClanDetailsView extends RootView lastLevelIndex++ context.lastUserCampaignLevelMap = lastUserCampaignLevelMap - context.showExpandedProgress = maxLastUserCampaignLevel <= 30 + context.showExpandedProgress = maxLastUserCampaignLevel <= 30 or @showExpandedProgress context afterRender: -> @@ -247,6 +249,12 @@ module.exports = class ClanDetailsView extends RootView @clan.patch() $('#editNameModal').modal('hide') + onExpandedProgressCheckbox: (e) -> + @showExpandedProgress = $('.expand-progress-checkbox').prop('checked') + # TODO: why does render reset the checkbox to be unchecked? + @render?() + $('.expand-progress-checkbox').attr('checked', @showExpandedProgress) + onJoinClan: (e) -> return @openModalView(new AuthModal()) if me.isAnonymous() return unless @clan.loaded