OSDN Git Service

change editor
[pettanr/pettanr.git] / app / controllers / sheets_controller.rb
index 8564d06..5a05a8f 100644 (file)
@@ -4,7 +4,7 @@ class SheetsController < ApplicationController
     before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
   else
     before_filter :authenticate_reader, :only => [
-      :index, :show, :play, :by_story, :by_panel, :by_author, :count, :count_by_story, :count_by_panel, :count_by_author
+      :index, :show, :play, :by_story, :by_panel, :by_author
     ]
     before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
     before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
@@ -47,36 +47,20 @@ class SheetsController < ApplicationController
   end
   
   def play
-    @item = self.class.model.show(params[:id], @operators)
     set_play
-    list_result = @list.open(@operators, params[:id])
-    @items = list_result.items 
+    @list.options.merge!({'page_size' => -1})    # no limit no pager
+    @list.reset
+    play_list
     respond_to do |format|
       format.html {
         if @operators.author
           @new_panel_items = assist_items('panel', 'private')
         end
       }
-      format.json { render json: @items.to_json(self.class.model.list_json_opt) }
+      list_json_format @list, format
     end
   end
   
-  def count
-    list_count
-  end
-  
-  def count_by_story
-    list_count
-  end
-  
-  def count_by_panel
-    list_count
-  end
-  
-  def count_by_author
-    list_count
-  end
-  
   def new
     set_new
     respond_to do |format|