OSDN Git Service

fix
[pettanr/pettanr.git] / app / controllers / home_controller.rb
1 class HomeController < ApplicationController
2   layout 'test' if MagicNumber['test_layout']
3   before_filter :authenticate_user, :only => [
4     :index, :show, :profile, :configure, :create_token, :delete_token, 
5     :scrolls, :scroll_panels, :comics, :stories, :story_sheets, :sheets, :sheet_panels, :panels, :resource_pictures, :panel_pictures, :speech_balloons, :ground_pictures, :ground_colors
6   ]
7   before_filter :authenticate_author, :only => [:scrolls, :scroll_panels, :comics, :stories, :story_sheets, :sheets, :sheet_panels, :panels, :panel_pictures, :speech_balloons, :ground_pictures, :ground_colors]
8   before_filter :authenticate_artist, :only => [:resource_pictures]
9   
10   def index
11   end
12   
13   def profile
14   end
15   
16   def configure
17   end
18   
19   def create_token
20     if @operators.user.create_token
21       respond_to do |format|
22         flash[:notice] = I18n.t('flash.notice.created', :model => User.human_attribute_name(:authentication_token))
23         format.html { redirect_to({:action => :configure}) }
24       end
25     else
26       flash[:notice] = I18n.t('flash.notice.not_created', :model => User.human_attribute_name(:authentication_token))
27       format.html { render action: "configure" }
28     end
29   end
30   
31   def delete_token
32     if @operators.user.delete_token
33       respond_to do |format|
34         flash[:notice] = I18n.t('flash.notice.destroyed', :model => User.human_attribute_name(:authentication_token))
35         format.html { redirect_to :action => :configure}
36       end
37     else
38       flash[:notice] = I18n.t('flash.notice.not_destroyed', :model => User.human_attribute_name(:authentication_token))
39       format.html { render action: "configure" }
40     end
41   end
42   
43   def scrolls
44     my_list params
45   end
46   
47   def scroll_panels
48     my_list params
49   end
50   
51   def comics
52     my_list params
53   end
54   
55   def stories
56     my_list params
57   end
58   
59   def story_sheets
60     my_list params
61   end
62   
63   def sheets
64     my_list params
65   end
66   
67   def sheet_panels
68     my_list params
69   end
70   
71   def panels
72     my_list params
73   end
74   
75   def panel_pictures
76     my_list params
77   end
78   
79   def speech_balloons
80     my_list params
81   end
82   
83   def ground_pictures
84     my_list params
85   end
86   
87   def ground_colors
88     my_list params
89   end
90   
91   def resource_pictures
92     my_list params
93   end
94   
95 end