1 module ApplicationHelper
7 request.protocol + request.host_with_port + filename
16 label.constantize.model_name.human
18 l.first.constantize.human_attribute_name(l.last)
23 def t_select_items(items)
24 items.map {|i| [t(i[0]), i[1]] }
27 def t_selected_item(name, index)
28 t(manifest.system_resources.select_items[name][index][0])
32 tag :img, :src => asset_path('item.png'), :width => 35, :height => 35
35 def icon_tag name, opt = {}
36 title = opt[:object] ? (name.to_s + ' ID:' + opt[:object].id.to_s) : name
37 size = opt[:size] ? opt[:size].to_i : 35
38 tag :img, :src => '/images/' + name.to_s.underscore + '.gif', :width => size, :height => size, :alt => name.to_s + ' Icon', :title => title
41 def author_icon opt = {}
45 def artist_icon opt = {}
49 def scroll_icon opt = {}
53 def scroll_panel_icon opt = {}
54 icon_tag :ScrollPanel, opt
57 def comic_icon opt = {}
61 def story_icon opt = {}
65 def story_sheet_icon opt = {}
66 icon_tag :StorySheet, opt
69 def sheet_icon opt = {}
73 def sheet_panel_icon opt = {}
77 def panel_icon opt = {}
81 def panel_editor_javascript_include_tags
82 WritingFormat.enable_list().map {|wf|
83 # javascript_include_tag wf.engine_name
84 javascript_include_tag wf.engine_name + "/application"
86 SpeechBalloonTemplate.enable_list().map {|sbt|
87 stylesheet_link_tag sbt.my_engine_name + "/application"
89 SpeechBalloonTemplate.enable_list().map {|sbt|
90 javascript_include_tag sbt.my_engine_name + "/application"