OSDN Git Service

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