OSDN Git Service

add comic story
[pettanr/pettanr.git] / app / controllers / comics_controller.rb
index 5a5312b..587cc10 100644 (file)
@@ -3,7 +3,7 @@ class ComicsController < ApplicationController
     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 => [:index, :show, :by_author, :count, :count_by_author]
+    before_filter :authenticate_reader, :only => [:index, :show, :by_story, :by_author, :count, :count_by_story, :count_by_author]
     before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
     before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
   end
@@ -15,13 +15,28 @@ class ComicsController < ApplicationController
   def index
     filer_list
   end
-
+  
+  def by_story
+    filer_list
+  end
+  
   def by_author
     filer_list
   end
-
+  
   def show_html_format format
     format.html {
+      @comic = @item
+      action = Manifest.manifest.controllers['comics'].actions['play']
+      list = Locmare::ListGroup.list action.item_name, action.list_name
+      list_result = list.open(@operators, 
+        {:id => params[:id], :page => params[:page], :page_size => params[:page_size]}
+      )
+      @comic_stories = list_result.items 
+      if @operators.author
+        @new_story_items = assist_items('story', 'private')
+        #@new_story_filer = assist_filer 'story', @new_story_items
+      end
     }
   end
   
@@ -35,11 +50,15 @@ class ComicsController < ApplicationController
       format.rss 
     end
   end
-
+  
   def count
     list_count
   end
   
+  def count_by_story
+    list_count
+  end
+  
   def count_by_author
     list_count
   end