OSDN Git Service

db947ad16a479644e7302e983c50b659db54db55
[pettanr/pettanr.git] / app / controllers / speeches_controller.rb
1 class SpeechesController < ApplicationController
2   if Manifest.manifest.magic_numbers['run_mode'] == 0
3     before_filter :authenticate_user, :only => [:new, :edit, :create, :update, :destroy]
4     before_filter :authenticate_author, :only => [:new, :edit, :create, :update, :destroy]
5   else
6     before_filter :authenticate_reader, :only => [
7       :index, :show, :by_speech_balloon, :by_writing_format, :count, :count_by_speech_balloon, :count_by_writing_format
8     ]
9     before_filter :authenticate_user, :only => [:new, :edit, :create, :update, :destroy]
10     before_filter :authenticate_author, :only => [:new, :edit, :create, :update, :destroy]
11   end
12   before_filter :authenticate_admin!, :only => []
13
14   def self.model
15     Speech
16   end
17   
18   def index
19     filer_list
20   end
21   
22   def by_speech_balloon
23     filer_list
24   end
25   
26   def by_writing_format
27     filer_list
28   end
29   
30   def show_html_format format
31     format.html {
32       @speech = @item
33     }
34   end
35   
36   def show
37     set_show
38     respond_to do |format|
39       show_html_format format
40       show_prof_format format
41       show_json_format format
42     end
43   end
44   
45   def count
46     list_count
47   end
48   
49   def count_by_speech_balloon
50     list_count
51   end
52   
53   def count_by_writing_format
54     list_count
55   end
56   
57   def new
58     form_new
59   end
60   
61   def edit
62     form_edit
63   end
64   
65 end