OSDN Git Service

fix: new elm
[pettanr/pettanr.git] / app / controllers / panel_pictures_controller.rb
index 94d3218..3ae4dac 100644 (file)
@@ -1,15 +1,40 @@
 class PanelPicturesController < ApplicationController
-  before_filter :authenticate_author!, :except => [:index]
-
-  # GET /panel_pictures
-  # GET /panel_pictures.json
+  if Manifest.manifest.magic_numbers['run_mode'] == 0
+    before_filter :authenticate_user, :only => []
+    before_filter :authenticate_author, :only => []
+  else
+    before_filter :authenticate_reader, :only => [
+      :index, :show, :by_panel, :by_author
+    ]
+    before_filter :authenticate_user, :only => []
+    before_filter :authenticate_author, :only => []
+  end
+  
   def index
-    @panel_pictures = PanelPicture.all
-
+    filer_list
+  end
+  
+  def by_panel
+    filer_list
+  end
+  
+  def by_author
+    filer_list
+  end
+  
+  def show_html_format format
+    format.html {
+      @panel_picture = @item
+    }
+  end
+  
+  def show
+    set_show
     respond_to do |format|
-      format.html # index.html.erb
-      format.json { render json: @panel_pictures }
+      show_html_format format
+      show_prof_format format
+      show_json_format format
     end
   end
-
+  
 end