X-Git-Url: http://git.osdn.net/view?p=pettanr%2Fpettanr.git;a=blobdiff_plain;f=app%2Fcontrollers%2Fground_colors_controller.rb;h=c9be0d39948e2c3a55291a7538b6258ec5fc38d6;hp=772f647c7fb9a21b9c2f5fba2ba97c6d9054fdf0;hb=d7c8065be895b67dc453b0e11ad0f259f1ca6706;hpb=c7216b685d62319f15e1cb982a0cfc50274ba043 diff --git a/app/controllers/ground_colors_controller.rb b/app/controllers/ground_colors_controller.rb index 772f647c..c9be0d39 100644 --- a/app/controllers/ground_colors_controller.rb +++ b/app/controllers/ground_colors_controller.rb @@ -1,17 +1,40 @@ class GroundColorsController < ApplicationController - layout 'test' if Pettanr::TestLayout - before_filter :authenticate_user!, :only => [:index] - - # GET /ground_colors - # GET /ground_colors.json + if Manifest.manifest.magic_numbers['run_mode'] == 0 + before_action :authenticate_user, :only => [] + before_action :authenticate_author, :only => [] + else + before_action :authenticate_reader, :only => [ + :index, :show, :by_panel, :by_author + ] + before_action :authenticate_user, :only => [] + before_action :authenticate_author, :only => [] + end + def index - @page = GroundColor.page params[:page] - @page_size = GroundColor.page_size params[:page_size] - @ground_colors = GroundColor.list(@page, @page_size) - + filer_list + end + + def by_panel + filer_list param: params[:id] + end + + def by_author + filer_list param: params[:id] + end + + def show_html_format format + format.html { + @ground_color = @item + } + end + + def show + set_show respond_to do |format| - format.html # index.html.erb - format.json { render :json => @ground_colors.to_json(GroundColor.list_json_opt) } + show_html_format format + show_prof_format format + show_json_format format end end + end