Added first draft of campaign info to campaign selector screen.
This commit is contained in:
parent
a004c8376c
commit
585fa40a8c
6 changed files with 16 additions and 5 deletions
app
schemas/models
styles/play
templates/play
views
server/campaigns
|
@ -4,8 +4,9 @@ CampaignSchema = c.object()
|
||||||
c.extendNamedProperties CampaignSchema # name first
|
c.extendNamedProperties CampaignSchema # name first
|
||||||
|
|
||||||
_.extend CampaignSchema.properties, {
|
_.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"' }
|
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 {},
|
ambientSound: c.object {},
|
||||||
mp3: { type: 'string', format: 'sound-file' }
|
mp3: { type: 'string', format: 'sound-file' }
|
||||||
|
|
|
@ -562,16 +562,20 @@ $gameControlMargin: 30px
|
||||||
width: 100%
|
width: 100%
|
||||||
text-align: center
|
text-align: center
|
||||||
|
|
||||||
.campaign-name, .levels-completed, .campaign-locked
|
.campaign-name, .levels-completed, .campaign-locked, .campaign-description
|
||||||
margin: 0
|
margin: 0
|
||||||
color: white
|
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
|
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
|
.levels-completed
|
||||||
font-size: 22px
|
font-size: 22px
|
||||||
|
|
||||||
.play-button
|
.play-button
|
||||||
margin-top: 30px
|
margin: 15px 0
|
||||||
min-width: 100px
|
min-width: 100px
|
||||||
|
|
||||||
#small-nav-logo
|
#small-nav-logo
|
||||||
|
|
|
@ -78,6 +78,9 @@ else
|
||||||
h3.campaign-locked(data-i18n="play.locked") Locked
|
h3.campaign-locked(data-i18n="play.locked") Locked
|
||||||
else if campaign
|
else if campaign
|
||||||
btn(data-i18n="common.play").btn.btn-illustrated.btn-lg.btn-success.play-button
|
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
|
.game-controls.header-font
|
||||||
button.btn.poll.hidden(data-i18n="[title]play.poll")
|
button.btn.poll.hidden(data-i18n="[title]play.poll")
|
||||||
|
|
|
@ -14,3 +14,5 @@ module.exports = class I18NEditCampaignView extends I18NEditModelView
|
||||||
@wrapRow 'Campaign short name', ['name'], name, i18n[lang]?.name, []
|
@wrapRow 'Campaign short name', ['name'], name, i18n[lang]?.name, []
|
||||||
if fullName = @model.get('fullName')
|
if fullName = @model.get('fullName')
|
||||||
@wrapRow 'Campaign full name', ['fullName'], fullName, i18n[lang]?.fullName, []
|
@wrapRow 'Campaign full name', ['fullName'], fullName, i18n[lang]?.fullName, []
|
||||||
|
if description = @model.get('description')
|
||||||
|
@wrapRow 'Campaign description', ['description'], description, i18n[lang]?.description, []
|
||||||
|
|
|
@ -34,7 +34,7 @@ class LevelSessionsCollection extends CocoCollection
|
||||||
class CampaignsCollection extends CocoCollection
|
class CampaignsCollection extends CocoCollection
|
||||||
url: '/db/campaign'
|
url: '/db/campaign'
|
||||||
model: Campaign
|
model: Campaign
|
||||||
project: ['name', 'fullName', 'i18n']
|
project: ['name', 'fullName', 'description', 'i18n']
|
||||||
|
|
||||||
module.exports = class CampaignView extends RootView
|
module.exports = class CampaignView extends RootView
|
||||||
id: 'campaign-view'
|
id: 'campaign-view'
|
||||||
|
|
|
@ -10,6 +10,7 @@ CampaignHandler = class CampaignHandler extends Handler
|
||||||
editableProperties: [
|
editableProperties: [
|
||||||
'name'
|
'name'
|
||||||
'fullName'
|
'fullName'
|
||||||
|
'description'
|
||||||
'i18n'
|
'i18n'
|
||||||
'i18nCoverage'
|
'i18nCoverage'
|
||||||
'ambientSound'
|
'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']
|
if @modelClass.schema.uses_coco_translation_coverage and (method or req.method).toLowerCase() in ['post', 'put']
|
||||||
return true if @isJustFillingTranslations(req, document)
|
return true if @isJustFillingTranslations(req, document)
|
||||||
|
|
||||||
if req.method is 'GET'
|
if req.method is 'GET'
|
||||||
return true
|
return true
|
||||||
|
|
||||||
|
|
Reference in a new issue