Added first draft of campaign info to campaign selector screen.

This commit is contained in:
Nick Winter 2015-03-18 16:20:30 -07:00
parent a004c8376c
commit 585fa40a8c
6 changed files with 16 additions and 5 deletions

View file

@ -4,8 +4,9 @@ CampaignSchema = c.object()
c.extendNamedProperties CampaignSchema # name first
_.extend CampaignSchema.properties, {
i18n: {type: 'object', title: 'i18n', format: 'i18n', props: ['name', 'fullName']}
i18n: {type: 'object', title: 'i18n', format: 'i18n', props: ['name', 'fullName', 'description']}
fullName: { type: 'string', title: 'Full Name', description: 'Ex.: "Kithgard Dungeon"' }
description: { type: 'string', format: 'string', description: 'How long it takes and what players learn.' }
ambientSound: c.object {},
mp3: { type: 'string', format: 'sound-file' }

View file

@ -562,16 +562,20 @@ $gameControlMargin: 30px
width: 100%
text-align: center
.campaign-name, .levels-completed, .campaign-locked
.campaign-name, .levels-completed, .campaign-locked, .campaign-description
margin: 0
color: white
text-shadow: black 2px 2px 0, black -2px -2px 0, black 2px -2px 0, black -2px 2px 0, black 2px 0px 0, black 0px -2px 0, black -2px 0px 0, black 0px 2px 0
.campaign-description
margin: 0px 40px
font-size: 22px
.levels-completed
font-size: 22px
.play-button
margin-top: 30px
margin: 15px 0
min-width: 100px
#small-nav-logo

View file

@ -78,6 +78,9 @@ else
h3.campaign-locked(data-i18n="play.locked") Locked
else if campaign
btn(data-i18n="common.play").btn.btn-illustrated.btn-lg.btn-success.play-button
if campaign && campaign.get('description')
h3.campaign-description
span= i18n(campaign.attributes, 'description')
.game-controls.header-font
button.btn.poll.hidden(data-i18n="[title]play.poll")

View file

@ -14,3 +14,5 @@ module.exports = class I18NEditCampaignView extends I18NEditModelView
@wrapRow 'Campaign short name', ['name'], name, i18n[lang]?.name, []
if fullName = @model.get('fullName')
@wrapRow 'Campaign full name', ['fullName'], fullName, i18n[lang]?.fullName, []
if description = @model.get('description')
@wrapRow 'Campaign description', ['description'], description, i18n[lang]?.description, []

View file

@ -34,7 +34,7 @@ class LevelSessionsCollection extends CocoCollection
class CampaignsCollection extends CocoCollection
url: '/db/campaign'
model: Campaign
project: ['name', 'fullName', 'i18n']
project: ['name', 'fullName', 'description', 'i18n']
module.exports = class CampaignView extends RootView
id: 'campaign-view'

View file

@ -10,6 +10,7 @@ CampaignHandler = class CampaignHandler extends Handler
editableProperties: [
'name'
'fullName'
'description'
'i18n'
'i18nCoverage'
'ambientSound'
@ -29,7 +30,7 @@ CampaignHandler = class CampaignHandler extends Handler
if @modelClass.schema.uses_coco_translation_coverage and (method or req.method).toLowerCase() in ['post', 'put']
return true if @isJustFillingTranslations(req, document)
if req.method is 'GET'
return true