class SpeechesController < ApplicationController
if Manifest.manifest.magic_numbers['run_mode'] == 0
- before_filter :authenticate_user, :only => []
- before_filter :authenticate_author, :only => []
+ before_filter :authenticate_user, :only => [:new, :edit, :create, :update, :destroy]
+ before_filter :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
+ :index, :show, :by_author, :count, :count_by_author
]
- before_filter :authenticate_user, :only => []
- before_filter :authenticate_author, :only => []
+ before_filter :authenticate_user, :only => [:new, :edit, :create, :update, :destroy]
+ before_filter :authenticate_author, :only => [:new, :edit, :create, :update, :destroy]
end
before_filter :authenticate_admin!, :only => []
filer_list
end
- def by_speech_balloon
+ def by_author
filer_list
end
- def by_writing_format
- filer_list
+ 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
list_count
end
- def count_by_speech_balloon
+ def count_by_author
list_count
end
- def count_by_writing_format
- list_count
+ def new
+ form_new
+ end
+
+ def edit
+ form_edit
end
end