X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=app%2Fcontrollers%2Fground_colors_controller.rb;h=168bda309b43a9db21e9bc862f690b2c39410cdc;hb=3e08dd3b1d0b84f2ad76c9a53bf6cad8b046ec62;hp=da5244f26a5106f3cbf70398b7250a062f11e083;hpb=2aa10ee1ef8c348a958cb53b44c51b2cebfaadb7;p=pettanr%2Fpettanr.git diff --git a/app/controllers/ground_colors_controller.rb b/app/controllers/ground_colors_controller.rb index da5244f2..168bda30 100644 --- a/app/controllers/ground_colors_controller.rb +++ b/app/controllers/ground_colors_controller.rb @@ -1,32 +1,56 @@ class GroundColorsController < ApplicationController - layout 'test' if MagicNumber['test_layout'] - if MagicNumber['run_mode'] == 0 + 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] + 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 - # GET /ground_colors - # GET /ground_colors.json + def self.model + GroundColor + end + def index - @page = GroundColor.page params[:page] - @page_size = GroundColor.page_size params[:page_size] - @ground_colors = GroundColor.list(@page, @page_size) - - respond_to do |format| - format.html # index.html.erb - format.json { render :json => @ground_colors.to_json(GroundColor.list_json_opt) } - end + filer_list + end + + def by_panel + filer_list + end + + def by_author + filer_list + end + + def show_html_format format + format.html { + @ground_color = @item + } end def show - @ground_color = GroundColor.show(params[:id], [@user, @admin]) + set_show respond_to do |format| - format.html # show.html.erb - format.json { render json: @ground_color.to_json(GroundColor.show_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