layout 'test' if MagicNumber['test_layout']
before_filter :authenticate_reader, :only => [:show, :history]
before_filter :authenticate_user, :only => [:index, :new, :edit, :create, :update, :destroy]
+ before_filter :authenticate_artist, :only => [:index, :new, :edit, :create, :update, :destroy]
before_filter :authenticate_admin!, :only => [:list, :browse]
- before_filter :authenticate_artist, :only => [:index, :show, :history, :new, :edit, :create, :update, :destroy]
- # GET /original_pictures
- # GET /original_pictures.json
def index
@page = OriginalPicture.page params[:page]
@page_size = OriginalPicture.page_size params[:page_size]
- @original_pictures = OriginalPicture.mylist(@artist.id, @page, @page_size)
+ @original_pictures = OriginalPicture.mylist(@artist, @page, @page_size)
respond_to do |format|
- format.html # index.html.erb
+ format.html {
+ @paginate = OriginalPicture.mylist_paginate(@artist, @page, @page_size)
+ }
format.json { render json: @original_pictures.to_json(OriginalPicture.list_json_opt) }
end
end
- # GET /original_pictures/1
- # GET /original_pictures/1.json
def show
@original_picture = OriginalPicture.show(params[:id], [@artist, @admin])
@original_picture_license_group = OriginalPictureLicenseGroup.new :original_picture_id => @original_picture.id
render
}
+ format.prof { render :template => 'top/prof', :layout => true }
format.json { render json: @original_picture.to_json(OriginalPicture.show_json_opt)}
end
end
format.html { redirect_to @original_picture }
format.json { render json: @original_picture.to_json(OriginalPicture.show_json_opt), status: :created, location: @original_picture }
else
+ flash[:notice] = I18n.t('flash.notice.not_created', :model => OriginalPicture.model_name.human)
format.html { render action: "new" }
format.json { render json: @original_picture.errors, status: :unprocessable_entity }
end
format.html { redirect_to @original_picture }
format.json { render json: @original_picture.to_json(OriginalPicture.show_json_opt), status: :created, location: @original_picture }
else
+ flash[:notice] = I18n.t('flash.notice.not_updated', :model => OriginalPicture.model_name.human)
format.html { render action: "edit" }
format.json { render json: @original_picture.errors, status: :unprocessable_entity }
end