Use victory text and next level data on level completion. Update picoCTF logo.

This commit is contained in:
Nick Winter 2016-03-18 14:18:41 -07:00
parent dc3ba40a45
commit 905c9cdb93
5 changed files with 18 additions and 7 deletions
app
assets/images/pages/play
styles/play
templates/play
views/play/level/modal

Binary file not shown.

After

(image error) Size: 3.5 KiB

View file

@ -619,11 +619,12 @@ $gameControlMargin: 30px
z-index: 1
.picoctf-logo .small-nav-logo
height: 30px
height: 90px
.picoctf-powered-by
color: rgb(227, 173, 53)
top: calc(1% + 30px)
top: calc(1% + 90px)
margin: 10px 10px 10px 15px
img
height: 30px

View file

@ -20,7 +20,7 @@ if view.showAds()
.picoctf-show
a(href="http://staging.picoctf.com").picoctf-logo
img.small-nav-logo(src="http://picoctf.com/img/2014_logo_blue2.svg", title="picoCTF home", alt="picoCTF home")
img.small-nav-logo(src="/images/pages/play/picoctf-logo-white.png", title="picoCTF home", alt="picoCTF home")
a(href="http://codecombat.com").picoctf-powered-by
em.spr powered by
img(src="/images/pages/base/logo.png", title="Powered by CodeCombat - Learn how to code by playing a game ", alt="Powered by CodeCombat")

View file

@ -15,12 +15,18 @@
.container-fluid
.row
- var victoryText = view.level.get('victory');
- victoryText = {body: 'You have gotten busted'}
if victoryText && victoryText.body
.well.well-sm.well-parchment
h3= victoryText.body
.row
.col-sm-5.col-sm-offset-2
.col-sm-5
a(href="/play/picoctf")#done-btn.btn.btn-illustrated.btn-primary.btn-block.btn-lg.text-uppercase Done
if view.nextLevel && view.nextLevel.get('slug')
.col-sm-5.col-sm-offset-2
a(href="/play/picoctf")#done-btn.btn.btn-illustrated.btn-primary.btn-block.btn-lg.text-uppercase Done
.col-sm-5
a(href="/play/level/#{view.nextLevel.get('slug')}")#continue-button.btn.btn-illustrated.btn-success.btn-block.btn-lg.text-uppercase Continue
else
.col-sm-5.col-sm-offset-2
.col-sm-5
a(href="/play/picoctf")#done-btn.btn.btn-illustrated.btn-primary.btn-block.btn-lg.text-uppercase Done

View file

@ -15,6 +15,10 @@ module.exports = class PicoCTFVictoryModal extends ModalView
console.log 'submitted', form, 'and got response', response
).load()
if nextLevel = @level.get('nextLevel')
@nextLevel = new Level().setURL "/db/level/#{nextLevel.original}/version/#{nextLevel.majorVersion}"
@nextLevel = @supermodel.loadModel(@nextLevel).model
@playSound 'victory'
onLoaded: ->