class Editor.Error.Dialog extends Editor.Dialog className: 'error-dialog' initialize: (options) -> super(options) start: (response, options) -> switch response.status when 403 @forbidden() when 404 @not_found() else @error() this.$el.dialog('open') render: () -> this.$el.html('') this forbidden: () -> this.$el.html('') this.$el.dialog({title: I18n.t('yasapp.error.caption.ajax')}) h = new Tag.H3({ content: I18n.t('yasapp.error.subject.forbidden') }) this.$el.append(h.render().el) this.$el.append(@div(I18n.t('yasapp.error.detail.base')).render().el) this.$el.append(@div(I18n.t('yasapp.error.detail.forbidden')).render().el) not_found: () -> this.$el.html('') this.$el.dialog({title: I18n.t('yasapp.error.caption.ajax')}) h = new Tag.H3({ content: I18n.t('yasapp.error.subject.not_found') }) this.$el.append(h.render().el) this.$el.append(@div(I18n.t('yasapp.error.detail.base')).render().el) this.$el.append(@div(I18n.t('yasapp.error.detail.not_found')).render().el) error: () -> this.$el.html('') this.$el.dialog({title: I18n.t('yasapp.error.caption.ajax')}) h = new Tag.H3({ content: I18n.t('yasapp.error.subject.error') }) this.$el.append(h.render().el) this.$el.append(@div(I18n.t('yasapp.error.detail.base')).render().el) this.$el.append(@div(I18n.t('yasapp.error.detail.error')).render().el)