OSDN Git Service

t#:
[pettanr/pettanr.git] / app / controllers / ground_pictures_controller.rb
index a4faa83..9a222d3 100644 (file)
@@ -29,10 +29,10 @@ class GroundPicturesController < ApplicationController
   end
   
   def new
-    raise Pettanr::NotWork unless @author.working_panel
-    @picture = Picture.show params[:picture_id], @author
+    raise Pettanr::NotWork unless @operators.author.working_panel
+    @picture = Picture.show params[:picture_id], @operators
     raise ActiveRecord::Forbidden unless @picture.enable?
-    @panel = Panel.edit(@author.working_panel, @author)
+    @panel = Panel.edit(@operators.author.working_panel, @operators)
     
     @ground_picture = GroundPicture.new :panel_id => @panel.id, :picture_id => @picture.id
     @ground_picture.supply_default
@@ -44,8 +44,8 @@ class GroundPicturesController < ApplicationController
   end
 
   def edit
-    @ground_picture = GroundPicture.show(params[:id], @author)
-    @panel = Panel.edit(@ground_picture.panel.id, @author)
+    @ground_picture = GroundPicture.show(params[:id], @operators)
+    @panel = Panel.edit(@ground_picture.panel.id, @operators)
     
     respond_to do |format|
       format.html
@@ -53,19 +53,19 @@ class GroundPicturesController < ApplicationController
   end
 
   def create
-    raise Pettanr::NotWork unless @author.working_panel
-    @panel = Panel.edit(@author.working_panel, @author)
+    raise Pettanr::NotWork unless @operators.author.working_panel
+    @panel = Panel.edit(@operators.author.working_panel, @operators)
     
     @ground_picture = GroundPicture.new
     @ground_picture.attributes = params[:ground_picture]
     @ground_picture.overwrite @panel.id
     
-    @picture = Picture.show @ground_picture.picture_id, @author
+    @picture = Picture.show @ground_picture.picture_id, @operators
     raise ActiveRecord::Forbidden unless @picture.enable?
     
     respond_to do |format|
       if @ground_picture.valid?
-        if @ground_picture.store @author
+        if @ground_picture.store @operators
           flash[:notice] = I18n.t('flash.notice.created', :model => Panel.model_name.human)
           format.html { redirect_to @panel }
           format.json { render json: @panel.panel_elements_as_json, status: :created, location: @panel }
@@ -83,16 +83,16 @@ class GroundPicturesController < ApplicationController
   end
 
   def update
-    @ground_picture = GroundPicture.show(params[:id], @author)
+    @ground_picture = GroundPicture.show(params[:id], @operators)
     @ground_picture.attributes = params[:ground_picture]
-    @panel = Panel.edit(@ground_picture.panel.id, @author)
+    @panel = Panel.edit(@ground_picture.panel.id, @operators)
     @ground_picture.overwrite @panel.id
     
-    @picture = Picture.show @ground_picture.picture_id, @author
+    @picture = Picture.show @ground_picture.picture_id, @operators
     raise ActiveRecord::Forbidden unless @picture.enable?
     
     respond_to do |format|
-      if @ground_picture.store @author
+      if @ground_picture.store @operators
         flash[:notice] = I18n.t('flash.notice.updated', :model => GroundPicture.model_name.human)
         format.html { redirect_to @ground_picture }
         format.json { head :ok }
@@ -105,11 +105,11 @@ class GroundPicturesController < ApplicationController
   end
 
   def destroy
-    @ground_picture = GroundPicture.show(params[:id], @author)
-    @panel = Panel.edit(@ground_picture.panel.id, @author)
+    @ground_picture = GroundPicture.show(params[:id], @operators)
+    @panel = Panel.edit(@ground_picture.panel.id, @operators)
     
     respond_to do |format|
-      if @ground_picture.remove @author
+      if @ground_picture.remove @operators
         flash[:notice] = I18n.t('flash.notice.destroyed', :model => GroundPicture.model_name.human)
         format.html { redirect_to @panel }
         format.json { head :ok }