OSDN Git Service

v07
[pettanr/pettanr.git] / app / helpers / application_helper.rb
index b513ed1..08b0b5d 100644 (file)
@@ -1,4 +1,8 @@
 module ApplicationHelper
+  def manifest
+    Manifest.manifest
+  end
+  
   def full_url filename
     request.protocol + request.host_with_port + filename
   end
@@ -21,13 +25,17 @@ module ApplicationHelper
   end
   
   def t_selected_item(name, index)
-    t(MagicNumber[name][index][0])
+    t(manifest.system_resources.select_items[name][index][0])
+  end
+  
+  def item_tag 
+    tag :img, :src => asset_path('item.png'), :width => 35, :height => 35
   end
   
   def icon_tag name, opt = {}
     title = opt[:object] ? (name.to_s + ' ID:' + opt[:object].id.to_s) : name
     size = opt[:size] ? opt[:size].to_i : 35
-    tag :img, :src => asset_path(name.to_s.downcase + '.gif'), :width => size, :height => size, :alt => name.to_s + ' Icon', :title => title
+    tag :img, :src => '/images/' + name.to_s.underscore + '.gif', :width => size, :height => size, :alt => name.to_s + ' Icon', :title => title
   end
   
   def author_icon opt = {}
@@ -46,6 +54,26 @@ module ApplicationHelper
     icon_tag :ScrollPanel, opt
   end
   
+  def comic_icon opt = {}
+    icon_tag :Comic, opt
+  end
+  
+  def story_icon opt = {}
+    icon_tag :Story, opt
+  end
+  
+  def story_sheet_icon opt = {}
+    icon_tag :StorySheet, opt
+  end
+  
+  def sheet_icon opt = {}
+    icon_tag :Sheet, opt
+  end
+  
+  def sheet_panel_icon opt = {}
+    icon_tag :Sheet, opt
+  end
+  
   def panel_icon opt = {}
     icon_tag :Panel, opt
   end
@@ -53,13 +81,13 @@ module ApplicationHelper
   def panel_editor_javascript_include_tags
     WritingFormat.enable_list().map {|wf|
 #      javascript_include_tag wf.engine_name
-      javascript_include_tag wf.engine_name + "/application"
+      javascript_include_tag wf.template_path_name + "/application"
     }.join("\n") + 
     SpeechBalloonTemplate.enable_list().map {|sbt|
-      stylesheet_link_tag sbt.engine_name + "/application"
+      stylesheet_link_tag sbt.template_path_name + "/application"
     }.join("\n") + 
     SpeechBalloonTemplate.enable_list().map {|sbt|
-      javascript_include_tag sbt.engine_name + "/application"
+      javascript_include_tag sbt.template_path_name + "/application"
     }.join("\n")
   end