OSDN Git Service

rename model name
[pettanr/pettanr.git] / app / controllers / system_pictures_controller.rb
1 class SystemPicturesController < 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_resource_reader, :only => [:index, :show, :count]
7     before_filter :authenticate_user, :only => []
8     before_filter :authenticate_author, :only => []
9   end
10   before_filter :authenticate_admin!, :only => []
11   
12   def index
13     filer_list
14   end
15   
16   def show_html_format format
17     format.html {
18     }
19   end
20   
21   def show
22     set_show
23     respond_to do |format|
24       opt = {:type => @item.mime_type, :disposition=>"inline"}
25       format.png { send_data(@item.restore, opt ) }
26       format.gif { send_data(@item.restore, opt ) }
27       format.jpeg { send_data(@item.restore, opt ) }
28       show_html_format format
29       show_prof_format format
30       show_json_format format
31     end
32   end
33   
34   def count
35     list_count
36   end
37   
38 end