OSDN Git Service

fix:err dialog
[pettanr/pettanr.git] / app / assets / javascripts / editor / error / dialog.js.coffee
index eec2cf7..49ea6d7 100644 (file)
@@ -7,14 +7,16 @@ class Editor.Error.Dialog extends Editor.Dialog
   start: (response, options) ->\r
     switch response.status\r
       when 403\r
-        @for_ajax()\r
+        @forbidden()\r
+      when 404\r
+        @not_found()\r
     this.$el.dialog('open')\r
   \r
   render: () ->\r
     this.$el.html('')\r
     this\r
   \r
-  for_ajax: () ->\r
+  forbidden: () ->\r
     this.$el.html('')\r
     this.$el.dialog({title: I18n.t('yasapp.error.caption.ajax')})\r
     h = new Tag.H3({\r
@@ -24,3 +26,13 @@ class Editor.Error.Dialog extends Editor.Dialog
     this.$el.append(@div(I18n.t('yasapp.error.detail.base')).render().el)\r
     this.$el.append(@div(I18n.t('yasapp.error.detail.forbidden')).render().el)\r
   \r
+  not_found: () ->\r
+    this.$el.html('')\r
+    this.$el.dialog({title: I18n.t('yasapp.error.caption.ajax')})\r
+    h = new Tag.H3({\r
+      content: I18n.t('yasapp.error.subject.not_found')\r
+    })\r
+    this.$el.append(h.render().el)\r
+    this.$el.append(@div(I18n.t('yasapp.error.detail.base')).render().el)\r
+    this.$el.append(@div(I18n.t('yasapp.error.detail.not_found')).render().el)\r
+  \r