OSDN Git Service

add lg_id in resource picture
[pettanr/pettanr.git] / app / controllers / speech_balloon_templates_controller.rb
index 1e3b1c9..96f337d 100644 (file)
@@ -3,11 +3,11 @@ class SpeechBalloonTemplatesController < ApplicationController
     before_filter :authenticate_user, :only => []
   else
     before_filter :authenticate_reader, :only => [
-      :index, :show, :by_system_picture, :count, :count_by_system_picture
+      :index, :show, :by_panel, :by_system_picture, :count, :count_by_panel, :count_by_system_picture
     ]
     before_filter :authenticate_user, :only => []
   end
-  before_filter :authenticate_admin!, :only => [:destroy]
+  before_filter :authenticate_admin, :only => [:new, :create, :edit, :update, :destroy]
 
   def self.model
     SpeechBalloonTemplate
@@ -17,21 +17,25 @@ class SpeechBalloonTemplatesController < ApplicationController
     filer_list
   end
   
+  def by_panel
+    filer_list
+  end
+  
   def by_system_picture
     filer_list
   end
   
+  def show_html_format format
+    format.html {
+    }
+  end
+  
   def show
-    @item = SpeechBalloonTemplate.show(params[:id], @operators)
-
+    set_show
     respond_to do |format|
-      format.html {
-        @speech_balloon_template = @item
-      }
-      format_prof format
-      format.json {
-        render :json => @item.to_json(SpeechBalloonTemplate.show_json_opt)
-      }
+      show_html_format format
+      show_prof_format format
+      show_json_format format
     end
   end
   
@@ -39,13 +43,25 @@ class SpeechBalloonTemplatesController < ApplicationController
     list_count
   end
   
+  def count_by_panel
+    list_count
+  end
+  
   def count_by_system_picture
     list_count
   end
   
+  def new
+    form_new
+  end
+  
+  def edit
+    form_edit
+  end
+  
   def destroy
-    @speech_balloon_template = SpeechBalloonTemplate.find(params[:id])
-    @speech_balloon_template.destroy
+    @item = SpeechBalloonTemplate.find(params[:id])
+    @item.destroy
 
     respond_to do |format|
       format.html { redirect_to :action => :list }