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": "Panel",
97 "table_name": "panels",
156 "PanelPicture": "panel_picture",
158 "class_name": "PanelPicture",
159 "table_name": "panel_pictures",
243 "SpeechBalloon": "speech_balloon",
245 "class_name": "SpeechBalloon",
246 "table_name": "speech_balloons",
247 "extend": "classname",
262 "speech_balloon_template_id": {
307 "Balloon": "balloon",
309 "class_name": "Balloon",
310 "table_name": "balloons",
319 "speech_balloon_id": {
325 "system_picture_id": {
383 "class_name": "Speech",
384 "table_name": "speeches",
393 "speech_balloon_id": {
399 "writing_format_id": {
486 "GroundPicture": "ground_picture",
488 "class_name": "GroundPicture",
489 "table_name": "ground_pictures",
564 "GroundColor": "ground_color",
566 "class_name": "GroundColor",
567 "table_name": "ground_colors",
644 "WritingFormat": "writing_format",
646 "class_name": "WritingFormat",
647 "table_name": "writing_formats",
674 "system_picture_id": {
698 "name": "panel_picture",
699 "path_name": "panel_pictures",
703 "name": "speech_balloon",
704 "path_name": "circle_speech_balloon/speech_balloons",
711 "name": "ground_picture",
712 "path_name": "ground_pictures",
716 "name": "ground_color",
717 "path_name": "ground_colors",
763 "source": "magic_number",
764 "key": "comic_visible_items",
778 "column": "author_id",
796 "PanelPicture": "panel_picture",
834 "path": "panels/size_helper",
836 "class": "panel_picture_width_tool"
851 "path": "panels/size_helper",
853 "class": "panel_picture_height_tool"
875 "column": "panel_id",
883 "column": "picture_id",
888 "path": "panels/popup_helper",
889 "source": "pictures",
928 "speech_balloon.id": {
936 "speech_balloon.panel_id": {
937 "column": "panel_id",
944 "speech_balloon.speech_balloon_template_id": {
945 "column": "speech_balloon_template_id",
952 "speech_balloon.caption": {
960 "speech_balloon.z": {
968 "speech_balloon.t": {
976 "speech_balloon.classname": {
977 "column": "classname",
984 "speech_balloon.settings": {
985 "column": "settings",
1002 "balloon.speech_balloon_id": {
1005 "column": "speech_balloon_id",
1012 "balloon.system_picture_id": {
1015 "column": "system_picture_id",
1034 "path": "panels/tail_angle_helper",
1081 "balloon.settings": {
1084 "column": "settings",
1101 "speech.speech_balloon_id": {
1104 "column": "speech_balloon_id",
1151 "speech.writing_format_id": {
1154 "column": "writing_format_id",
1159 "model": "writing_format",
1160 "method": "enable_list",
1161 "caption": "caption"
1164 "speech.font_size": {
1167 "column": "font_size",
1171 "source": "magic_number",
1172 "key": "speech_font_size_items",
1176 "speech.text_align": {
1179 "column": "text_align",
1183 "source": "magic_number",
1184 "key": "speech_text_align_items"
1200 "column": "content",
1201 "type": "text_area",
1209 "speech.fore_color": {
1212 "column": "fore_color",
1220 "path": "panels/color_helper",
1222 "wrapper": "speech-fore_color-wrap"
1226 "speech.settings": {
1229 "column": "settings",
1238 "CircleSpeechBalloon": "circle_speech_balloon",
1239 "circle_speech_balloon": {
1240 "base": "speech_balloon",
1243 "speech_balloon.caption",
1250 "balloon.speech_balloon_id",
1251 "balloon.system_picture_id",
1253 "speech.writing_format_id",
1255 "speech.text_align",
1258 "speech.fore_color",
1260 "speech.speech_balloon_id",
1266 "speech_balloon.id",
1267 "speech_balloon.panel_id",
1268 "speech_balloon.speech_balloon_template_id",
1269 "speech_balloon.classname",
1272 "speech_balloon.settings"
1275 "PlainSpeechBalloon": "plain_speech_balloon",
1276 "plain_speech_balloon": {
1277 "base": "speech_balloon",
1291 "speech_balloon.caption",
1298 "balloon.speech_balloon_id",
1299 "balloon.system_picture_id",
1301 "speech.writing_format_id",
1303 "speech.text_align",
1306 "speech.fore_color",
1308 "speech.speech_balloon_id",
1314 "speech_balloon.id",
1315 "speech_balloon.panel_id",
1316 "speech_balloon.speech_balloon_template_id",
1317 "speech_balloon.classname",
1320 "speech_balloon.settings"
1323 "SquareSpeechBalloon": "square_speech_balloon",
1324 "square_speech_balloon": {
1325 "base": "speech_balloon",
1339 "speech_balloon.caption",
1346 "balloon.speech_balloon_id",
1347 "balloon.system_picture_id",
1349 "speech.writing_format_id",
1351 "speech.text_align",
1354 "speech.fore_color",
1356 "speech.speech_balloon_id",
1362 "speech_balloon.id",
1363 "speech_balloon.panel_id",
1364 "speech_balloon.speech_balloon_template_id",
1365 "speech_balloon.classname",
1368 "speech_balloon.settings"
1371 "GroundPicture": "ground_picture",
1383 "column": "panel_id",
1391 "column": "picture_id",
1399 "column": "caption",
1411 "source": "magic_number",
1412 "key": "ground_picture_repeat_items",
1462 "GroundColor": "ground_color",
1474 "column": "panel_id",
1482 "column": "caption",
1500 "path": "panels/color_helper",
1502 "wrapper": "ground_color-code-wrap"
1507 "column": "orientation",
1511 "source": "magic_number",
1512 "key": "ground_color_orientation_items",