before_filter :authenticate_admin!, :only => [:list, :browse]
def show
- @picture = Picture.show(params[:id], [@user, @admin, @demand_user])
+ @item = Picture.show(params[:id], @operators)
respond_to do |format|
- opt = {:type => @picture.mime_type, :disposition=>"inline"}
- format.png { send_data(@picture.restore(params[:subdir]), opt ) }
- format.gif { send_data(@picture.restore(params[:subdir]), opt ) }
- format.jpeg { send_data(@picture.restore(params[:subdir]), opt ) }
- format.html
- format.prof { render :template => 'top/prof', :layout => true }
- format.json { render :json => @picture.to_json}
+ 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}
end
end