OSDN Git Service

rails upgrade to 4 for js
[pettanr/pettanr.git] / app / controllers / pictures_controller.rb
index 9e1bae8..bf72c91 100644 (file)
@@ -1,15 +1,27 @@
 class PicturesController < ApplicationController
   if Manifest.manifest.magic_numbers['run_mode'] == 0
-    before_filter :authenticate_user, :only => []
-    before_filter :authenticate_author, :only => []
+    before_action :authenticate_user, :only => []
+    before_action :authenticate_author, :only => []
   else
-    before_filter :authenticate_user, :only => []
-    before_filter :authenticate_resource_reader, :only => [:show, :credit, :search]
-    before_filter :authenticate_author, :only => []
+    before_action :authenticate_user, :only => []
+    before_action :authenticate_resource_reader, :only => [
+      :show, :credit, :search
+    ]
+    before_action :authenticate_author, :only => []
+  end
+  before_action :authenticate_admin, :only => [:index, :by_artist ]
+  
+  def index
+    filer_list
+  end
+  
+  def by_artist
+    filer_list
   end
   
   def show_html_format format
     format.html {
+      @item.boosts 'post'
       @picture = @item
     }
   end
@@ -22,8 +34,8 @@ class PicturesController < ApplicationController
       format.gif { send_data(@item.restore(params[:subdir]), opt ) }
       format.jpeg { send_data(@item.restore(params[:subdir]), opt ) }
       show_html_format format
-      show_prof_format format
       show_json_format format
+      show_prof_format format
     end
   end