1 class SpeechBalloonTemplatesController < ApplicationController
2 layout 'test' if MagicNumber['test_layout']
3 before_filter :authenticate_user!, :only => [:index, :show]
4 before_filter :authenticate_author, :only => [:index, :show]
5 before_filter :authenticate_admin!, :only => [:list, :browse, :destroy]
7 # GET /speech_balloon_templates
8 # GET /speech_balloon_templates.json
10 @speech_balloon_templates = SpeechBalloonTemplate.list
12 respond_to do |format|
13 format.html # index.html.erb
14 format.json { render json: @speech_balloon_templates.to_json(SpeechBalloonTemplate.list_json_opt) }
18 # GET /speech_balloon_templates/1
19 # GET /speech_balloon_templates/1.json
21 @speech_balloon_template = SpeechBalloonTemplate.show(params[:id], @author)
23 respond_to do |format|
24 format.html # show.html.erb
26 render :json => @speech_balloon_template.to_json(SpeechBalloonTemplate.show_json_opt)
29 render :json => "callback(" + @speech_balloon_template.to_json() + ")"
35 @speech_balloon_templates = SpeechBalloonTemplate.all
37 respond_to do |format|
38 format.html { render layout: 'system' }
39 format.json { render json: @speech_balloon_templates }
44 @speech_balloon_template = SpeechBalloonTemplate.find(params[:id])
46 respond_to do |format|
47 format.html { render layout: 'system' }
48 format.json { render json: @speech_balloon_template }
52 # DELETE /speech_balloon_templates/1
53 # DELETE /speech_balloon_templates/1.json
55 @speech_balloon_template = SpeechBalloonTemplate.find(params[:id])
56 @speech_balloon_template.destroy
58 respond_to do |format|
59 format.html { redirect_to :action => :list }
60 format.json { head :ok }