Limit to showing 6 concepts. For now, show the last 6 in the array.
This commit is contained in:
parent
b6cbf84f48
commit
11aeb05e66
2 changed files with 9 additions and 4 deletions
app
|
@ -1,6 +1,6 @@
|
||||||
a(href="/")
|
a(href="/")
|
||||||
img#small-nav-logo(src="/images/pages/base/logo.png", title="CodeCombat - Learn how to code by playing a game", alt="CodeCombat")
|
img#small-nav-logo(src="/images/pages/base/logo.png", title="CodeCombat - Learn how to code by playing a game", alt="CodeCombat")
|
||||||
|
|
||||||
if campaign
|
if campaign
|
||||||
.map
|
.map
|
||||||
.gradient.horizontal-gradient.top-gradient
|
.gradient.horizontal-gradient.top-gradient
|
||||||
|
@ -39,9 +39,9 @@ if campaign
|
||||||
a.spr(href="/contribute/adventurer")
|
a.spr(href="/contribute/adventurer")
|
||||||
strong(data-i18n="play.awaiting_levels_adventurer") Sign up as an Adventurer
|
strong(data-i18n="play.awaiting_levels_adventurer") Sign up as an Adventurer
|
||||||
span.spl(data-i18n="play.awaiting_levels_adventurer_suffix") to be the first to play new levels.
|
span.spl(data-i18n="play.awaiting_levels_adventurer_suffix") to be the first to play new levels.
|
||||||
if level.concepts && level.concepts.length
|
if level.displayConcepts && level.displayConcepts.length
|
||||||
p
|
p
|
||||||
for concept in level.concepts
|
for concept in level.displayConcepts
|
||||||
kbd(data-i18n="concepts." + concept)
|
kbd(data-i18n="concepts." + concept)
|
||||||
|
|
||||||
if !level.disabled && !level.locked
|
if !level.disabled && !level.locked
|
||||||
|
@ -101,7 +101,7 @@ else
|
||||||
// button.btn.settings(data-toggle='coco-modal', data-target='play/modal/PlaySettingsModal', data-i18n="[title]play.settings")
|
// button.btn.settings(data-toggle='coco-modal', data-target='play/modal/PlaySettingsModal', data-i18n="[title]play.settings")
|
||||||
if me.get('anonymous', true)
|
if me.get('anonymous', true)
|
||||||
button.btn.settings(data-toggle='coco-modal', data-target='core/AuthModal', data-i18n="[title]play.settings")
|
button.btn.settings(data-toggle='coco-modal', data-target='core/AuthModal', data-i18n="[title]play.settings")
|
||||||
|
|
||||||
.user-status.header-font
|
.user-status.header-font
|
||||||
.user-status-line
|
.user-status-line
|
||||||
span.gem.gem-30
|
span.gem.gem-30
|
||||||
|
|
|
@ -275,6 +275,11 @@ module.exports = class CampaignView extends RootView
|
||||||
if level.unlocksHero
|
if level.unlocksHero
|
||||||
level.purchasedHero = level.unlocksHero in (me.get('purchased')?.heroes or [])
|
level.purchasedHero = level.unlocksHero in (me.get('purchased')?.heroes or [])
|
||||||
level.hidden = level.locked
|
level.hidden = level.locked
|
||||||
|
if level.concepts?.length
|
||||||
|
level.displayConcepts = level.concepts
|
||||||
|
maxConcepts = 6
|
||||||
|
if level.displayConcepts.length > maxConcepts
|
||||||
|
level.displayConcepts = level.displayConcepts.slice -maxConcepts
|
||||||
level
|
level
|
||||||
|
|
||||||
countLevels: (levels) ->
|
countLevels: (levels) ->
|
||||||
|
|
Reference in a new issue