OSDN Git Service

mrg
[pettanr/pettanr.git] / app / controllers / speech_balloon_templates_controller.rb
1 class SpeechBalloonTemplatesController < ApplicationController
2   if Manifest.manifest.magic_numbers['run_mode'] == 0
3     before_filter :authenticate_user, :only => []
4   else
5     before_filter :authenticate_reader, :only => [
6       :index, :show, :by_panel, :by_system_picture, :count, :count_by_panel, :count_by_system_picture
7     ]
8     before_filter :authenticate_user, :only => []
9   end
10   before_filter :authenticate_admin, :only => [:new, :create, :edit, :update, :destroy]
11
12   def self.model
13     SpeechBalloonTemplate
14   end
15   
16   def index
17     filer_list
18   end
19   
20   def by_panel
21     filer_list
22   end
23   
24   def by_system_picture
25     filer_list
26   end
27   
28   def show_html_format format
29     format.html {
30     }
31   end
32   
33   def show
34     set_show
35     respond_to do |format|
36       show_html_format format
37       show_prof_format format
38       show_json_format format
39     end
40   end
41   
42   def count
43     list_count
44   end
45   
46   def count_by_panel
47     list_count
48   end
49   
50   def count_by_system_picture
51     list_count
52   end
53   
54   def new
55     form_new
56   end
57   
58   def edit
59     form_edit
60   end
61   
62   def destroy
63     @item = SpeechBalloonTemplate.find(params[:id])
64     @item.destroy
65
66     respond_to do |format|
67       format.html { redirect_to :action => :list }
68       format.json { head :ok }
69     end
70   end
71 end