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])
28 tag :img, :src => asset_path('item.png'), :width => 35, :height => 35
31 def icon_tag name, opt = {}
32 title = opt[:object] ? (name.to_s + ' ID:' + opt[:object].id.to_s) : name
33 size = opt[:size] ? opt[:size].to_i : 35
34 tag :img, :src => asset_path(name.to_s.underscore + '.gif'), :width => size, :height => size, :alt => name.to_s + ' Icon', :title => title
37 def author_icon opt = {}
41 def artist_icon opt = {}
45 def scroll_icon opt = {}
49 def scroll_panel_icon opt = {}
50 icon_tag :ScrollPanel, opt
53 def comic_icon opt = {}
57 def story_icon opt = {}
61 def story_sheet_icon opt = {}
62 icon_tag :StorySheet, opt
65 def sheet_icon opt = {}
69 def sheet_panel_icon opt = {}
73 def panel_icon opt = {}
77 def panel_editor_javascript_include_tags
78 WritingFormat.enable_list().map {|wf|
79 # javascript_include_tag wf.engine_name
80 javascript_include_tag wf.engine_name + "/application"
82 SpeechBalloonTemplate.enable_list().map {|sbt|
83 stylesheet_link_tag sbt.engine_name + "/application"
85 SpeechBalloonTemplate.enable_list().map {|sbt|
86 javascript_include_tag sbt.engine_name + "/application"
96 "class_name": "Scroll",
97 "table_name": "scrolls",
101 "id_column": "author_id"
106 "foreign_key": "scroll_id",
107 "list_method": "list_by_scroll"
110 "through": "scroll_panels",
111 "foreign_key": "scroll_id",
112 "list_method": "list_by_scroll"
141 "type": "magic_number",
142 "key": "scroll_visible_items"
167 "ScrollPanel": "scroll_panel",
169 "class_name": "ScrollPanel",
170 "table_name": "scroll_panels",
174 "id_column": "panel_id"
177 "id_column": "scroll_id"
229 "class_name": "Comic",
230 "table_name": "comics",
234 "id_column": "author_id"
239 "foreign_key": "comic_id",
240 "list_method": "list_by_comic"
243 "has_many_through": {}
270 "type": "magic_number",
271 "key": "comic_visible_items"
298 "class_name": "Story",
299 "table_name": "stories",
303 "id_column": "comic_id"
308 "foreign_key": "story_id",
309 "list_method": "list_by_story"
312 "through": "story_sheets",
313 "foreign_key": "story_id",
314 "list_method": "list_by_story"
355 "type": "magic_number",
356 "key": "story_visible_items"
370 "name": "title_with_t"
374 "StorySheet": "story_sheet",
376 "class_name": "StorySheet",
377 "table_name": "story_sheets",
381 "id_column": "story_id"
384 "id_column": "sheet_id"
434 "class_name": "Sheet",
435 "table_name": "sheets",
439 "id_column": "author_id"
444 "foreign_key": "story_id",
445 "list_method": "list_by_sheet"
448 "through": "story_sheets",
449 "foreign_key": "sheet_id",
450 "list_method": "list_by_sheet"
453 "foreign_key": "sheet_id",
454 "list_method": "list_by_sheet"
457 "through": "sheet_panels",
458 "foreign_key": "sheet_id",
459 "list_method": "list_by_sheet"
496 "type": "magic_number",
497 "key": "sheet_visible_items"
522 "SheetPanel": "sheet_panel",
524 "class_name": "SheetPanel",
525 "table_name": "sheet_panels",
529 "id_column": "sheet_id"
532 "id_column": "panel_id"
603 "class_name": "Panel",
604 "table_name": "panels",
608 "id_column": "author_id"
613 "foreign_key": "panel_id",
614 "list_method": "list_by_panel"
617 "through": "scroll_panels",
618 "foreign_key": "panel_id",
619 "list_method": "list_by_panel"
622 "foreign_key": "panel_id",
623 "list_method": "list_by_panel"
626 "through": "sheet_panels",
627 "foreign_key": "panel_id",
628 "list_method": "list_by_panel"
631 "foreign_key": "panel_id",
632 "list_method": "list_by_panel"
635 "foreign_key": "panel_id",
636 "list_method": "list_by_panel"
639 "foreign_key": "panel_id",
640 "list_method": "list_by_panel"
643 "foreign_key": "panel_id",
644 "list_method": "list_by_panel"
691 "type": "magic_number",
692 "key": "panel_visible_items"
713 "name": "plain_scenario"
717 "PanelPicture": "panel_picture",
719 "class_name": "PanelPicture",
720 "table_name": "panel_pictures",
724 "id_column": "panel_id"
812 "SpeechBalloon": "speech_balloon",
814 "class_name": "SpeechBalloon",
815 "table_name": "speech_balloons",
816 "extend": "classname",
820 "id_column": "panel_id"
826 "foreign_key": "speech_balloon_id",
827 "list_method": "list_by_speech_balloon"
830 "foreign_key": "speech_balloon_id",
831 "list_method": "list_by_speech_balloon"
849 "speech_balloon_template_id": {
897 "name": "plain_scenario"
901 "Balloon": "balloon",
903 "class_name": "Balloon",
904 "table_name": "balloons",
908 "id_column": "speech_balloon_id"
911 "id_column": "system_picture_id"
924 "speech_balloon_id": {
930 "system_picture_id": {
988 "class_name": "Speech",
989 "table_name": "speeches",
993 "id_column": "speech_balloon_id"
996 "id_column": "writing_format_id"
1009 "speech_balloon_id": {
1015 "writing_format_id": {
1019 "model": "writing_format",
1020 "method": "enable_list",
1021 "caption": "caption"
1040 "type": "magic_number",
1041 "key": "speech_font_size_items"
1055 "type": "magic_number",
1056 "key": "speech_text_align_items"
1116 "GroundPicture": "ground_picture",
1118 "class_name": "GroundPicture",
1119 "table_name": "ground_pictures",
1123 "id_column": "panel_id"
1164 "type": "magic_number",
1165 "key": "ground_picture_repeat_items"
1206 "GroundColor": "ground_color",
1208 "class_name": "GroundColor",
1209 "table_name": "ground_colors",
1213 "id_column": "panel_id"
1258 "type": "magic_number",
1259 "key": "ground_color_orientation_items"
1298 "OriginalPicture": "original_picture",
1299 "original_picture": {
1300 "class_name": "OriginalPicture",
1301 "table_name": "original_pictures",
1305 "id_column": "artist_id"
1310 "foreign_key": "original_picture_id",
1311 "list_method": "list_by_original_picture"
1315 "resource_picture": {
1316 "foreign_key": "original_picture_id",
1317 "list_method": "list_by_original_picture"
1386 "Picture": "picture",
1388 "class_name": "Picture",
1389 "table_name": "pictures",
1393 "id_column": "license_id"
1396 "id_column": "artist_id"
1410 "original_picture_id": {
1499 "ResourcePicture": "resource_picture",
1500 "resource_picture": {
1501 "class_name": "ResourcePicture",
1502 "table_name": "resource_pictures",
1506 "id_column": "license_id"
1509 "id_column": "artist_id"
1523 "original_picture_id": {
1619 "SpeechBalloonTemplate": "speech_balloon_template",
1620 "speech_balloon_template": {
1621 "class_name": "SpeechBalloonTemplate",
1622 "table_name": "speech_balloon_templates",
1626 "id_column": "system_picture_id"
1630 "speech_balloons": {
1631 "foreign_key": "speech_balloon_template_id",
1632 "list_method": "list_by_speech_balloon_template"
1635 "through": "speech_balloons",
1636 "foreign_key": "speech_balloon_template_id",
1637 "list_method": "list_by_speech_balloon_template"
1676 "system_picture_id": {
1697 "method": "enable_list",
1704 "WritingFormat": "writing_format",
1706 "class_name": "WritingFormat",
1707 "table_name": "writing_formats",
1711 "id_column": "system_picture_id"
1716 "foreign_key": "writing_format_id",
1717 "list_method": "list_by_writing_format"
1748 "system_picture_id": {
1769 "method": "enable_list",
1776 "LicenseGroup": "license_group",
1778 "class_name": "LicenseGroup",
1779 "table_name": "license_groups",
1784 "foreign_key": "license_group_id",
1785 "list_method": "list_by_license_group"
1837 "License": "license",
1839 "class_name": "License",
1840 "table_name": "licenses",
1844 "id_column": "license_group_id"
1847 "id_column": "system_picture_id"
1851 "resource_pictures": {
1852 "foreign_key": "license_id",
1853 "list_method": "list_by_license"
1866 "license_group_id": {
1884 "system_picture_id": {
1901 "credit_pictures": {
1915 "class_name": "Author",
1916 "table_name": "authors",
1921 "foreign_key": "author_id",
1922 "list_method": "list_by_author"
1925 "foreign_key": "author_id",
1926 "list_method": "list_by_author"
1929 "foreign_key": "author_id",
1930 "list_method": "list_by_author"
1933 "foreign_key": "author_id",
1934 "list_method": "list_by_author"
1937 "foreign_key": "author_id",
1938 "list_method": "list_by_author"
1981 "class_name": "Artist",
1982 "table_name": "artists",
1986 "resource_pictures": {
1987 "foreign_key": "artist_id",
1988 "list_method": "list_by_artist"
2029 "SystemPicture": "system_picture",
2031 "class_name": "SystemPicture",
2032 "table_name": "system_pictures",
2284 "speech_balloon_template_id",
2307 "speech_balloon_id",
2308 "writing_format_id",
2333 "speech_balloon_id",
2334 "system_picture_id",
2394 "original_picture": {
2424 "original_picture_id",
2449 "resource_picture": {
2452 "original_picture_id",
2478 "speech_balloon_template": {
2485 "system_picture_id",
2507 "system_picture_id",
2546 "system_picture_id",
2622 "name": "/assets/item.png"
2643 "name": "/assets/item.png",
2662 "name": "/assets/item.png"
2679 "name": "/assets/item.png"
2683 "name": "title_with_t",
2700 "name": "/assets/item.png",
2719 "name": "/assets/item.png"
2740 "name": "/assets/item.png",
2759 "name": "/assets/item.png"
2763 "name": "plain_scenario",
2779 "name": "symbol_option"
2796 "name": "symbol_option"
2800 "name": "plain_scenario",
2816 "name": "symbol_option"
2836 "name": "symbol_option"
2852 "name": "symbol_option"
2883 "original_picture": {
2886 "name": "symbol_option"
2908 "name": "symbol_option"
2922 "resource_picture": {
2925 "name": "symbol_option"
2938 "speech_balloon_template": {
2941 "name": "symbol_option"
2957 "name": "/assets/item.png"
2973 "name": "/assets/item.png"
2979 "type": "url_column",
2993 "name": "/assets/item.png"
2997 "name": "caption_with_group",
2999 "type": "url_column",
3014 "name": "/assets/item.png"
3031 "name": "/assets/item.png"
3048 "name": "symbol_option"
3063 "name": "panel_picture",
3064 "path_name": "panel_pictures",
3068 "name": "speech_balloon",
3069 "path_name": "circle_speech_balloon/speech_balloons",
3076 "name": "ground_picture",
3077 "path_name": "ground_pictures",
3081 "name": "ground_color",
3082 "path_name": "ground_colors",
3091 "column": "caption",
3124 "column": "publish",
3128 "source": "magic_number",
3129 "key": "comic_visible_items",
3143 "column": "author_id",
3161 "PanelPicture": "panel_picture",
3165 "column": "caption",
3199 "path": "panels/size_helper",
3201 "class": "panel_picture_width_tool"
3216 "path": "panels/size_helper",
3218 "class": "panel_picture_height_tool"
3240 "column": "panel_id",
3248 "column": "picture_id",
3253 "path": "panels/popup_helper",
3254 "source": "pictures",
3293 "speech_balloon.id": {
3301 "speech_balloon.panel_id": {
3302 "column": "panel_id",
3309 "speech_balloon.speech_balloon_template_id": {
3310 "column": "speech_balloon_template_id",
3317 "speech_balloon.caption": {
3318 "column": "caption",
3325 "speech_balloon.z": {
3333 "speech_balloon.t": {
3341 "speech_balloon.classname": {
3342 "column": "classname",
3349 "speech_balloon.settings": {
3350 "column": "settings",
3367 "balloon.speech_balloon_id": {
3370 "column": "speech_balloon_id",
3377 "balloon.system_picture_id": {
3380 "column": "system_picture_id",
3399 "path": "panels/tail_angle_helper",
3446 "balloon.settings": {
3449 "column": "settings",
3466 "speech.speech_balloon_id": {
3469 "column": "speech_balloon_id",
3516 "speech.writing_format_id": {
3519 "column": "writing_format_id",
3524 "model": "writing_format",
3525 "method": "enable_list",
3526 "caption": "caption"
3529 "speech.font_size": {
3532 "column": "font_size",
3536 "source": "magic_number",
3537 "key": "speech_font_size_items",
3541 "speech.text_align": {
3544 "column": "text_align",
3548 "source": "magic_number",
3549 "key": "speech_text_align_items"
3565 "column": "content",
3566 "type": "text_area",
3574 "speech.fore_color": {
3577 "column": "fore_color",
3585 "path": "panels/color_helper",
3587 "wrapper": "speech-fore_color-wrap"
3591 "speech.settings": {
3594 "column": "settings",
3603 "CircleSpeechBalloon": "circle_speech_balloon",
3604 "circle_speech_balloon": {
3605 "base": "speech_balloon",
3608 "speech_balloon.caption",
3615 "balloon.speech_balloon_id",
3616 "balloon.system_picture_id",
3618 "speech.writing_format_id",
3620 "speech.text_align",
3623 "speech.fore_color",
3625 "speech.speech_balloon_id",
3631 "speech_balloon.id",
3632 "speech_balloon.panel_id",
3633 "speech_balloon.speech_balloon_template_id",
3634 "speech_balloon.classname",
3637 "speech_balloon.settings"
3640 "PlainSpeechBalloon": "plain_speech_balloon",
3641 "plain_speech_balloon": {
3642 "base": "speech_balloon",
3656 "speech_balloon.caption",
3663 "balloon.speech_balloon_id",
3664 "balloon.system_picture_id",
3666 "speech.writing_format_id",
3668 "speech.text_align",
3671 "speech.fore_color",
3673 "speech.speech_balloon_id",
3679 "speech_balloon.id",
3680 "speech_balloon.panel_id",
3681 "speech_balloon.speech_balloon_template_id",
3682 "speech_balloon.classname",
3685 "speech_balloon.settings"
3688 "SquareSpeechBalloon": "square_speech_balloon",
3689 "square_speech_balloon": {
3690 "base": "speech_balloon",
3704 "speech_balloon.caption",
3711 "balloon.speech_balloon_id",
3712 "balloon.system_picture_id",
3714 "speech.writing_format_id",
3716 "speech.text_align",
3719 "speech.fore_color",
3721 "speech.speech_balloon_id",
3727 "speech_balloon.id",
3728 "speech_balloon.panel_id",
3729 "speech_balloon.speech_balloon_template_id",
3730 "speech_balloon.classname",
3733 "speech_balloon.settings"
3736 "GroundPicture": "ground_picture",
3748 "column": "panel_id",
3756 "column": "picture_id",
3764 "column": "caption",
3776 "source": "magic_number",
3777 "key": "ground_picture_repeat_items",
3827 "GroundColor": "ground_color",
3839 "column": "panel_id",
3847 "column": "caption",
3865 "path": "panels/color_helper",
3867 "wrapper": "ground_color-code-wrap"
3872 "column": "orientation",
3876 "source": "magic_number",
3877 "key": "ground_color_orientation_items",