OSDN Git Service

fix filer
[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 => []
4     before_filter :authenticate_author, :only => []
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 => []
10     before_filter :authenticate_author, :only => []
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
31     @item = Speech.show(params[:id], @operators)
32     respond_to do |format|
33       format.html {
34         @speech = @item
35       }
36       format_prof format
37       format.json { render json: @item.to_json(Speech.show_json_opt) }
38     end
39   end
40   
41   def count
42     list_count
43   end
44   
45   def count_by_speech_balloon
46     list_count
47   end
48   
49   def count_by_writing_format
50     list_count
51   end
52   
53 end