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.downcase + '.gif'), :width => size, :height => size, :alt => name.to_s + ' Icon', :title => title
33 def author_icon opt = {}
37 def artist_icon opt = {}
41 def comic_icon opt = {}
45 def story_icon 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"
70 "PanelPicture": "panel_picture",
72 "class_name": "PanelPicture",
73 "table_name": "panel_pictures",
117 "SpeechBalloon": "speech_balloon",
119 "class_name": "SpeechBalloon",
120 "table_name": "speech_balloons",
121 "extend": "classname",
130 "speech_balloon_template_id": {
156 "Balloon": "balloon",
158 "class_name": "Balloon",
159 "table_name": "balloons",
165 "speech_balloon_id": {
168 "system_picture_id": {
199 "class_name": "Speech",
200 "table_name": "speeches",
206 "speech_balloon_id": {
209 "writing_format_id": {
250 "GroundPicture": "ground_picture",
252 "class_name": "GroundPicture",
253 "table_name": "ground_pictures",
291 "GroundColor": "ground_color",
293 "class_name": "GroundColor",
294 "table_name": "ground_colors",
323 "WritingFormat": "writing_format",
325 "class_name": "WritingFormat",
326 "table_name": "writing_formats",
341 "system_picture_id": {
358 "name": "panel_picture",
359 "path_name": "panel_pictures",
363 "name": "speech_balloon",
364 "path_name": "circle_speech_balloon/speech_balloons",
371 "name": "ground_picture",
372 "path_name": "ground_pictures",
376 "name": "ground_color",
377 "path_name": "ground_colors",
382 "PanelPicture": "panel_picture",
389 "label_break": false,
417 "path": "panels/size_helper",
419 "class": "panel_picture_width_tool"
433 "path": "panels/size_helper",
435 "class": "panel_picture_height_tool"
453 "column": "panel_id",
458 "column": "picture_id",
474 "CircleSpeechBalloon": "circle_speech_balloon",
475 "circle_speech_balloon": {
476 "base": "speech_balloon",
495 "path": "panels/tail_angle_helper",
542 "column": "speech_balloon_id",
548 "column": "system_picture_id",
554 "column": "settings",
560 "column": "writing_format_id",
564 "model": "writing_format",
565 "method": "enable_list",
571 "column": "font_size",
574 "source": "magic_number",
575 "key": "speech_font_size_items",
581 "column": "text_align",
584 "source": "magic_number",
585 "key": "speech_text_align_items"
607 "column": "fore_color",
614 "path": "panels/color_helper",
616 "wrapper": "speech-fore_color-wrap"
628 "column": "speech_balloon_id",
658 "column": "settings",
668 "column": "panel_id",
673 "column": "speech_balloon_template_id",
678 "column": "classname",
693 "column": "settings",
699 "PlainSpeechBalloon": "plain_speech_balloon",
700 "plain_speech_balloon": {
701 "base": "speech_balloon",
758 "column": "speech_balloon_id",
764 "column": "system_picture_id",
770 "column": "settings",
776 "column": "writing_format_id",
780 "model": "writing_format",
781 "method": "enable_list",
787 "column": "font_size",
790 "source": "magic_number",
791 "key": "speech_font_size_items",
797 "column": "text_align",
800 "source": "magic_number",
801 "key": "speech_text_align_items"
823 "column": "fore_color",
830 "path": "panels/color_helper",
832 "wrapper": "speech-fore_color-wrap"
844 "column": "speech_balloon_id",
874 "column": "settings",
884 "column": "panel_id",
889 "column": "speech_balloon_template_id",
894 "column": "classname",
909 "column": "settings",
915 "SquareSpeechBalloon": "square_speech_balloon",
916 "square_speech_balloon": {
917 "base": "speech_balloon",
974 "column": "speech_balloon_id",
980 "column": "system_picture_id",
986 "column": "settings",
992 "column": "writing_format_id",
996 "model": "writing_format",
997 "method": "enable_list",
1003 "column": "font_size",
1006 "source": "magic_number",
1007 "key": "speech_font_size_items",
1013 "column": "text_align",
1016 "source": "magic_number",
1017 "key": "speech_text_align_items"
1030 "column": "content",
1031 "type": "text_area",
1033 "label_break": true,
1039 "column": "fore_color",
1046 "path": "panels/color_helper",
1048 "wrapper": "speech-fore_color-wrap"
1060 "column": "speech_balloon_id",
1090 "column": "settings",
1100 "column": "panel_id",
1105 "column": "speech_balloon_template_id",
1110 "column": "classname",
1125 "column": "settings",
1131 "GroundPicture": "ground_picture",
1135 "column": "caption",
1145 "source": "magic_number",
1146 "key": "ground_picture_repeat_items",
1181 "column": "panel_id",
1186 "column": "picture_id",
1192 "GroundColor": "ground_color",
1196 "column": "caption",
1206 "label_break": true,
1211 "path": "panels/color_helper",
1213 "wrapper": "ground_color-code-wrap"
1233 "column": "panel_id",