diff --git a/app/schemas/models/campaign.schema.coffee b/app/schemas/models/campaign.schema.coffee index 47994ee40..03d28ae79 100644 --- a/app/schemas/models/campaign.schema.coffee +++ b/app/schemas/models/campaign.schema.coffee @@ -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' } diff --git a/app/styles/play/campaign-view.sass b/app/styles/play/campaign-view.sass index 260f803c5..813500d51 100644 --- a/app/styles/play/campaign-view.sass +++ b/app/styles/play/campaign-view.sass @@ -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 diff --git a/app/templates/play/campaign-view.jade b/app/templates/play/campaign-view.jade index 926c2fcf6..aecc72a03 100644 --- a/app/templates/play/campaign-view.jade +++ b/app/templates/play/campaign-view.jade @@ -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") diff --git a/app/views/i18n/I18NEditCampaignView.coffee b/app/views/i18n/I18NEditCampaignView.coffee index 48bc4be3b..40d7eeab6 100644 --- a/app/views/i18n/I18NEditCampaignView.coffee +++ b/app/views/i18n/I18NEditCampaignView.coffee @@ -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, [] diff --git a/app/views/play/CampaignView.coffee b/app/views/play/CampaignView.coffee index c9aa9895c..f03e2477c 100644 --- a/app/views/play/CampaignView.coffee +++ b/app/views/play/CampaignView.coffee @@ -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' diff --git a/server/campaigns/campaign_handler.coffee b/server/campaigns/campaign_handler.coffee index 0f4b75de1..7ca1bd372 100644 --- a/server/campaigns/campaign_handler.coffee +++ b/server/campaigns/campaign_handler.coffee @@ -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