OSDN Git Service

t#31537:fix flash
authoryasushiito <yas@pen-chan.jp>
Sun, 9 Jun 2013 02:00:33 +0000 (11:00 +0900)
committeryasushiito <yas@pen-chan.jp>
Sun, 9 Jun 2013 02:00:33 +0000 (11:00 +0900)
16 files changed:
app/controllers/artists_controller.rb
app/controllers/authors_controller.rb
app/controllers/comics_controller.rb
app/controllers/ground_colors_controller.rb
app/controllers/ground_pictures_controller.rb
app/controllers/original_pictures_controller.rb
app/controllers/panel_pictures_controller.rb
app/controllers/stories_controller.rb
app/views/authors/edit.html.erb
app/views/comics/edit.html.erb
app/views/ground_colors/edit.html.erb
app/views/ground_pictures/edit.html.erb
app/views/original_pictures/edit.html.erb
app/views/panel_pictures/edit.html.erb
app/views/panels/edit.html.erb
app/views/stories/edit.html.erb

index 28bd0c1..dbcfab5 100644 (file)
@@ -105,6 +105,7 @@ class ArtistsController < ApplicationController
         format.html { redirect_to root_path }
         format.json { render json: @ar.to_json(Artist.show_json_opt), status: :created, location: @artist }
       else
+        flash[:notice] = I18n.t('flash.notice.not_created', :model => Artist.model_name.human)
         format.html { render action: "new" }
         format.json { render json: @ar.errors, status: :unprocessable_entity }
       end
@@ -124,6 +125,7 @@ class ArtistsController < ApplicationController
         format.html { redirect_to '/home/configure' }
         format.json { head :ok }
       else
+        flash[:notice] = I18n.t('flash.notice.not_updated', :model => Artist.model_name.human)
         format.html { render action: "edit" }
         format.json { render json: @ar.errors, status: :unprocessable_entity }
       end
index 1350c4d..dbd4778 100644 (file)
@@ -171,6 +171,7 @@ class AuthorsController < ApplicationController
         format.html { redirect_to root_path }
         format.json { render json: @au.to_json(Author.show_json_opt), status: :created, location: @artist }
       else
+        flash[:notice] = I18n.t('flash.notice.not_created', :model => Author.model_name.human)
         format.html { render action: "new" }
         format.json { render json: @au.errors, status: :unprocessable_entity }
       end
@@ -188,6 +189,7 @@ class AuthorsController < ApplicationController
         format.html { redirect_to '/home/configure' }
         format.json { head :ok }
       else
+        flash[:notice] = I18n.t('flash.notice.not_updated', :model => Author.model_name.human)
         format.html { render action: "edit" }
         format.json { render json: @au.errors, status: :unprocessable_entity }
       end
index 848e4b2..c5f8546 100644 (file)
@@ -90,6 +90,7 @@ class ComicsController < ApplicationController
         format.html { redirect_to @comic }
         format.json { render json: @comic.to_json(Comic.show_json_opt), status: :created, location: @comic }
       else
+        flash[:notice] = I18n.t('flash.notice.not_created', :model => Comic.model_name.human)
         format.html { render action: "new" }
         format.json { render json: @comic.errors, status: :unprocessable_entity }
       end
@@ -106,6 +107,7 @@ class ComicsController < ApplicationController
         format.html { redirect_to @comic }
         format.json { head :ok }
       else
+        flash[:notice] = I18n.t('flash.notice.not_updated', :model => Comic.model_name.human)
         format.html { render action: "edit" }
         format.json { render json: @comic.errors, status: :unprocessable_entity }
       end
index 5b94a64..0652ea7 100644 (file)
@@ -65,10 +65,12 @@ class GroundColorsController < ApplicationController
           format.html { redirect_to @panel }
           format.json { render json: @panel.panel_elements_as_json, status: :created, location: @panel }
         else
+          flash[:notice] = I18n.t('flash.notice.not_created', :model => Panel.model_name.human)
           format.html { render action: "panels/new" }
           format.json { render json: @panel.errors, status: :unprocessable_entity }
         end
       else
+        flash[:notice] = I18n.t('flash.notice.not_created', :model => GroundColor.model_name.human)
         format.html { render action: "new" }
         format.json { render json: @ground_color.errors, status: :unprocessable_entity }
       end
@@ -87,6 +89,7 @@ class GroundColorsController < ApplicationController
         format.html { redirect_to @ground_color }
         format.json { head :ok }
       else
+        flash[:notice] = I18n.t('flash.notice.not_updated', :model => GroundColor.model_name.human)
         format.html { render action: "edit" }
         format.json { render json: @ground_color.errors, status: :unprocessable_entity }
       end
index be166c4..dd8ebb6 100644 (file)
@@ -63,10 +63,12 @@ class GroundPicturesController < ApplicationController
           format.html { redirect_to @panel }
           format.json { render json: @panel.panel_elements_as_json, status: :created, location: @panel }
         else
+          flash[:notice] = I18n.t('flash.notice.not_created', :model => Panel.model_name.human)
           format.html { render action: "panels/new" }
           format.json { render json: @panel.errors, status: :unprocessable_entity }
         end
       else
+        flash[:notice] = I18n.t('flash.notice.not_created', :model => GroundPicture.model_name.human)
         format.html { render action: "new" }
         format.json { render json: @ground_picture.errors, status: :unprocessable_entity }
       end
@@ -85,6 +87,7 @@ class GroundPicturesController < ApplicationController
         format.html { redirect_to @ground_picture }
         format.json { head :ok }
       else
