OSDN Git Service

t#31566:add mylist sb
[pettanr/pettanr.git] / app / controllers / authors_controller.rb
index dbd4778..4773984 100644 (file)
@@ -4,7 +4,7 @@ class AuthorsController < ApplicationController
     before_filter :authenticate_user, :only => [:new, :create, :edit, :update]
     before_filter :authenticate_author, :only => [:edit, :update]
   else
-    before_filter :authenticate_reader, :only => [:index, :show, :comics, :stories, :panels, :panel_pictures, :ground_pictures, :ground_colors, :panel_colors]
+    before_filter :authenticate_reader, :only => [:index, :show, :comics, :stories, :panels, :panel_pictures, :speech_balloons, :ground_pictures, :ground_colors]
     before_filter :authenticate_user, :only => [:new, :create, :edit, :update]
     before_filter :authenticate_author, :only => [:edit, :update]
   end
@@ -92,6 +92,21 @@ class AuthorsController < ApplicationController
     end
   end
   
+  def speech_balloons
+    @au = Author.show(params[:id], [@user, @admin])
+
+    @page = Author.page params[:page]
+    @page_size = Author.panel_picture_page_size params[:page_size]
+    @speech_balloons = SpeechBalloon.himlist(@au, @page, @page_size)
+
+    respond_to do |format|
+      format.html {
+        @paginate = SpeechBalloon.himlist_paginate(@au, @page, @page_size)
+      }
+      format.json { render json: @speech_balloons.to_json(SpeechBalloon.list_json_opt) }
+    end
+  end
+  
   def ground_pictures
     @au = Author.show(params[:id], [@user, @admin])