OSDN Git Service

temp
[pettanr/pettanr.git] / app / controllers / resource_pictures_controller.rb
index 1148e8d..3ba8579 100644 (file)
@@ -10,25 +10,18 @@ class ResourcePicturesController < ApplicationController
   end
   before_filter :authenticate_admin!, :only => [:list, :browse]
 
+  @@model = ResourcePicture
   def index
-    @page = ResourcePicture.page params[:page]
-    @page_size = ResourcePicture.page_size params[:page_size]
-    @resource_pictures = ResourcePicture.list(@page, @page_size)
+    set_filer
 
     respond_to do |format|
-      format.html {
-        @paginate = ResourcePicture.list_paginate(@page, @page_size)
-        render :template => 'system/filer', :locals => {
-          :items => @resource_pictures, :model => ResourcePicture, 
-          :roles => [@user, @admin], :pager => @paginate
-        }
-      }
-      format.json { render :json => @resource_pictures.to_json(ResourcePicture.list_json_opt) }
+      format_filer format
+      format.json { render :json => @items.to_json(@@model.list_json_opt) }
     end
   end
 
   def show
-    @item = ResourcePicture.show(params[:id], [@user, @admin, @demand_user])
+    @item = ResourcePicture.show(params[:id], @operators)
 
     respond_to do |format|
       opt = {:type => @item.mime_type, :disposition=>"inline"}