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"
156 "ScrollPanel": "scroll_panel",
158 "class_name": "ScrollPanel",
159 "table_name": "scroll_panels",
163 "id_column": "panel_id"
166 "id_column": "scroll_id"
218 "class_name": "Comic",
219 "table_name": "comics",
223 "id_column": "author_id"
228 "foreign_key": "comic_id",
229 "list_method": "list_by_comic"
232 "has_many_through": {}
276 "class_name": "Story",
277 "table_name": "stories",
281 "id_column": "comic_id"
286 "foreign_key": "story_id",
287 "list_method": "list_by_story"
290 "through": "story_sheets",
291 "foreign_key": "story_id",
292 "list_method": "list_by_story"
341 "StorySheet": "story_sheet",
343 "class_name": "StorySheet",
344 "table_name": "story_sheets",
348 "id_column": "story_id"
351 "id_column": "sheet_id"
401 "class_name": "Sheet",
402 "table_name": "sheets",
406 "id_column": "author_id"
411 "foreign_key": "story_id",
412 "list_method": "list_by_sheet"
415 "through": "story_sheets",
416 "foreign_key": "sheet_id",
417 "list_method": "list_by_sheet"
420 "foreign_key": "sheet_id",
421 "list_method": "list_by_sheet"
424 "through": "sheet_panels",
425 "foreign_key": "sheet_id",
426 "list_method": "list_by_sheet"
478 "SheetPanel": "sheet_panel",
480 "class_name": "SheetPanel",
481 "table_name": "sheet_panels",
485 "id_column": "sheet_id"
488 "id_column": "panel_id"
559 "class_name": "Panel",
560 "table_name": "panels",
564 "id_column": "author_id"
569 "foreign_key": "panel_id",
570 "list_method": "list_by_panel"
573 "through": "scroll_panels",
574 "foreign_key": "panel_id",
575 "list_method": "list_by_panel"
578 "foreign_key": "panel_id",
579 "list_method": "list_by_panel"
582 "through": "sheet_panels",
583 "foreign_key": "panel_id",
584 "list_method": "list_by_panel"
587 "foreign_key": "panel_id",
588 "list_method": "list_by_panel"
591 "foreign_key": "panel_id",
592 "list_method": "list_by_panel"
595 "foreign_key": "panel_id",
596 "list_method": "list_by_panel"
599 "foreign_key": "panel_id",
600 "list_method": "list_by_panel"
662 "PanelPicture": "panel_picture",
664 "class_name": "PanelPicture",
665 "table_name": "panel_pictures",
669 "id_column": "panel_id"
757 "SpeechBalloon": "speech_balloon",
759 "class_name": "SpeechBalloon",
760 "table_name": "speech_balloons",
761 "extend": "classname",
765 "id_column": "panel_id"
771 "foreign_key": "speech_balloon_id",
772 "list_method": "list_by_speech_balloon"
775 "foreign_key": "speech_balloon_id",
776 "list_method": "list_by_speech_balloon"
794 "speech_balloon_template_id": {
839 "Balloon": "balloon",
841 "class_name": "Balloon",
842 "table_name": "balloons",
846 "id_column": "speech_balloon_id"
849 "id_column": "system_picture_id"
862 "speech_balloon_id": {
868 "system_picture_id": {
926 "class_name": "Speech",
927 "table_name": "speeches",
931 "id_column": "speech_balloon_id"
934 "id_column": "writing_format_id"
947 "speech_balloon_id": {
953 "writing_format_id": {
1040 "GroundPicture": "ground_picture",
1042 "class_name": "GroundPicture",
1043 "table_name": "ground_pictures",
1047 "id_column": "panel_id"
1126 "GroundColor": "ground_color",
1128 "class_name": "GroundColor",
1129 "table_name": "ground_colors",
1133 "id_column": "panel_id"
1214 "OriginalPicture": "original_picture",
1215 "original_picture": {
1216 "class_name": "OriginalPicture",
1217 "table_name": "original_pictures",
1221 "id_column": "artist_id"
1226 "foreign_key": "original_picture_id",
1227 "list_method": "list_by_original_picture"
1231 "resource_picture": {
1232 "foreign_key": "original_picture_id",
1233 "list_method": "list_by_original_picture"
1302 "Picture": "picture",
1304 "class_name": "Picture",
1305 "table_name": "pictures",
1309 "id_column": "license_id"
1312 "id_column": "artist_id"
1326 "original_picture_id": {
1415 "ResourcePicture": "resource_picture",
1416 "resource_picture": {
1417 "class_name": "ResourcePicture",
1418 "table_name": "resource_pictures",
1422 "id_column": "license_id"
1425 "id_column": "artist_id"
1439 "original_picture_id": {
1535 "SpeechBalloonTemplate": "speech_balloon_template",
1536 "speech_balloon_template": {
1537 "class_name": "SpeechBalloonTemplate",
1538 "table_name": "speech_balloon_templates",
1542 "id_column": "system_picture_id"
1546 "speech_balloons": {
1547 "foreign_key": "speech_balloon_template_id",
1548 "list_method": "list_by_speech_balloon_template"
1551 "through": "speech_balloons",
1552 "foreign_key": "speech_balloon_template_id",
1553 "list_method": "list_by_speech_balloon_template"
1592 "system_picture_id": {
1613 "WritingFormat": "writing_format",
1615 "class_name": "WritingFormat",
1616 "table_name": "writing_formats",
1620 "id_column": "system_picture_id"
1625 "foreign_key": "writing_format_id",
1626 "list_method": "list_by_writing_format"
1657 "system_picture_id": {
1678 "LicenseGroup": "license_group",
1680 "class_name": "LicenseGroup",
1681 "table_name": "license_groups",
1686 "foreign_key": "license_group_id",
1687 "list_method": "list_by_license_group"
1732 "License": "license",
1734 "class_name": "License",
1735 "table_name": "licenses",
1739 "id_column": "license_group_id"
1742 "id_column": "system_picture_id"
1746 "resource_pictures": {
1747 "foreign_key": "license_id",
1748 "list_method": "list_by_license"
1761 "license_group_id": {
1779 "system_picture_id": {
1796 "credit_pictures": {
1810 "class_name": "Author",
1811 "table_name": "authors",
1816 "foreign_key": "author_id",
1817 "list_method": "list_by_author"
1820 "foreign_key": "author_id",
1821 "list_method": "list_by_author"
1824 "foreign_key": "author_id",
1825 "list_method": "list_by_author"
1828 "foreign_key": "author_id",
1829 "list_method": "list_by_author"
1832 "foreign_key": "author_id",
1833 "list_method": "list_by_author"
1869 "class_name": "Artist",
1870 "table_name": "artists",
1874 "resource_pictures": {
1875 "foreign_key": "artist_id",
1876 "list_method": "list_by_artist"
1910 "SystemPicture": "system_picture",
1912 "class_name": "SystemPicture",
1913 "table_name": "system_pictures",
2165 "speech_balloon_template_id",
2188 "speech_balloon_id",
2189 "writing_format_id",
2214 "speech_balloon_id",
2215 "system_picture_id",
2275 "original_picture": {
2305 "original_picture_id",
2330 "resource_picture": {
2333 "original_picture_id",
2359 "speech_balloon_template": {
2366 "system_picture_id",
2388 "system_picture_id",
2427 "system_picture_id",
2503 "name": "/assets/item.png"
2524 "name": "/assets/item.png",
2543 "name": "/assets/item.png"
2560 "name": "/assets/item.png"
2564 "name": "title_with_t",
2581 "name": "/assets/item.png",
2600 "name": "/assets/item.png"
2621 "name": "/assets/item.png",
2640 "name": "/assets/item.png"
2644 "name": "plain_scenario",
2660 "name": "symbol_option"
2677 "name": "symbol_option"
2681 "name": "plain_scenario",
2697 "name": "symbol_option"
2717 "name": "symbol_option"
2733 "name": "symbol_option"
2764 "original_picture": {
2767 "name": "symbol_option"
2789 "name": "symbol_option"
2803 "resource_picture": {
2806 "name": "symbol_option"
2819 "speech_balloon_template": {
2822 "name": "symbol_option"
2838 "name": "/assets/item.png"
2854 "name": "/assets/item.png"
2860 "type": "url_column",
2874 "name": "/assets/item.png"
2878 "name": "caption_with_group",
2880 "type": "url_column",
2895 "name": "/assets/item.png"
2912 "name": "/assets/item.png"
2929 "name": "symbol_option"
2944 "name": "panel_picture",
2945 "path_name": "panel_pictures",
2949 "name": "speech_balloon",
2950 "path_name": "circle_speech_balloon/speech_balloons",
2957 "name": "ground_picture",
2958 "path_name": "ground_pictures",
2962 "name": "ground_color",
2963 "path_name": "ground_colors",
2972 "column": "caption",
3005 "column": "publish",
3009 "source": "magic_number",
3010 "key": "comic_visible_items",
3024 "column": "author_id",
3042 "PanelPicture": "panel_picture",
3046 "column": "caption",
3080 "path": "panels/size_helper",
3082 "class": "panel_picture_width_tool"
3097 "path": "panels/size_helper",
3099 "class": "panel_picture_height_tool"
3121 "column": "panel_id",
3129 "column": "picture_id",
3134 "path": "panels/popup_helper",
3135 "source": "pictures",
3174 "speech_balloon.id": {
3182 "speech_balloon.panel_id": {
3183 "column": "panel_id",
3190 "speech_balloon.speech_balloon_template_id": {
3191 "column": "speech_balloon_template_id",
3198 "speech_balloon.caption": {
3199 "column": "caption",
3206 "speech_balloon.z": {
3214 "speech_balloon.t": {
3222 "speech_balloon.classname": {
3223 "column": "classname",
3230 "speech_balloon.settings": {
3231 "column": "settings",
3248 "balloon.speech_balloon_id": {
3251 "column": "speech_balloon_id",
3258 "balloon.system_picture_id": {
3261 "column": "system_picture_id",
3280 "path": "panels/tail_angle_helper",
3327 "balloon.settings": {
3330 "column": "settings",
3347 "speech.speech_balloon_id": {
3350 "column": "speech_balloon_id",
3397 "speech.writing_format_id": {
3400 "column": "writing_format_id",
3405 "model": "writing_format",
3406 "method": "enable_list",
3407 "caption": "caption"
3410 "speech.font_size": {
3413 "column": "font_size",
3417 "source": "magic_number",
3418 "key": "speech_font_size_items",
3422 "speech.text_align": {
3425 "column": "text_align",
3429 "source": "magic_number",
3430 "key": "speech_text_align_items"
3446 "column": "content",
3447 "type": "text_area",
3455 "speech.fore_color": {
3458 "column": "fore_color",
3466 "path": "panels/color_helper",
3468 "wrapper": "speech-fore_color-wrap"
3472 "speech.settings": {
3475 "column": "settings",
3484 "CircleSpeechBalloon": "circle_speech_balloon",
3485 "circle_speech_balloon": {
3486 "base": "speech_balloon",
3489 "speech_balloon.caption",
3496 "balloon.speech_balloon_id",
3497 "balloon.system_picture_id",
3499 "speech.writing_format_id",
3501 "speech.text_align",
3504 "speech.fore_color",
3506 "speech.speech_balloon_id",
3512 "speech_balloon.id",
3513 "speech_balloon.panel_id",
3514 "speech_balloon.speech_balloon_template_id",
3515 "speech_balloon.classname",
3518 "speech_balloon.settings"
3521 "PlainSpeechBalloon": "plain_speech_balloon",
3522 "plain_speech_balloon": {
3523 "base": "speech_balloon",
3537 "speech_balloon.caption",
3544 "balloon.speech_balloon_id",
3545 "balloon.system_picture_id",
3547 "speech.writing_format_id",
3549 "speech.text_align",
3552 "speech.fore_color",
3554 "speech.speech_balloon_id",
3560 "speech_balloon.id",
3561 "speech_balloon.panel_id",
3562 "speech_balloon.speech_balloon_template_id",
3563 "speech_balloon.classname",
3566 "speech_balloon.settings"
3569 "SquareSpeechBalloon": "square_speech_balloon",
3570 "square_speech_balloon": {
3571 "base": "speech_balloon",
3585 "speech_balloon.caption",
3592 "balloon.speech_balloon_id",
3593 "balloon.system_picture_id",
3595 "speech.writing_format_id",
3597 "speech.text_align",
3600 "speech.fore_color",
3602 "speech.speech_balloon_id",
3608 "speech_balloon.id",
3609 "speech_balloon.panel_id",
3610 "speech_balloon.speech_balloon_template_id",
3611 "speech_balloon.classname",
3614 "speech_balloon.settings"
3617 "GroundPicture": "ground_picture",
3629 "column": "panel_id",
3637 "column": "picture_id",
3645 "column": "caption",
3657 "source": "magic_number",
3658 "key": "ground_picture_repeat_items",
3708 "GroundColor": "ground_color",
3720 "column": "panel_id",
3728 "column": "caption",
3746 "path": "panels/color_helper",
3748 "wrapper": "ground_color-code-wrap"
3753 "column": "orientation",
3757 "source": "magic_number",
3758 "key": "ground_color_orientation_items",