before_filter :authenticate_author, :only => []
else
before_filter :authenticate_user, :only => []
- before_filter :authenticate_resource_reader, :only => [:show, :credit, :search]
+ before_filter :authenticate_resource_reader, :only => [
+ :show, :credit, :search
+ ]
before_filter :authenticate_author, :only => []
end
+ before_filter :authenticate_admin, :only => [:index, :by_artist ]
+
+ def index
+ filer_list
+ end
+
+ def by_artist
+ filer_list
+ end
+
+ def show_html_format format
+ format.html {
+ @item.boosts 'post'
+ @picture = @item
+ }
+ end
def show
- @item = Picture.show(params[:id], @operators)
-
+ set_show
respond_to do |format|
opt = {:type => @item.mime_type, :disposition=>"inline"}
format.png { send_data(@item.restore(params[:subdir]), opt ) }
format.gif { send_data(@item.restore(params[:subdir]), opt ) }
format.jpeg { send_data(@item.restore(params[:subdir]), opt ) }
- format.html {
- @picture = @item
- }
- format_prof format
- format.json { render :json => @item.to_json}
+ show_html_format format
+ show_json_format format
+ show_prof_format format
end
end