OSDN Git Service

Merge branch 'v06' of git.sourceforge.jp:/gitroot/pettanr/pettanr into v06
[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_system_picture, :count, :count_by_system_picture
7     ]
8     before_filter :authenticate_user, :only => []
9   end
10   before_filter :authenticate_admin!, :only => [:destroy]
11
12   def self.model
13     SpeechBalloonTemplate
14   end
15   
16   def index
17     filer_list
18   end
19   
20   def by_system_picture
21     filer_list
22   end
23   
24   def show
25     @item = SpeechBalloonTemplate.show(params[:id], @operators)
26
27     respond_to do |format|
28       format.html {
29         @speech_balloon_template = @item
30       }
31       format_prof format
32       format.json {
33         render :json => @item.to_json(SpeechBalloonTemplate.show_json_opt)
34       }
35     end
36   end
37   
38   def count
39     list_count
40   end
41   
42   def count_by_system_picture
43     list_count
44   end
45   
46   def destroy
47     @speech_balloon_template = SpeechBalloonTemplate.find(params[:id])
48     @speech_balloon_template.destroy
49
50     respond_to do |format|
51       format.html { redirect_to :action => :list }
52       format.json { head :ok }
53     end
54   end
55 end