1 module ApplicationHelper
3 Pettanr::Application.manifest
7 request.protocol + request.host_with_port + filename
16 label.constantize.model_name.human
18 l.first.constantize.human_attribute_name(l.last)
23 def t_select_items(items)
24 items.map {|i| [t(i[0]), i[1]] }
27 def t_selected_item(name, index)
28 t(MagicNumber[name][index][0])
32 tag :img, :src => asset_path('item.png'), :width => 35, :height => 35
35 def icon_tag name, opt = {}
36 title = opt[:object] ? (name.to_s + ' ID:' + opt[:object].id.to_s) : name
37 size = opt[:size] ? opt[:size].to_i : 35
38 tag :img, :src => asset_path(name.to_s.underscore + '.gif'), :width => size, :height => size, :alt => name.to_s + ' Icon', :title => title
41 def author_icon opt = {}
45 def artist_icon opt = {}
49 def scroll_icon opt = {}
53 def scroll_panel_icon opt = {}
54 icon_tag :ScrollPanel, opt
57 def comic_icon opt = {}
61 def story_icon opt = {}
65 def story_sheet_icon opt = {}
66 icon_tag :StorySheet, opt
69 def sheet_icon opt = {}
73 def sheet_panel_icon opt = {}
77 def panel_icon opt = {}
81 def panel_editor_javascript_include_tags
82 WritingFormat.enable_list().map {|wf|
83 # javascript_include_tag wf.engine_name
84 javascript_include_tag wf.engine_name + "/application"
86 SpeechBalloonTemplate.enable_list().map {|sbt|
87 stylesheet_link_tag sbt.engine_name + "/application"
89 SpeechBalloonTemplate.enable_list().map {|sbt|
90 javascript_include_tag sbt.engine_name + "/application"
100 "class_name": "Scroll",
101 "table_name": "scrolls",
105 "id_column": "author_id"
110 "foreign_key": "scroll_id",
111 "list_method": "list_by_scroll"
114 "through": "scroll_panels",
115 "foreign_key": "scroll_id",
116 "list_method": "list_by_scroll"
145 "type": "magic_number",
146 "key": "scroll_visible_items"
171 "ScrollPanel": "scroll_panel",
173 "class_name": "ScrollPanel",
174 "table_name": "scroll_panels",
178 "id_column": "panel_id"
181 "id_column": "scroll_id"
233 "class_name": "Comic",
234 "table_name": "comics",
238 "id_column": "author_id"
243 "foreign_key": "comic_id",
244 "list_method": "list_by_comic"
247 "has_many_through": {}
274 "type": "magic_number",
275 "key": "comic_visible_items"
302 "class_name": "Story",
303 "table_name": "stories",
307 "id_column": "comic_id"
312 "foreign_key": "story_id",
313 "list_method": "list_by_story"
316 "through": "story_sheets",
317 "foreign_key": "story_id",
318 "list_method": "list_by_story"
359 "type": "magic_number",
360 "key": "story_visible_items"
374 "name": "title_with_t"
378 "StorySheet": "story_sheet",
380 "class_name": "StorySheet",
381 "table_name": "story_sheets",
385 "id_column": "story_id"
388 "id_column": "sheet_id"
438 "class_name": "Sheet",
439 "table_name": "sheets",
443 "id_column": "author_id"
448 "foreign_key": "story_id",
449 "list_method": "list_by_sheet"
452 "through": "story_sheets",
453 "foreign_key": "sheet_id",
454 "list_method": "list_by_sheet"
457 "foreign_key": "sheet_id",
458 "list_method": "list_by_sheet"
461 "through": "sheet_panels",
462 "foreign_key": "sheet_id",
463 "list_method": "list_by_sheet"
500 "type": "magic_number",
501 "key": "sheet_visible_items"
526 "SheetPanel": "sheet_panel",
528 "class_name": "SheetPanel",
529 "table_name": "sheet_panels",
533 "id_column": "sheet_id"
536 "id_column": "panel_id"
607 "class_name": "Panel",
608 "table_name": "panels",
612 "id_column": "author_id"
617 "foreign_key": "panel_id",
618 "list_method": "list_by_panel"
621 "through": "scroll_panels",
622 "foreign_key": "panel_id",
623 "list_method": "list_by_panel"
626 "foreign_key": "panel_id",
627 "list_method": "list_by_panel"
630 "through": "sheet_panels",
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"
647 "foreign_key": "panel_id",
648 "list_method": "list_by_panel"
695 "type": "magic_number",
696 "key": "panel_visible_items"
717 "name": "plain_scenario"
721 "PanelPicture": "panel_picture",
723 "class_name": "PanelPicture",
724 "table_name": "panel_pictures",
728 "id_column": "panel_id"
816 "SpeechBalloon": "speech_balloon",
818 "class_name": "SpeechBalloon",
819 "table_name": "speech_balloons",
820 "extend": "classname",
824 "id_column": "panel_id"
830 "foreign_key": "speech_balloon_id",
831 "list_method": "list_by_speech_balloon"
834 "foreign_key": "speech_balloon_id",
835 "list_method": "list_by_speech_balloon"
853 "speech_balloon_template_id": {
901 "name": "plain_scenario"
905 "Balloon": "balloon",
907 "class_name": "Balloon",
908 "table_name": "balloons",
912 "id_column": "speech_balloon_id"
915 "id_column": "system_picture_id"
928 "speech_balloon_id": {
934 "system_picture_id": {
992 "class_name": "Speech",
993 "table_name": "speeches",
997 "id_column": "speech_balloon_id"
1000 "id_column": "writing_format_id"
1013 "speech_balloon_id": {
1019 "writing_format_id": {
1023 "model": "writing_format",
1024 "method": "enable_list",
1025 "caption": "caption"
1044 "type": "magic_number",
1045 "key": "speech_font_size_items"
1059 "type": "magic_number",
1060 "key": "speech_text_align_items"
1120 "GroundPicture": "ground_picture",
1122 "class_name": "GroundPicture",
1123 "table_name": "ground_pictures",
1127 "id_column": "panel_id"
1168 "type": "magic_number",
1169 "key": "ground_picture_repeat_items"
1210 "GroundColor": "ground_color",
1212 "class_name": "GroundColor",
1213 "table_name": "ground_colors",
1217 "id_column": "panel_id"
1262 "type": "magic_number",
1263 "key": "ground_color_orientation_items"
1302 "OriginalPicture": "original_picture",
1303 "original_picture": {
1304 "class_name": "OriginalPicture",
1305 "table_name": "original_pictures",
1309 "id_column": "artist_id"
1314 "foreign_key": "original_picture_id",
1315 "list_method": "list_by_original_picture"
1319 "resource_picture": {
1320 "foreign_key": "original_picture_id",
1321 "list_method": "list_by_original_picture"
1390 "Picture": "picture",
1392 "class_name": "Picture",
1393 "table_name": "pictures",
1397 "id_column": "license_id"
1400 "id_column": "artist_id"
1414 "original_picture_id": {
1503 "ResourcePicture": "resource_picture",
1504 "resource_picture": {
1505 "class_name": "ResourcePicture",
1506 "table_name": "resource_pictures",
1510 "id_column": "license_id"
1513 "id_column": "artist_id"
1527 "original_picture_id": {
1623 "SpeechBalloonTemplate": "speech_balloon_template",
1624 "speech_balloon_template": {
1625 "class_name": "SpeechBalloonTemplate",
1626 "table_name": "speech_balloon_templates",
1630 "id_column": "system_picture_id"
1634 "speech_balloons": {
1635 "foreign_key": "speech_balloon_template_id",
1636 "list_method": "list_by_speech_balloon_template"
1639 "through": "speech_balloons",
1640 "foreign_key": "speech_balloon_template_id",
1641 "list_method": "list_by_speech_balloon_template"
1680 "system_picture_id": {
1701 "method": "enable_list",
1708 "WritingFormat": "writing_format",
1710 "class_name": "WritingFormat",
1711 "table_name": "writing_formats",
1715 "id_column": "system_picture_id"
1720 "foreign_key": "writing_format_id",
1721 "list_method": "list_by_writing_format"
1752 "system_picture_id": {
1773 "method": "enable_list",
1780 "LicenseGroup": "license_group",
1782 "class_name": "LicenseGroup",
1783 "table_name": "license_groups",
1788 "foreign_key": "license_group_id",
1789 "list_method": "list_by_license_group"
1841 "License": "license",
1843 "class_name": "License",
1844 "table_name": "licenses",
1848 "id_column": "license_group_id"
1851 "id_column": "system_picture_id"
1855 "resource_pictures": {
1856 "foreign_key": "license_id",
1857 "list_method": "list_by_license"
1870 "license_group_id": {
1888 "system_picture_id": {
1905 "credit_pictures": {
1919 "class_name": "Author",
1920 "table_name": "authors",
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"
1941 "foreign_key": "author_id",
1942 "list_method": "list_by_author"
1985 "class_name": "Artist",
1986 "table_name": "artists",
1990 "resource_pictures": {
1991 "foreign_key": "artist_id",
1992 "list_method": "list_by_artist"
2033 "SystemPicture": "system_picture",
2035 "class_name": "SystemPicture",
2036 "table_name": "system_pictures",
2288 "speech_balloon_template_id",
2311 "speech_balloon_id",
2312 "writing_format_id",
2337 "speech_balloon_id",
2338 "system_picture_id",
2398 "original_picture": {
2428 "original_picture_id",
2453 "resource_picture": {
2456 "original_picture_id",
2482 "speech_balloon_template": {
2489 "system_picture_id",
2511 "system_picture_id",
2550 "system_picture_id",
2626 "name": "/assets/item.png"
2647 "name": "/assets/item.png",
2666 "name": "/assets/item.png"
2683 "name": "/assets/item.png"
2687 "name": "title_with_t",
2704 "name": "/assets/item.png",
2723 "name": "/assets/item.png"
2744 "name": "/assets/item.png",
2763 "name": "/assets/item.png"
2767 "name": "plain_scenario",
2783 "name": "symbol_option"
2800 "name": "symbol_option"
2804 "name": "plain_scenario",
2820 "name": "symbol_option"
2840 "name": "symbol_option"
2856 "name": "symbol_option"
2887 "original_picture": {
2890 "name": "symbol_option"
2912 "name": "symbol_option"
2926 "resource_picture": {
2929 "name": "symbol_option"
2942 "speech_balloon_template": {
2945 "name": "symbol_option"
2961 "name": "/assets/item.png"
2977 "name": "/assets/item.png"
2983 "type": "url_column",
2997 "name": "/assets/item.png"
3001 "name": "caption_with_group",
3003 "type": "url_column",
3018 "name": "/assets/item.png"
3035 "name": "/assets/item.png"
3052 "name": "symbol_option"
3067 "name": "panel_picture",
3068 "path_name": "panel_pictures",
3072 "name": "speech_balloon",
3073 "path_name": "circle_speech_balloon/speech_balloons",
3080 "name": "ground_picture",
3081 "path_name": "ground_pictures",
3085 "name": "ground_color",
3086 "path_name": "ground_colors",
3095 "column": "caption",
3128 "column": "publish",
3132 "source": "magic_number",
3133 "key": "comic_visible_items",
3147 "column": "author_id",
3165 "PanelPicture": "panel_picture",
3169 "column": "caption",
3203 "path": "panels/size_helper",
3205 "class": "panel_picture_width_tool"
3220 "path": "panels/size_helper",
3222 "class": "panel_picture_height_tool"
3244 "column": "panel_id",
3252 "column": "picture_id",
3257 "path": "panels/popup_helper",
3258 "source": "pictures",
3297 "speech_balloon.id": {
3305 "speech_balloon.panel_id": {
3306 "column": "panel_id",
3313 "speech_balloon.speech_balloon_template_id": {
3314 "column": "speech_balloon_template_id",
3321 "speech_balloon.caption": {
3322 "column": "caption",
3329 "speech_balloon.z": {
3337 "speech_balloon.t": {
3345 "speech_balloon.classname": {
3346 "column": "classname",
3353 "speech_balloon.settings": {
3354 "column": "settings",
3371 "balloon.speech_balloon_id": {
3374 "column": "speech_balloon_id",
3381 "balloon.system_picture_id": {
3384 "column": "system_picture_id",
3403 "path": "panels/tail_angle_helper",
3450 "balloon.settings": {
3453 "column": "settings",
3470 "speech.speech_balloon_id": {
3473 "column": "speech_balloon_id",
3520 "speech.writing_format_id": {
3523 "column": "writing_format_id",
3528 "model": "writing_format",
3529 "method": "enable_list",
3530 "caption": "caption"
3533 "speech.font_size": {
3536 "column": "font_size",
3540 "source": "magic_number",
3541 "key": "speech_font_size_items",
3545 "speech.text_align": {
3548 "column": "text_align",
3552 "source": "magic_number",
3553 "key": "speech_text_align_items"
3569 "column": "content",
3570 "type": "text_area",
3578 "speech.fore_color": {
3581 "column": "fore_color",
3589 "path": "panels/color_helper",
3591 "wrapper": "speech-fore_color-wrap"
3595 "speech.settings": {
3598 "column": "settings",
3607 "CircleSpeechBalloon": "circle_speech_balloon",
3608 "circle_speech_balloon": {
3609 "base": "speech_balloon",
3612 "speech_balloon.caption",
3619 "balloon.speech_balloon_id",
3620 "balloon.system_picture_id",
3622 "speech.writing_format_id",
3624 "speech.text_align",
3627 "speech.fore_color",
3629 "speech.speech_balloon_id",
3635 "speech_balloon.id",
3636 "speech_balloon.panel_id",
3637 "speech_balloon.speech_balloon_template_id",
3638 "speech_balloon.classname",
3641 "speech_balloon.settings"
3644 "PlainSpeechBalloon": "plain_speech_balloon",
3645 "plain_speech_balloon": {
3646 "base": "speech_balloon",
3660 "speech_balloon.caption",
3667 "balloon.speech_balloon_id",
3668 "balloon.system_picture_id",
3670 "speech.writing_format_id",
3672 "speech.text_align",
3675 "speech.fore_color",
3677 "speech.speech_balloon_id",
3683 "speech_balloon.id",
3684 "speech_balloon.panel_id",
3685 "speech_balloon.speech_balloon_template_id",
3686 "speech_balloon.classname",
3689 "speech_balloon.settings"
3692 "SquareSpeechBalloon": "square_speech_balloon",
3693 "square_speech_balloon": {
3694 "base": "speech_balloon",
3708 "speech_balloon.caption",
3715 "balloon.speech_balloon_id",
3716 "balloon.system_picture_id",
3718 "speech.writing_format_id",
3720 "speech.text_align",
3723 "speech.fore_color",
3725 "speech.speech_balloon_id",
3731 "speech_balloon.id",
3732 "speech_balloon.panel_id",
3733 "speech_balloon.speech_balloon_template_id",
3734 "speech_balloon.classname",
3737 "speech_balloon.settings"
3740 "GroundPicture": "ground_picture",
3752 "column": "panel_id",
3760 "column": "picture_id",
3768 "column": "caption",
3780 "source": "magic_number",
3781 "key": "ground_picture_repeat_items",
3831 "GroundColor": "ground_color",
3843 "column": "panel_id",
3851 "column": "caption",
3869 "path": "panels/color_helper",
3871 "wrapper": "ground_color-code-wrap"
3876 "column": "orientation",
3880 "source": "magic_number",
3881 "key": "ground_color_orientation_items",