Using extendedName.

This commit is contained in:
Nick Winter 2014-11-05 20:22:15 -08:00
parent ce8b3bc83c
commit 851bf39c5c
4 changed files with 7 additions and 4 deletions

View file

@ -146,7 +146,8 @@ _.extend ThangTypeSchema.properties,
type: 'number'
description: 'Snap to this many meters in the y-direction.'
components: c.array {title: 'Components', description: 'Thangs are configured by changing the Components attached to them.', uniqueItems: true, format: 'thang-components-array'}, ThangComponentSchema # TODO: uniqueness should be based on 'original', not whole thing
i18n: {type: 'object', format: 'i18n', props: ['name', 'description'], description: 'Help translate this ThangType\'s name and description.'}
i18n: {type: 'object', format: 'i18n', props: ['name', 'description', 'extendedName'], description: 'Help translate this ThangType\'s name and description.'}
extendedName: {type: 'string', title: 'Extended Hero Name', description: 'The long form of the hero\'s name. Ex.: "Captain Anya Weston".'}
ThangTypeSchema.required = []

View file

@ -4,7 +4,7 @@ ThangType = require 'models/ThangType'
module.exports = class ThangTypeI18NView extends I18NEditModelView
id: "thang-type-i18n-view"
modelClass: ThangType
buildTranslationList: ->
lang = @selectedLanguage
@model.markToRevert() unless @model.hasLocalChanges()
@ -12,4 +12,5 @@ module.exports = class ThangTypeI18NView extends I18NEditModelView
if i18n
name = @model.get('name')
@wrapRow('Name', ['name'], name, i18n[lang]?.name, [])
@wrapRow('Description', ['description'], @model.get('description'), i18n[lang]?.description, [], 'markdown')
@wrapRow('Description', ['description'], @model.get('description'), i18n[lang]?.description, [], 'markdown')
@wrapRow('Extended Hero Name', ['extendedName'], @model.get('extendedName'), i18n[lang]?.extendedName, [])

View file

@ -27,7 +27,7 @@ module.exports = class PlayHeroesModal extends ModalView
@confirmButtonI18N = options.confirmButtonI18N ? "common.save"
@heroes = new CocoCollection([], {model: ThangType})
@heroes.url = '/db/thang.type?view=heroes'
@heroes.setProjection ['original','name','slug','soundTriggers','featureImage','gems','heroClass','description','components']
@heroes.setProjection ['original','name','slug','soundTriggers','featureImage','gems','heroClass','description','components','extendedName']
@listenToOnce @heroes, 'sync', @onHeroesLoaded
@supermodel.loadCollection(@heroes, 'heroes')
@stages = {}

View file

@ -40,6 +40,7 @@ ThangTypeHandler = class ThangTypeHandler extends Handler
'description'
'gems'
'heroClass'
'extendedName'
]
hasAccess: (req) ->