1 module ApplicationHelper
3 request.protocol + request.host_with_port + filename
12 label.constantize.model_name.human
14 l.first.constantize.human_attribute_name(l.last)
19 def t_select_items(items)
20 items.map {|i| [t(i[0]), i[1]] }
23 def t_selected_item(name, index)
24 t(MagicNumber[name][index][0])
27 def icon_tag name, opt = {}
28 title = opt[:object] ? (name.to_s + ' ID:' + opt[:object].id.to_s) : name
29 size = opt[:size] ? opt[:size].to_i : 35
30 tag :img, :src => asset_path(name.to_s.underscore + '.gif'), :width => size, :height => size, :alt => name.to_s + ' Icon', :title => title
33 def author_icon opt = {}
37 def artist_icon opt = {}
41 def scroll_icon opt = {}
45 def scroll_panel_icon opt = {}
46 icon_tag :ScrollPanel, opt
49 def panel_icon opt = {}
53 def panel_editor_javascript_include_tags
54 WritingFormat.enable_list().map {|wf|
55 # javascript_include_tag wf.engine_name
56 javascript_include_tag wf.engine_name + "/application"
58 SpeechBalloonTemplate.enable_list().map {|sbt|
59 stylesheet_link_tag sbt.engine_name + "/application"
61 SpeechBalloonTemplate.enable_list().map {|sbt|
62 javascript_include_tag sbt.engine_name + "/application"