X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=app%2Fcontrollers%2Fspeech_balloon_templates_controller.rb;h=0b2d024951f1c752162ba56f41cc2f625f5ff652;hb=665761e56525215946e2547a70c82c603d5047af;hp=607554bd42b8f223b6fcac2a57929d185c847ef7;hpb=fb5769ff710c952a6b9ed3ce2ee74a6dfdc334cf;p=pettanr%2Fpettanr.git diff --git a/app/controllers/speech_balloon_templates_controller.rb b/app/controllers/speech_balloon_templates_controller.rb index 607554bd..0b2d0249 100644 --- a/app/controllers/speech_balloon_templates_controller.rb +++ b/app/controllers/speech_balloon_templates_controller.rb @@ -1,63 +1,63 @@ class SpeechBalloonTemplatesController < 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 => [] else - before_filter :authenticate_reader, :only => [:index, :show] + before_filter :authenticate_reader, :only => [ + :index, :show, :by_panel, :by_system_picture, :count, :count_by_panel, :count_by_system_picture + ] before_filter :authenticate_user, :only => [] end - before_filter :authenticate_admin!, :only => [:list, :browse, :destroy] - - # GET /speech_balloon_templates - # GET /speech_balloon_templates.json + before_filter :authenticate_admin, :only => [:new, :create, :edit, :update, :destroy] + def index - @speech_balloon_templates = SpeechBalloonTemplate.list - - respond_to do |format| - format.html # index.html.erb - format.json { render json: @speech_balloon_templates.to_json(SpeechBalloonTemplate.list_json_opt) } - end + filer_list end - - # GET /speech_balloon_templates/1 - # GET /speech_balloon_templates/1.json + + def by_panel + filer_list + end + + def by_system_picture + filer_list + end + + def show_html_format format + format.html { + } + end + def show - @speech_balloon_template = SpeechBalloonTemplate.show(params[:id], [@author, @admin]) - + set_show respond_to do |format| - format.html # show.html.erb - format.json { - render :json => @speech_balloon_template.to_json(SpeechBalloonTemplate.show_json_opt) - } - format.jsonp { - render :json => "callback(" + @speech_balloon_template.to_json() + ")" - } + show_html_format format + show_prof_format format + show_json_format format end end - - def list - @speech_balloon_templates = SpeechBalloonTemplate.all - - respond_to do |format| - format.html { render layout: 'system' } - format.json { render json: @speech_balloon_templates } - end + + def count + list_count end - - def browse - @speech_balloon_template = SpeechBalloonTemplate.find(params[:id]) - - respond_to do |format| - format.html { render layout: 'system' } - format.json { render json: @speech_balloon_template } - end + + def count_by_panel + list_count end - - # DELETE /speech_balloon_templates/1 - # DELETE /speech_balloon_templates/1.json + + def count_by_system_picture + list_count + end + + def new + form_new + end + + def edit + form_edit + end + def destroy - @speech_balloon_template = SpeechBalloonTemplate.find(params[:id]) - @speech_balloon_template.destroy + @item = SpeechBalloonTemplate.find(params[:id]) + @item.destroy respond_to do |format| format.html { redirect_to :action => :list }