mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-14 07:00:01 -04:00
More humane view of i18n-editor
Change the layout to Description en non-en
This commit is contained in:
parent
8739f6c409
commit
e5c8fc4a1c
2 changed files with 17 additions and 10 deletions
|
@ -54,12 +54,14 @@ block outer_content
|
|||
|
||||
select.form-control#language-select
|
||||
|
||||
table.table
|
||||
for row in translationList
|
||||
tr(data-format=row.format || '')
|
||||
for row in translationList
|
||||
table.table
|
||||
tr
|
||||
th= row.title
|
||||
tr(data-format=row.format || '')
|
||||
td.english-value-row
|
||||
div= row.enValue
|
||||
tr(data-format=row.format || '')
|
||||
td.to-value-row
|
||||
if row.format === 'markdown'
|
||||
div(data-index=row.index.toString())= row.toValue
|
||||
|
|
|
@ -55,13 +55,18 @@ module.exports = class I18NEditModelView extends RootView
|
|||
editors = []
|
||||
|
||||
@$el.find('tr[data-format="markdown"]').each((index, el) =>
|
||||
englishEditor = ace.edit(enEl=$(el).find('.english-value-row div')[0])
|
||||
englishEditor.el = enEl
|
||||
englishEditor.setReadOnly(true)
|
||||
toEditor = ace.edit(toEl=$(el).find('.to-value-row div')[0])
|
||||
toEditor.el = toEl
|
||||
toEditor.on 'change', @onEditorChange
|
||||
editors = editors.concat([englishEditor, toEditor])
|
||||
foundEnEl = enEl=$(el).find('.english-value-row div')[0]
|
||||
if foundEnEl?
|
||||
englishEditor = ace.edit(foundEnEl)
|
||||
englishEditor.el = enEl
|
||||
englishEditor.setReadOnly(true)
|
||||
editors.push englishEditor
|
||||
foundToEl = toEl=$(el).find('.to-value-row div')[0]
|
||||
if foundToEl?
|
||||
toEditor = ace.edit(foundToEl)
|
||||
toEditor.el = toEl
|
||||
toEditor.on 'change', @onEditorChange
|
||||
editors.push toEditor
|
||||
)
|
||||
|
||||
for editor in editors
|
||||
|
|
Loading…
Reference in a new issue