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 comic_icon opt = {}
53 def story_icon opt = {}
57 def story_sheet_icon opt = {}
58 icon_tag :StorySheet, opt
61 def sheet_icon opt = {}
65 def sheet_panel_icon opt = {}
69 def panel_icon opt = {}
73 def panel_editor_javascript_include_tags
74 WritingFormat.enable_list().map {|wf|
75 # javascript_include_tag wf.engine_name
76 javascript_include_tag wf.engine_name + "/application"
78 SpeechBalloonTemplate.enable_list().map {|sbt|
79 stylesheet_link_tag sbt.engine_name + "/application"
81 SpeechBalloonTemplate.enable_list().map {|sbt|
82 javascript_include_tag sbt.engine_name + "/application"
92 "class_name": "Panel",
93 "table_name": "panels",
152 "PanelPicture": "panel_picture",
154 "class_name": "PanelPicture",
155 "table_name": "panel_pictures",
239 "SpeechBalloon": "speech_balloon",
241 "class_name": "SpeechBalloon",
242 "table_name": "speech_balloons",
243 "extend": "classname",
258 "speech_balloon_template_id": {
303 "Balloon": "balloon",
305 "class_name": "Balloon",
306 "table_name": "balloons",
315 "speech_balloon_id": {
321 "system_picture_id": {
379 "class_name": "Speech",
380 "table_name": "speeches",
389 "speech_balloon_id": {
395 "writing_format_id": {
482 "GroundPicture": "ground_picture",
484 "class_name": "GroundPicture",
485 "table_name": "ground_pictures",
560 "GroundColor": "ground_color",
562 "class_name": "GroundColor",
563 "table_name": "ground_colors",
640 "WritingFormat": "writing_format",
642 "class_name": "WritingFormat",
643 "table_name": "writing_formats",
670 "system_picture_id": {
694 "name": "panel_picture",
695 "path_name": "panel_pictures",
699 "name": "speech_balloon",
700 "path_name": "circle_speech_balloon/speech_balloons",
707 "name": "ground_picture",
708 "path_name": "ground_pictures",
712 "name": "ground_color",
713 "path_name": "ground_colors",
759 "source": "magic_number",
760 "key": "comic_visible_items",
774 "column": "author_id",
792 "PanelPicture": "panel_picture",
830 "path": "panels/size_helper",
832 "class": "panel_picture_width_tool"
847 "path": "panels/size_helper",
849 "class": "panel_picture_height_tool"
871 "column": "panel_id",
879 "column": "picture_id",
919 "speech_balloon.id": {
927 "speech_balloon.panel_id": {
928 "column": "panel_id",
935 "speech_balloon.speech_balloon_template_id": {
936 "column": "speech_balloon_template_id",
943 "speech_balloon.caption": {
951 "speech_balloon.z": {
959 "speech_balloon.t": {
967 "speech_balloon.classname": {
968 "column": "classname",
975 "speech_balloon.settings": {
976 "column": "settings",
993 "balloon.speech_balloon_id": {
996 "column": "speech_balloon_id",
1003 "balloon.system_picture_id": {
1006 "column": "system_picture_id",
1025 "path": "panels/tail_angle_helper",
1072 "balloon.settings": {
1075 "column": "settings",
1092 "speech.speech_balloon_id": {
1095 "column": "speech_balloon_id",
1142 "speech.writing_format_id": {
1145 "column": "writing_format_id",
1150 "model": "writing_format",
1151 "method": "enable_list",
1152 "caption": "caption"
1155 "speech.font_size": {
1158 "column": "font_size",
1162 "source": "magic_number",
1163 "key": "speech_font_size_items",
1167 "speech.text_align": {
1170 "column": "text_align",
1174 "source": "magic_number",
1175 "key": "speech_text_align_items"
1191 "column": "content",
1192 "type": "text_area",
1200 "speech.fore_color": {
1203 "column": "fore_color",
1211 "path": "panels/color_helper",
1213 "wrapper": "speech-fore_color-wrap"
1217 "speech.settings": {
1220 "column": "settings",
1229 "CircleSpeechBalloon": "circle_speech_balloon",
1230 "circle_speech_balloon": {
1231 "base": "speech_balloon",
1234 "speech_balloon.caption",
1241 "balloon.speech_balloon_id",
1242 "balloon.system_picture_id",
1244 "speech.writing_format_id",
1246 "speech.text_align",
1249 "speech.fore_color",
1251 "speech.speech_balloon_id",
1257 "speech_balloon.id",
1258 "speech_balloon.panel_id",
1259 "speech_balloon.speech_balloon_template_id",
1260 "speech_balloon.classname",
1263 "speech_balloon.settings"
1266 "PlainSpeechBalloon": "plain_speech_balloon",
1267 "plain_speech_balloon": {
1268 "base": "speech_balloon",
1282 "speech_balloon.caption",
1289 "balloon.speech_balloon_id",
1290 "balloon.system_picture_id",
1292 "speech.writing_format_id",
1294 "speech.text_align",
1297 "speech.fore_color",
1299 "speech.speech_balloon_id",
1305 "speech_balloon.id",
1306 "speech_balloon.panel_id",
1307 "speech_balloon.speech_balloon_template_id",
1308 "speech_balloon.classname",
1311 "speech_balloon.settings"
1314 "SquareSpeechBalloon": "square_speech_balloon",
1315 "square_speech_balloon": {
1316 "base": "speech_balloon",
1330 "speech_balloon.caption",
1337 "balloon.speech_balloon_id",
1338 "balloon.system_picture_id",
1340 "speech.writing_format_id",
1342 "speech.text_align",
1345 "speech.fore_color",
1347 "speech.speech_balloon_id",
1353 "speech_balloon.id",
1354 "speech_balloon.panel_id",
1355 "speech_balloon.speech_balloon_template_id",
1356 "speech_balloon.classname",
1359 "speech_balloon.settings"
1362 "GroundPicture": "ground_picture",
1374 "column": "panel_id",
1382 "column": "picture_id",
1390 "column": "caption",
1402 "source": "magic_number",
1403 "key": "ground_picture_repeat_items",
1453 "GroundColor": "ground_color",
1465 "column": "panel_id",
1473 "column": "caption",
1491 "path": "panels/color_helper",
1493 "wrapper": "ground_color-code-wrap"
1498 "column": "orientation",
1502 "source": "magic_number",
1503 "key": "ground_color_orientation_items",