OSDN Git Service

Client is version 0.5.40, fixed Panel.picture_id
[pettanr/pettanr.git] / app / helpers / application_helper.rb
index 9b27e32..190debd 100644 (file)
@@ -24,4 +24,30 @@ module ApplicationHelper
     t(MagicNumber[name][index][0])
   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
+  end
+  
+  def author_icon opt = {}
+    icon_tag :Author, opt
+  end
+  
+  def artist_icon opt = {}
+    icon_tag :Artist, opt
+  end
+  
+  def comic_icon opt = {}
+    icon_tag :Comic, opt
+  end
+  
+  def story_icon opt = {}
+    icon_tag :Story, opt
+  end
+  
+  def panel_icon opt = {}
+    icon_tag :Panel, opt
+  end
+  
 end