mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-12-23 22:12:32 -05:00
7bab895dee
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
23 lines
811 B
CoffeeScript
23 lines
811 B
CoffeeScript
I18NEditModelView = require './I18NEditModelView'
|
|
Course = require 'models/Course'
|
|
deltasLib = require 'core/deltas'
|
|
Patch = require 'models/Patch'
|
|
Patches = require 'collections/Patches'
|
|
PatchModal = require 'views/editor/PatchModal'
|
|
|
|
# TODO: Apply these changes to all i18n views if it proves to be more reliable
|
|
|
|
module.exports = class I18NEditCourseView extends I18NEditModelView
|
|
id: "i18n-edit-course-view"
|
|
modelClass: Course
|
|
|
|
buildTranslationList: ->
|
|
lang = @selectedLanguage
|
|
|
|
# name, description
|
|
if i18n = @model.get('i18n')
|
|
if name = @model.get('name')
|
|
@wrapRow 'Course short name', ['name'], name, i18n[lang]?.name, []
|
|
if description = @model.get('description')
|
|
@wrapRow 'Course description', ['description'], description, i18n[lang]?.description, []
|
|
|