+        flash[:notice] = I18n.t('flash.notice.not_updated', :model => GroundPicture.model_name.human)
         format.html { render action: "edit" }
         format.json { render json: @ground_picture.errors, status: :unprocessable_entity }
       end
index cfead9e..2d0b463 100644 (file)
@@ -99,6 +99,7 @@ class OriginalPicturesController < ApplicationController
         format.html { redirect_to @original_picture }
         format.json { render json: @original_picture.to_json(OriginalPicture.show_json_opt), status: :created, location: @original_picture }
       else
+        flash[:notice] = I18n.t('flash.notice.not_created', :model => OriginalPicture.model_name.human)
         format.html { render action: "new" }
         format.json { render json: @original_picture.errors, status: :unprocessable_entity }
       end
@@ -120,6 +121,7 @@ class OriginalPicturesController < ApplicationController
         format.html { redirect_to @original_picture }
         format.json { render json: @original_picture.to_json(OriginalPicture.show_json_opt), status: :created, location: @original_picture }
       else
+        flash[:notice] = I18n.t('flash.notice.not_updated', :model => OriginalPicture.model_name.human)
         format.html { render action: "edit" }
         format.json { render json: @original_picture.errors, status: :unprocessable_entity }
       end
index 91444ce..be237f5 100644 (file)
@@ -83,10 +83,12 @@ class PanelPicturesController < ApplicationController
           format.html { redirect_to @panel }
           format.json { render json: @panel.panel_elements_as_json, status: :created, location: @panel }
         else
+          flash[:notice] = I18n.t('flash.notice.not_created', :model => Panel.model_name.human)
           format.html { render action: "panels/new" }
           format.json { render json: @panel.errors, status: :unprocessable_entity }
         end
       else
+        flash[:notice] = I18n.t('flash.notice.not_created', :model => PanelPicture.model_name.human)
         format.html { render action: "new" }
         format.json { render json: @panel_picture.errors, status: :unprocessable_entity }
       end
@@ -105,6 +107,7 @@ class PanelPicturesController < ApplicationController
         format.html { redirect_to @panel_picture }
         format.json { head :ok }
       else
+        flash[:notice] = I18n.t('flash.notice.not_updated', :model => PanelPicture.model_name.human)
         format.html { render action: "edit" }
         format.json { render json: @panel_picture.errors, status: :unprocessable_entity }
       end
index 96a1fda..1baf428 100644 (file)
@@ -102,6 +102,7 @@ class StoriesController < ApplicationController
         format.html { redirect_to action: :comic, id: @story.comic_id }
         format.json { render json: @story.story_as_json(@author) }
       else
+        flash[:notice] = I18n.t('flash.notice.not_created', :model => Story.model_name.human)
         format.html { render action: "new" }
         format.json { render json: @story.errors, status: :unprocessable_entity }
       end
@@ -119,6 +120,7 @@ class StoriesController < ApplicationController
         format.html { redirect_to action: :comic, id: @story.comic_id }
         format.json { head :ok }
       else
+        flash[:notice] = I18n.t('flash.notice.not_updated', :model => Story.model_name.human)
         format.html { render action: "edit" }
         format.json { render json: @story.errors, status: :unprocessable_entity }
       end
index c6fbf29..ea18093 100644 (file)
@@ -1,4 +1,5 @@
 <h1><%= t '.title' -%></h1>
+<p id="notice"><%= notice %></p>
 
 <%= render 'form', :au => @au %>
 
index f33a2f8..1d67f75 100644 (file)
@@ -1,3 +1,4 @@
 <h1><%= t('.title') %></h1>
+<p id="notice"><%= notice %></p>
 
 <%= render 'form' %>
index 7fb5b02..e57ae15 100644 (file)
@@ -1,4 +1,5 @@
 <h1><%= t('.title') %></h1>
+<p id="notice"><%= notice %></p>
 
 <h2><%= t('home.index.catch') -%></h2>
 <%= render 'panels/standard', :panel => @panel, :author => @author %>
index 7fb5b02..e57ae15 100644 (file)
@@ -1,4 +1,5 @@
 <h1><%= t('.title') %></h1>
+<p id="notice"><%= notice %></p>
 
 <h2><%= t('home.index.catch') -%></h2>
 <%= render 'panels/standard', :panel => @panel, :author => @author %>
index 15957ef..a3fad92 100644 (file)
@@ -1,3 +1,4 @@
 <h1><%= t '.title' -%></h1>\r
+<p id="notice"><%= notice %></p>\r
 \r
 <%= render 'form' %>\r
index ec8963e..34469a8 100644 (file)
@@ -1,4 +1,5 @@
 <h1><%= t('.title') %></h1>
+<p id="notice"><%= notice %></p>
 
 <h2><%= t('home.index.catch') -%></h2>
 <%= render 'panels/standard', :panel => @panel, :author => @author %>
index dd4f037..bc01cd6 100644 (file)
@@ -1,4 +1,6 @@
 <h1><%= t '.title' -%></h1>
+<p id="notice"><%= notice %></p>
+
 <%= render 'standard', :panel => @panel, :author => @author %>
 <%= render 'form' %>
 <%= link_to t('link.destroy'), panel_path(@panel), :method => :delete %>
index 1390df9..cee9463 100644 (file)
@@ -1,4 +1,5 @@
 <h1><%= t('.title') %></h1>
+<p id="notice"><%= notice %></p>
 
 <%= render 'form' %>
 <%= button_to 'Destroy', @story.panel, confirm: 'Are you sure?', method: :delete %>