X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=app%2Fcontrollers%2Fspeech_balloons_controller.rb;h=191172ff6517d9ba27e995015a58757a4a7a4176;hb=0bdfae60dc58932c99849c31d36ee5d7715db782;hp=c34dd277d88252f5e40f4bc4e8ba788c80b6d146;hpb=135599effaad9a0b15ad52e46355e885ec0ddc94;p=pettanr%2Fpettanr.git diff --git a/app/controllers/speech_balloons_controller.rb b/app/controllers/speech_balloons_controller.rb index c34dd277..191172ff 100644 --- a/app/controllers/speech_balloons_controller.rb +++ b/app/controllers/speech_balloons_controller.rb @@ -1,50 +1,45 @@ class SpeechBalloonsController < ApplicationController - layout 'test' if MagicNumber['test_layout'] - if MagicNumber['run_mode'] == 0 - before_filter :authenticate_user, :only => [] - before_filter :authenticate_author, :only => [] + if Manifest.manifest.magic_numbers['run_mode'] == 0 + before_action :authenticate_user, :only => [] + before_action :authenticate_author, :only => [] else - before_filter :authenticate_reader, :only => [:index, :show] - before_filter :authenticate_user, :only => [] - before_filter :authenticate_author, :only => [] + before_action :authenticate_reader, :only => [ + :index, :show, :by_panel, :by_author, :by_speech_balloon_template + ] + before_action :authenticate_user, :only => [] + before_action :authenticate_author, :only => [] end - before_filter :authenticate_admin!, :only => [:list, :browse] - + def index - @page = SpeechBalloon.page params[:page] - @page_size = SpeechBalloon.page_size params[:page_size] - @speech_balloons = SpeechBalloon.list(@page, @page_size) - - respond_to do |format| - format.html # index.html.erb - format.json { render json: @speech_balloons.to_json(SpeechBalloon.list_json_opt) } - end + filer_list end - def show - @speech_balloon = SpeechBalloon.show(params[:id], [@user, @admin]) - respond_to do |format| - format.html # show.html.erb - format.json { render json: @speech_balloon.to_json(SpeechBalloon.show_json_opt) } - end + def by_panel + filer_list param: params[:id] end - def list - @speech_balloons = SpeechBalloon.all - - respond_to do |format| - format.html { render layout: 'system' } - format.json { render json: @speech_balloons } - end + def by_author + filer_list param: params[:id] end - - def browse - @speech_balloon = SpeechBalloon.find(params[:id]) - + + def by_speech_balloon_template + filer_list param: params[:id] + end + + def show_html_format format + format.html { + @item.boosts 'post' + @speech_balloon = @item + } + end + + def show + set_show respond_to do |format| - format.html { render layout: 'system' } - format.json { render json: @speech_balloon } + show_html_format format + show_prof_format format + show_json_format format end end - + end