X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=app%2Fcontrollers%2Fground_pictures_controller.rb;h=7d5fb1c9f55aa1fbd095fdfd6df0f71a4ddc522a;hb=69b61b39006c1951fc8c08746e884e63e50233b3;hp=aa23e7f09289d9d73cc04379909c806c035d0916;hpb=9f6a95c6c89ca7d7671fa019f122e31215aa1bcd;p=pettanr%2Fpettanr.git diff --git a/app/controllers/ground_pictures_controller.rb b/app/controllers/ground_pictures_controller.rb index aa23e7f0..7d5fb1c9 100644 --- a/app/controllers/ground_pictures_controller.rb +++ b/app/controllers/ground_pictures_controller.rb @@ -1,18 +1,56 @@ class GroundPicturesController < ApplicationController - layout 'test' if Pettanr::TestLayout - before_filter :authenticate_user!, :only => [:index] - - # GET /ground_pictures - # GET /ground_pictures.json + if Manifest.manifest.magic_numbers['run_mode'] == 0 + before_filter :authenticate_user, :only => [] + before_filter :authenticate_author, :only => [] + else + before_filter :authenticate_reader, :only => [ + :index, :show, :by_panel, :by_author, :count, :count_by_panel, :count_by_author + ] + before_filter :authenticate_user, :only => [] + before_filter :authenticate_author, :only => [] + end + + def self.model + GroundPicture + end + def index - @page = GroundPicture.page params[:page] - @page_size = GroundPicture.page_size params[:page_size] - @ground_pictures = GroundPicture.list(@page, @page_size) - + filer_list + end + + def by_panel + filer_list + end + + def by_author + filer_list + end + + def show_html_format format + format.html { + @ground_picture = @item + } + end + + def show + set_show respond_to do |format| - format.html # index.html.erb - format.json { render :json => @ground_pictures.to_json(GroundPicture.list_json_opt) } + show_html_format format + show_prof_format format + show_json_format format end end - + + def count + list_count + end + + def count_by_panel + list_count + end + + def count_by_author + list_count + end + end