From ecb5169ca7e2fef8a3ddec6cb1172dc86a2138a5 Mon Sep 17 00:00:00 2001 From: Matt Lott Date: Tue, 14 Jun 2016 10:29:30 -0700 Subject: [PATCH] Add hintsB to level schema --- app/schemas/models/level.coffee | 9 ++++++++- app/views/i18n/I18NEditLevelView.coffee | 4 ++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/app/schemas/models/level.coffee b/app/schemas/models/level.coffee index a6f7a42e7..caca6a8b8 100644 --- a/app/schemas/models/level.coffee +++ b/app/schemas/models/level.coffee @@ -279,7 +279,14 @@ _.extend LevelSchema.properties, documentation: c.object {title: 'Documentation', description: 'Documentation articles relating to this level.', 'default': {specificArticles: [], generalArticles: []}}, specificArticles: c.array {title: 'Specific Articles', description: 'Specific documentation articles that live only in this level.', uniqueItems: true }, SpecificArticleSchema generalArticles: c.array {title: 'General Articles', description: 'General documentation articles that can be linked from multiple levels.', uniqueItems: true}, GeneralArticleSchema - hints: c.array {title: 'Hints', description: 'Hints that will be gradually revealed to the player.', uniqueItems: true }, { + hints: c.array {title: 'Hints', description: 'Tips and tricks to help unstick a player for the level.', uniqueItems: true }, { + type: 'object' + properties: { + body: {type: 'string', title: 'Content', description: 'The body content of the article, in Markdown.', format: 'markdown'} + i18n: {type: 'object', format: 'i18n', props: ['body'], description: 'Help translate this hint'} + } + } + hintsB: c.array {title: 'HintsB', description: '2nd style of hints for a/b testing significant variations', uniqueItems: true }, { type: 'object' properties: { body: {type: 'string', title: 'Content', description: 'The body content of the article, in Markdown.', format: 'markdown'} diff --git a/app/views/i18n/I18NEditLevelView.coffee b/app/views/i18n/I18NEditLevelView.coffee index 6a333ab09..375d67c3a 100644 --- a/app/views/i18n/I18NEditLevelView.coffee +++ b/app/views/i18n/I18NEditLevelView.coffee @@ -34,6 +34,10 @@ module.exports = class I18NEditLevelView extends I18NEditModelView if i18n = hint.i18n name = "Hint #{index+1}" @wrapRow "'#{name}' body", ['body'], hint.body, i18n[lang]?.body, ['documentation', 'hints', index], 'markdown' + for hint, index in @model.get('documentation')?.hintsB ? [] + if i18n = hint.i18n + name = "Hint #{index+1}" + @wrapRow "'#{name}' body", ['body'], hint.body, i18n[lang]?.body, ['documentation', 'hints', index], 'markdown' # sprite dialogues for script, scriptIndex in @model.get('scripts') ? []