OSDN Git Service

t#31566:add mylist sb
[pettanr/pettanr.git] / app / controllers / home_controller.rb
index 1458a2c..8cdaa99 100644 (file)
@@ -2,9 +2,9 @@ class HomeController < ApplicationController
   layout 'test' if MagicNumber['test_layout']
   before_filter :authenticate_user, :only => [
     :index, :show, :profile, :configure, :create_token, :delete_token, 
-    :comics, :stories, :panels, :resource_pictures, :panel_pictures, :panel_colors, :ground_pictures, :ground_colors
+    :comics, :stories, :panels, :resource_pictures, :panel_pictures, :speech_balloons, :ground_pictures, :ground_colors
   ]
-  before_filter :authenticate_author, :only => [:comics, :stories, :panels, :panel_pictures, :panel_colors, :ground_pictures, :ground_colors]
+  before_filter :authenticate_author, :only => [:comics, :stories, :panels, :panel_pictures, :speech_balloons, :ground_pictures, :ground_colors]
   before_filter :authenticate_artist, :only => [:resource_pictures]
   
   def index
@@ -92,6 +92,19 @@ class HomeController < ApplicationController
     end
   end
   
+  def speech_balloons
+    @page = Author.page params[:page]
+    @page_size = Author.speech_balloon_page_size params[:page_size]
+    @speech_balloons = SpeechBalloon.mylist(@author, @page, @page_size)
+
+    respond_to do |format|
+      format.html {
+        @paginate = SpeechBalloon.mylist_paginate(@author, @page, @page_size)
+      }
+      format.json { render json: @speech_balloons.to_json(SpeechBalloon.list_json_opt) }
+    end
+  end
+  
   def ground_pictures
     @page = Author.page params[:page]
     @page_size = Author.ground_picture_page_size params[:page_size]