end
before_filter :authenticate_admin!, :only => [:list, :browse]
- @@model = SpeechBalloon
+ def self.model
+ SpeechBalloon
+ end
+
def index
- set_filer
-
- respond_to do |format|
- format_filer format
- format.json { render json: @items.to_json(@@model.list_json_opt) }
- end
+ public_list
end
def show
end
def new
- raise Pettanr::NotWork unless @author.working_panel
- @speech_balloon_template = SpeechBalloonTemplate.show params[:speech_balloon_template_id], @author
+ raise Pettanr::NotWork unless @operators.author.working_panel
+ @speech_balloon_template = SpeechBalloonTemplate.show params[:speech_balloon_template_id], @operators
- @panel = Panel.edit(@author.working_panel, @author)
+ @panel = Panel.edit(@operators.author.working_panel, @operators)
@speech_balloon = SpeechBalloon.new :panel_id => @panel.id, :speech_balloon_template_id => @speech_balloon_template.id
@speech_balloon.boost
@speech_balloon.supply_default
end
def edit
- @speech_balloon = SpeechBalloon.show(params[:id], @author)
+ @speech_balloon = SpeechBalloon.show(params[:id], @operators.author)
@speech_balloon_template = @speech_balloon.speech_balloon_template
- @panel = Panel.edit(@speech_balloon.panel.id, @author)
+ @panel = Panel.edit(@speech_balloon.panel.id, @operators.author)
@speech_balloon.boost
end
def create
- raise Pettanr::NotWork unless @author.working_panel
+ raise Pettanr::NotWork unless @operators.author.working_panel
SpeechBalloon.fold_extend_settings params
- @panel = Panel.edit(@author.working_panel, @author)
+ @panel = Panel.edit(@operators.author.working_panel, @author)
@speech_balloon = SpeechBalloon.new
@speech_balloon.attributes = params[:speech_balloon]
def update
SpeechBalloon.fold_extend_settings params
- @speech_balloon = SpeechBalloon.show(params[:id], @author)
+ @speech_balloon = SpeechBalloon.show(params[:id], @operators.author)
@speech_balloon.attributes = params[:speech_balloon]
@speech_balloon_template = @speech_balloon.speech_balloon_template
params[:speech_balloon][:balloon_attributes][:system_picture_id] = @speech_balloon.get_balloon.select_system_picture
- @panel = Panel.edit(@speech_balloon.panel.id, @author)
+ @panel = Panel.edit(@speech_balloon.panel.id, @operators.author)
@speech_balloon.overwrite @panel.id
respond_to do |format|
- if @speech_balloon.valid? and @speech_balloon.store(@author, params[:speech_balloon])
+ if @speech_balloon.valid? and @speech_balloon.store(@operators.author, params[:speech_balloon])
flash[:notice] = I18n.t('flash.notice.updated', :model => SpeechBalloon.model_name.human)
format.html { redirect_to @speech_balloon }
format.json { head :ok }
end
def destroy
- @speech_balloon = SpeechBalloon.show(params[:id], @author)
- @panel = Panel.edit(@speech_balloon.panel.id, @author)
+ @speech_balloon = SpeechBalloon.show(params[:id], @operators.author)
+ @panel = Panel.edit(@speech_balloon.panel.id, @operators.author)
respond_to do |format|
- if @speech_balloon.remove @author
+ if @speech_balloon.remove @operators.author
flash[:notice] = I18n.t('flash.notice.destroyed', :model => SpeechBalloon.model_name.human)
format.html { redirect_to @panel }
format.json { head :ok }