codecombat/app/templates/i18n/i18n-edit-model-view.jade
Scott Erickson 7bab895dee Generalize new I18N view system
Previously, when diplomats submit translations, the system
would try to figure out whether it should be a 'patch' or a 'change',
and then would either create a patch for an admin or artisan to
review and accept or reject, or would apply the changes immediately
and they would be live. This was done as a compromise between
getting translations live quickly, but also preventing already-translated
text from getting overwritten without oversight.

But having the client handle this added logical complexity. So
this makes all diplomats submit patches, no matter what. The server
is then in charge of deciding if it should auto-accept the patch or not.
Either way, a patch is created.

There was also much refactoring. This commit includes:

* Update jsondiffpatch so changes within array items are handled correctly
* Refactor posting patches to use the new auto-accepting logic, and out of Patch model
* Refactor POST /db/patch/:handle/status so that it doesn't rely on handlers
* Refactor patch stat handling to ensure auto-accepted patches are counted
* Refactor User.incrementStat to use mongodb update commands, to avoid race conditions
* Refactor Patch tests
2016-09-09 10:59:26 -07:00

81 lines
2.7 KiB
Text

extends /templates/base
block header
if model.loading
nav.navbar.navbar-default(role='navigation')
.container-fluid
ul.nav.navbar-nav
li
a(href="/i18n")
span.glyphicon-home.glyphicon
else
nav.navbar.navbar-default(role='navigation')
ul.nav.navbar-nav
li
a(href="/i18n")
span.glyphicon-home.glyphicon
.navbar-header
span.navbar-brand #{model.get('name')}
ul.nav.navbar-nav.navbar-right
li
button.btn.btn-info.btn-sm.pull-right#patch-submit(disabled=model.hasLocalChanges() ? null : 'disabled', value=model.id, data-i18n="common.submit_changes") Submit Changes
li.dropdown
a(data-toggle='dropdown')
span.glyphicon-chevron-down.glyphicon
ul.dropdown-menu
li.dropdown-header(data-i18n="common.help") Help
li
a(href='https://github.com/codecombat/codecombat/wiki', data-i18n="editor.wiki", target="_blank") Wiki
li
a(href='https://coco-slack-invite.herokuapp.com/', data-i18n="editor.live_chat", target="_blank") Live Chat
li
a(href='http://discourse.codecombat.com/category/diplomat', data-i18n="nav.forum", target="_blank") Forum
li
a(data-toggle="coco-modal", data-target="core/ContactModal", data-i18n="nav.contact") Email
block outer_content
.outer-content.container-fluid
select.form-control#language-select
.row
.col-sm-6
for row in translationList
table.table.translation-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
else
input.input-sm.form-control.translation-input(data-index=row.index.toString(), value=row.toValue)
#patches-col.col-sm-6
if view.patches
.panel.panel-default
.panel-heading
h3.panel-title Patches Submitted
table.table
tr
th Description
th Submitted
th Status
for patch in view.patches.models
tr
td
a.open-patch-link(data-patch-id=patch.id)= patch.get('commitMessage')
td= moment(patch.created()).format('LLLL')
td(class=patch.get('status'))= patch.get('status')
.clearfix
block footer