1 class SpeechBalloonTemplatesController < ApplicationController
2 layout 'test' if Pettanr::TestLayout
3 before_filter :authenticate_user!, :only => [:index, :show]
4 before_filter :authenticate_admin!, :only => [:list, :browse, :destroy]
6 # GET /speech_balloon_templates
7 # GET /speech_balloon_templates.json
9 @speech_balloon_templates = SpeechBalloonTemplate.list
11 respond_to do |format|
12 format.html # index.html.erb
13 format.json { render json: @speech_balloon_templates.to_json(SpeechBalloonTemplate.list_json_opt) }
17 # GET /speech_balloon_templates/1
18 # GET /speech_balloon_templates/1.json
20 @speech_balloon_template = SpeechBalloonTemplate.show(params[:id], @author)
22 respond_to do |format|
23 format.html # show.html.erb
25 render :json => @speech_balloon_template.to_json(SpeechBalloonTemplate.show_json_opt)
28 render :json => "callback(" + @speech_balloon_template.to_json() + ")"
34 @speech_balloon_templates = SpeechBalloonTemplate.all
36 respond_to do |format|
37 format.html { render layout: 'system' }
38 format.json { render json: @speech_balloon_templates }
43 @speech_balloon_template = SpeechBalloonTemplate.find(params[:id])
45 respond_to do |format|
46 format.html { render layout: 'system' }
47 format.json { render json: @speech_balloon_template }
51 # DELETE /speech_balloon_templates/1
52 # DELETE /speech_balloon_templates/1.json
54 @speech_balloon_template = SpeechBalloonTemplate.find(params[:id])
55 @speech_balloon_template.destroy
57 respond_to do |format|
58 format.html { redirect_to :action => :list }
59 format.json { head :ok }