More humane view of i18n-editor

Change the layout to
Description
en
non-en
This commit is contained in:
nixel2007 2015-03-11 16:45:35 +03:00
parent 8739f6c409
commit e5c8fc4a1c
2 changed files with 17 additions and 10 deletions

View file

@ -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

View file

@ -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