1 class SpeechBalloonTemplatesController < ApplicationController
2 before_filter :authenticate_user!, :only => [:index, :show]
3 before_filter :authenticate_admin!, :only => [:list, :browse, :destroy]
5 # GET /speech_balloon_templates
6 # GET /speech_balloon_templates.json
8 @speech_balloon_templates = SpeechBalloonTemplate.list
10 respond_to do |format|
11 format.html # index.html.erb
12 format.json { render json: @speech_balloon_templates.to_json(SpeechBalloonTemplate.list_json_opt) }
16 # GET /speech_balloon_templates/1
17 # GET /speech_balloon_templates/1.json
19 @speech_balloon_template = SpeechBalloonTemplate.show(params[:id], @author)
21 respond_to do |format|
22 format.html # show.html.erb
24 render :json => @speech_balloon_template.to_json(SpeechBalloonTemplate.show_json_opt)
27 render :json => "callback(" + @speech_balloon_template.to_json() + ")"
33 @speech_balloon_templates = SpeechBalloonTemplate.all
35 respond_to do |format|
36 format.html { render layout: 'system' }
37 format.json { render json: @speech_balloon_templates }
42 @speech_balloon_template = SpeechBalloonTemplate.find(params[:id])
44 respond_to do |format|
45 format.html { render layout: 'system' }
46 format.json { render json: @speech_balloon_template }
50 # DELETE /speech_balloon_templates/1
51 # DELETE /speech_balloon_templates/1.json
53 @speech_balloon_template = SpeechBalloonTemplate.find(params[:id])
54 @speech_balloon_template.destroy
56 respond_to do |format|
57 format.html { redirect_to :action => :list }
58 format.json { head :ok }