X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=app%2Fcontrollers%2Fballoons_controller.rb;h=3e97f891277defe46c967f906b62dd72b43335d7;hb=d2a17869f5a5fb9a33ddad29887c8f03a129c407;hp=69a9232230206688ddc9e7d6ff959e0dcafaddcb;hpb=46ddebc32f7409dc749f83c710aba9a345381165;p=pettanr%2Fpettanr.git diff --git a/app/controllers/balloons_controller.rb b/app/controllers/balloons_controller.rb index 69a92322..3e97f891 100644 --- a/app/controllers/balloons_controller.rb +++ b/app/controllers/balloons_controller.rb @@ -1,24 +1,58 @@ class BalloonsController < ApplicationController - before_filter :authenticate_author!, :only => [:index, :show] - before_filter :authenticate_admin!, :only => [:list, :browse] + if Manifest.manifest.magic_numbers['run_mode'] == 0 + before_action :authenticate_user, :only => [:new, :edit, :create, :update, :destroy] + before_action :authenticate_author, :only => [:new, :edit, :create, :update, :destroy] + else + before_action :authenticate_reader, :only => [ + :index, :show, + :by_author, :by_speech_balloon, :by_speech_balloon_template, :by_system_picture + ] + before_action :authenticate_user, :only => [:new, :edit, :create, :update, :destroy] + before_action :authenticate_author, :only => [:new, :edit, :create, :update, :destroy] + end - # GET /balloons - # GET /balloons.json def index - @balloons = Balloon.all - - respond_to do |format| - format.html # index.html.erb - format.json { render json: @balloons } - end + filer_list + end + + def by_author + filer_list param: params[:id] end - - def list - @balloons = Balloon.all - + + def by_speech_balloon + filer_list param: params[:id] + end + + def by_speech_balloon_template + filer_list param: params[:id] + end + + def by_system_picture + filer_list param: params[:id] + end + + def show_html_format format + format.html { + @item.boosts 'post' + @balloon = @item + } + end + + def show + set_show respond_to do |format| - format.html { render layout: 'system' } - format.json { render json: @balloons } + show_html_format format + show_prof_format format + show_json_format format end end + + def new + form_new + end + + def edit + form_edit + end + end