mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-26 22:13:32 -04:00
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
|
||||
|
||||
_.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' }
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -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, []
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue