mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-12-18 11:32:25 -05:00
Expanded progress private clans toggle
Expand option for level bubbles in the private clan dashboard.
This commit is contained in:
parent
a995fb938b
commit
f7503f5dba
3 changed files with 46 additions and 3 deletions
|
@ -1,5 +1,8 @@
|
||||||
#clan-details-view
|
#clan-details-view
|
||||||
|
|
||||||
|
th
|
||||||
|
font-size: 16px
|
||||||
|
|
||||||
.join-clan-link
|
.join-clan-link
|
||||||
width: 390px
|
width: 390px
|
||||||
|
|
||||||
|
@ -51,6 +54,34 @@
|
||||||
.latest-achievement-cell
|
.latest-achievement-cell
|
||||||
vertical-align: middle
|
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
|
.progress-cell
|
||||||
padding: 2px
|
padding: 2px
|
||||||
padding-bottom: 10px
|
padding-bottom: 10px
|
||||||
|
|
|
@ -83,8 +83,12 @@ block content
|
||||||
tr
|
tr
|
||||||
th Hero
|
th Hero
|
||||||
th
|
th
|
||||||
span.spr Progress
|
span.progress-header Progress
|
||||||
small (gray=completed, green=started, white=not started)
|
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
|
tbody
|
||||||
each member in members
|
each member in members
|
||||||
tr
|
tr
|
||||||
|
|
|
@ -21,6 +21,7 @@ module.exports = class ClanDetailsView extends RootView
|
||||||
template: template
|
template: template
|
||||||
|
|
||||||
events:
|
events:
|
||||||
|
'change .expand-progress-checkbox': 'onExpandedProgressCheckbox'
|
||||||
'click .delete-clan-btn': 'onDeleteClan'
|
'click .delete-clan-btn': 'onDeleteClan'
|
||||||
'click .edit-description-save-btn': 'onEditDescriptionSave'
|
'click .edit-description-save-btn': 'onEditDescriptionSave'
|
||||||
'click .edit-name-save-btn': 'onEditNameSave'
|
'click .edit-name-save-btn': 'onEditNameSave'
|
||||||
|
@ -39,6 +40,7 @@ module.exports = class ClanDetailsView extends RootView
|
||||||
@stopListening?()
|
@stopListening?()
|
||||||
|
|
||||||
initData: ->
|
initData: ->
|
||||||
|
@showExpandedProgress = false
|
||||||
@stats = {}
|
@stats = {}
|
||||||
|
|
||||||
@campaigns = new CocoCollection([], { url: "/db/campaign", model: Campaign, comparator:'_id' })
|
@campaigns = new CocoCollection([], { url: "/db/campaign", model: Campaign, comparator:'_id' })
|
||||||
|
@ -99,7 +101,7 @@ module.exports = class ClanDetailsView extends RootView
|
||||||
lastLevelIndex++
|
lastLevelIndex++
|
||||||
|
|
||||||
context.lastUserCampaignLevelMap = lastUserCampaignLevelMap
|
context.lastUserCampaignLevelMap = lastUserCampaignLevelMap
|
||||||
context.showExpandedProgress = maxLastUserCampaignLevel <= 30
|
context.showExpandedProgress = maxLastUserCampaignLevel <= 30 or @showExpandedProgress
|
||||||
context
|
context
|
||||||
|
|
||||||
afterRender: ->
|
afterRender: ->
|
||||||
|
@ -247,6 +249,12 @@ module.exports = class ClanDetailsView extends RootView
|
||||||
@clan.patch()
|
@clan.patch()
|
||||||
$('#editNameModal').modal('hide')
|
$('#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) ->
|
onJoinClan: (e) ->
|
||||||
return @openModalView(new AuthModal()) if me.isAnonymous()
|
return @openModalView(new AuthModal()) if me.isAnonymous()
|
||||||
return unless @clan.loaded
|
return unless @clan.loaded
|
||||||
|
|
Loading…
Reference in a new issue