X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=app%2Fcontrollers%2Fspeeches_controller.rb;h=6248d6c7d9bd95c33224cbc0c0f77670042d8039;hb=HEAD;hp=19e3fc05842826faa588eaa6df35efb9299b901b;hpb=faeb976db446399392c21deafadb2d6d856c896f;p=pettanr%2Fpettanr.git diff --git a/app/controllers/speeches_controller.rb b/app/controllers/speeches_controller.rb index 19e3fc05..6248d6c7 100644 --- a/app/controllers/speeches_controller.rb +++ b/app/controllers/speeches_controller.rb @@ -1,53 +1,59 @@ class SpeechesController < ApplicationController if Manifest.manifest.magic_numbers['run_mode'] == 0 - before_filter :authenticate_user, :only => [] - before_filter :authenticate_author, :only => [] + before_action :authenticate_user, :only => [:new, :edit, :create, :update, :destroy] + before_action :authenticate_author, :only => [:new, :edit, :create, :update, :destroy] else - before_filter :authenticate_reader, :only => [ - :index, :show, :by_speech_balloon, :by_writing_format, :count, :count_by_speech_balloon, :count_by_writing_format + before_action :authenticate_reader, :only => [ + :index, :show, + :by_author, :by_speech_balloon, :by_speech_balloon_template, :by_writing_format ] - before_filter :authenticate_user, :only => [] - before_filter :authenticate_author, :only => [] - end - before_filter :authenticate_admin!, :only => [] - - def self.model - Speech + before_action :authenticate_user, :only => [:new, :edit, :create, :update, :destroy] + before_action :authenticate_author, :only => [:new, :edit, :create, :update, :destroy] end + before_action :authenticate_admin!, :only => [] def index filer_list end + def by_author + filer_list param: params[:id] + end + def by_speech_balloon - filer_list + filer_list param: params[:id] + end + + def by_speech_balloon_template + filer_list param: params[:id] end def by_writing_format - filer_list + filer_list param: params[:id] + end + + def show_html_format format + format.html { + @item.boosts 'post' + @speech = @item + } end def show - @item = Speech.show(params[:id], @operators) + set_show respond_to do |format| - format.html { - @speech = @item - } - format_prof format - format.json { render json: @item.to_json(Speech.show_json_opt) } + show_html_format format + show_prof_format format + show_json_format format end end - def count - list_count - end - - def count_by_speech_balloon - list_count + def new + form_new end - def count_by_writing_format - list_count + def edit + form_edit end end