This commit is contained in:
Scott Erickson 2016-07-07 16:34:15 -07:00
parent c0f163938e
commit 1da82fa851
2 changed files with 7 additions and 1 deletions
app
templates/editor/modal
views/editor/modal

View file

@ -36,6 +36,9 @@ block modal-footer-content
button.btn.btn-sm#agreement-button(data-i18n="versions.cla_agree") I AGREE
if view.isPatch
.alert.alert-info(data-i18n="versions.owner_approve") An owner will need to approve it before your changes will become visible.
.save-error-area
if view.savingPatchError
.alert.alert-danger Unable to save patch: #{view.savingPatchError}
.buttons
button.btn(data-dismiss="modal", data-i18n="common.cancel") Cancel

View file

@ -46,6 +46,7 @@ module.exports = class SaveVersionModal extends ModalView
}
submitPatch: ->
@savingPatchError = false
forms.clearFormAlerts @$el
patch = new Patch()
patch.set 'delta', @model.getDelta()
@ -60,8 +61,10 @@ module.exports = class SaveVersionModal extends ModalView
return unless res
@enableModalInProgress(@$el)
res.error =>
res.error (jqxhr) =>
@disableModalInProgress(@$el)
@savingPatchError = jqxhr.responseJSON?.message or 'Unknown error.'
@renderSelectors '.save-error-area'
res.success =>
@hide()