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",
153 "PanelPicture": "panel_picture",
155 "class_name": "PanelPicture",
156 "table_name": "panel_pictures",
240 "SpeechBalloon": "speech_balloon",
242 "class_name": "SpeechBalloon",
243 "table_name": "speech_balloons",
244 "extend": "classname",
259 "speech_balloon_template_id": {
304 "Balloon": "balloon",
306 "class_name": "Balloon",
307 "table_name": "balloons",
316 "speech_balloon_id": {
322 "system_picture_id": {
380 "class_name": "Speech",
381 "table_name": "speeches",
390 "speech_balloon_id": {
396 "writing_format_id": {
483 "GroundPicture": "ground_picture",
485 "class_name": "GroundPicture",
486 "table_name": "ground_pictures",
561 "GroundColor": "ground_color",
563 "class_name": "GroundColor",
564 "table_name": "ground_colors",
618 "WritingFormat": "writing_format",
620 "class_name": "WritingFormat",
621 "table_name": "writing_formats",
648 "system_picture_id": {
672 "name": "panel_picture",
673 "path_name": "panel_pictures",
677 "name": "speech_balloon",
678 "path_name": "circle_speech_balloon/speech_balloons",
685 "name": "ground_picture",
686 "path_name": "ground_pictures",
690 "name": "ground_color",
691 "path_name": "ground_colors",
737 "source": "magic_number",
738 "key": "comic_visible_items",
752 "column": "author_id",
770 "PanelPicture": "panel_picture",
808 "path": "panels/size_helper",
810 "class": "panel_picture_width_tool"
825 "path": "panels/size_helper",
827 "class": "panel_picture_height_tool"
849 "column": "panel_id",
857 "column": "picture_id",
897 "speech_balloon.id": {
905 "speech_balloon.panel_id": {
906 "column": "panel_id",
913 "speech_balloon.speech_balloon_template_id": {
914 "column": "speech_balloon_template_id",
921 "speech_balloon.caption": {
929 "speech_balloon.z": {
937 "speech_balloon.t": {
945 "speech_balloon.classname": {
946 "column": "classname",
953 "speech_balloon.settings": {
954 "column": "settings",
971 "balloon.speech_balloon_id": {
974 "column": "speech_balloon_id",
981 "balloon.system_picture_id": {
984 "column": "system_picture_id",
1003 "path": "panels/tail_angle_helper",
1050 "balloon.settings": {
1053 "column": "settings",
1070 "speech.speech_balloon_id": {
1073 "column": "speech_balloon_id",
1120 "speech.writing_format_id": {
1123 "column": "writing_format_id",
1128 "model": "writing_format",
1129 "method": "enable_list",
1130 "caption": "caption"
1133 "speech.font_size": {
1136 "column": "font_size",
1140 "source": "magic_number",
1141 "key": "speech_font_size_items",
1145 "speech.text_align": {
1148 "column": "text_align",
1152 "source": "magic_number",
1153 "key": "speech_text_align_items"
1169 "column": "content",
1170 "type": "text_area",
1178 "speech.fore_color": {
1181 "column": "fore_color",
1189 "path": "panels/color_helper",
1191 "wrapper": "speech-fore_color-wrap"
1195 "speech.settings": {
1198 "column": "settings",
1207 "CircleSpeechBalloon": "circle_speech_balloon",
1208 "circle_speech_balloon": {
1209 "base": "speech_balloon",
1212 "speech_balloon.caption",
1219 "balloon.speech_balloon_id",
1220 "balloon.system_picture_id",
1222 "speech.writing_format_id",
1224 "speech.text_align",
1227 "speech.fore_color",
1229 "speech.speech_balloon_id",
1235 "speech_balloon.id",
1236 "speech_balloon.panel_id",
1237 "speech_balloon.speech_balloon_template_id",
1238 "speech_balloon.classname",
1241 "speech_balloon.settings"
1244 "PlainSpeechBalloon": "plain_speech_balloon",
1245 "plain_speech_balloon": {
1246 "base": "speech_balloon",
1260 "speech_balloon.caption",
1267 "balloon.speech_balloon_id",
1268 "balloon.system_picture_id",
1270 "speech.writing_format_id",
1272 "speech.text_align",
1275 "speech.fore_color",
1277 "speech.speech_balloon_id",
1283 "speech_balloon.id",
1284 "speech_balloon.panel_id",
1285 "speech_balloon.speech_balloon_template_id",
1286 "speech_balloon.classname",
1289 "speech_balloon.settings"
1292 "SquareSpeechBalloon": "square_speech_balloon",
1293 "square_speech_balloon": {
1294 "base": "speech_balloon",
1308 "speech_balloon.caption",
1315 "balloon.speech_balloon_id",
1316 "balloon.system_picture_id",
1318 "speech.writing_format_id",
1320 "speech.text_align",
1323 "speech.fore_color",
1325 "speech.speech_balloon_id",
1331 "speech_balloon.id",
1332 "speech_balloon.panel_id",
1333 "speech_balloon.speech_balloon_template_id",
1334 "speech_balloon.classname",
1337 "speech_balloon.settings"
1340 "GroundPicture": "ground_picture",
1352 "column": "panel_id",
1360 "column": "picture_id",
1368 "column": "caption",
1380 "source": "magic_number",
1381 "key": "ground_picture_repeat_items",
1431 "GroundColor": "ground_color",
1443 "column": "panel_id",
1451 "column": "caption",
1469 "path": "panels/color_helper",
1471 "wrapper": "ground_color-code-wrap"