Limit to showing 6 concepts. For now, show the last 6 in the array.

This commit is contained in:
Cat Sync 2015-07-21 13:28:13 -04:00
parent b6cbf84f48
commit 11aeb05e66
2 changed files with 9 additions and 4 deletions
app

View file

@ -1,6 +1,6 @@
a(href="/")
img#small-nav-logo(src="/images/pages/base/logo.png", title="CodeCombat - Learn how to code by playing a game", alt="CodeCombat")
if campaign
.map
.gradient.horizontal-gradient.top-gradient
@ -39,9 +39,9 @@ if campaign
a.spr(href="/contribute/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.
if level.concepts && level.concepts.length
if level.displayConcepts && level.displayConcepts.length
p
for concept in level.concepts
for concept in level.displayConcepts
kbd(data-i18n="concepts." + concept)
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")
if me.get('anonymous', true)
button.btn.settings(data-toggle='coco-modal', data-target='core/AuthModal', data-i18n="[title]play.settings")
.user-status.header-font
.user-status-line
span.gem.gem-30

View file

@ -275,6 +275,11 @@ module.exports = class CampaignView extends RootView
if level.unlocksHero
level.purchasedHero = level.unlocksHero in (me.get('purchased')?.heroes or [])
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
countLevels: (levels) ->