OSDN Git Service

manifest view profiler
[pettanr/pettanr.git] / app / controllers / scrolls_controller.rb
index 87d91a4..581d8b3 100644 (file)
@@ -1,10 +1,9 @@
 class ScrollsController < ApplicationController
-  layout 'test' if MagicNumber['test_layout']
-  if MagicNumber['run_mode'] == 0
+  if Manifest.manifest.magic_numbers['run_mode'] == 0
     before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
     before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
   else
-    before_filter :authenticate_reader, :only => [:top, :index, :show, :play, :scroll_panels, :panels, :by_author, :by_panel]
+    before_filter :authenticate_reader, :only => [:top, :index, :show, :play, :by_author, :by_panel]
     before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
     before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
   end
@@ -14,39 +13,33 @@ class ScrollsController < ApplicationController
   end
   
   def index
-    public_list
-  end
-  
-  def scroll_panels
-    has_many_list
-  end
-  
-  def panels
-    has_many_list
+    filer_list
   end
   
   def by_author
-    filter_list
+    filer_list
   end
   
   def by_panel
-    filter_list
+    filer_list
+  end
+  
+  def show_html_format format
+    format.html {
+      @scroll = @item
+      if @operators.author
+        @new_panel_items = assist_items('panel', 'private_list')
+        #@new_panel_filer = assist_filer 'panel', @new_panel_items
+      end
+    }
   end
   
   def show
-    @item = Scroll.show(params[:id], @operators)
-
+    set_show
     respond_to do |format|
-      format.html {
-        if @operators.author
-          @new_panel_items = assist_items('panel', 'private_list')
-          @new_panel_filer = assist_filer 'panel', @new_panel_items
-        end
-      }
-      format.json { render json: @item.to_json(Scroll.show_json_opt) }
-      format_prof format
-      format.atom 
-      format.rss 
+      show_html_format format
+      show_prof_format format
+      show_json_format format
     end
   end
 
@@ -70,20 +63,19 @@ class ScrollsController < ApplicationController
   end
   
   def count
-    @scroll = {:count => Scroll.visible_count}
-    respond_to do |format|
-      format.json { render json: @scroll.to_json }
-    end
+    list_count
+  end
+  
+  def count_by_author
+    list_count
+  end
+  
+  def count_by_panel
+    list_count
   end
   
   def new
-    @scroll = Scroll.new
-    @scroll.supply_default
-    respond_to do |format|
-      format.html
-      format.js
-      format.json { render json: @scroll.to_json(Scroll.show_json_opt) }
-    end
+    form_new
   end
 
   def edit