From 6fb8bc9e0e2b4ee9840f42e2915598db46b9a4b8 Mon Sep 17 00:00:00 2001 From: yasushiito Date: Mon, 16 Dec 2013 14:02:40 +0900 Subject: [PATCH] t#: --- app/assets/javascripts/application.js | 3 +- .../javascripts/configurations.js.coffee.erb | 3249 -------- .../javascripts/configurations2.js.coffee.erb | 2035 ----- app/assets/javascripts/panels.js.coffee | 18 +- app/controllers/application_controller.rb | 18 + app/controllers/artists_controller.rb | 21 +- app/controllers/authors_controller.rb | 19 +- app/controllers/comics_controller.rb | 25 +- app/controllers/ground_colors_controller.rb | 26 +- app/controllers/ground_pictures_controller.rb | 32 +- app/controllers/home_controller.rb | 197 +- app/controllers/licenses_controller.rb | 30 +- app/controllers/original_pictures_controller.rb | 35 +- app/controllers/panel_pictures_controller.rb | 49 +- app/controllers/panels_controller.rb | 34 +- app/controllers/pictures_controller.rb | 22 +- app/controllers/resource_pictures_controller.rb | 27 +- app/controllers/scroll_panels_controller.rb | 47 +- app/controllers/scrolls_controller.rb | 33 +- app/controllers/sheet_panels_controller.rb | 49 +- app/controllers/sheets_controller.rb | 33 +- app/controllers/stories_controller.rb | 33 +- app/controllers/story_sheets_controller.rb | 41 +- app/helpers/application_helper.rb | 8 +- app/models/artist.rb | 2 +- app/models/ground_color.rb | 12 +- app/models/ground_picture.rb | 12 +- app/models/license_group.rb | 21 + app/models/original_picture.rb | 8 +- app/models/panel.rb | 17 +- app/models/panel_picture.rb | 12 +- app/models/picture.rb | 4 +- app/models/scroll_panel.rb | 18 +- app/models/sheet.rb | 16 +- app/models/sheet_panel.rb | 22 +- app/models/speech_balloon.rb | 4 +- app/models/speech_balloon_template.rb | 15 +- app/models/story.rb | 12 +- app/models/story_sheet.rb | 18 +- app/models/system_picture.rb | 2 +- app/models/writing_format.rb | 10 +- .../_allform.html.erb | 2 +- .../original_picture_license_groups/_form.html.erb | 2 +- app/views/original_pictures/_form.html.erb | 2 +- app/views/scrolls/show.html.erb | 8 +- app/views/sheets/_body.html.erb | 2 +- config/routes.rb | 215 +- lib/content.rb | 10 +- lib/item.rb | 8 + lib/manifest/controller.rb | 1 + lib/manifest/filer.rb | 11 +- lib/manifest/list.rb | 76 +- lib/manifest/manifest.rb | 9 +- lib/manifest/profiler.rb | 2 + lib/tasks/licenses.rake | 10 +- lib/tasks/speech_balloons.rake | 10 +- public/manifest.json | 8729 ++++++++++---------- 57 files changed, 5062 insertions(+), 10324 deletions(-) delete mode 100644 app/assets/javascripts/configurations.js.coffee.erb delete mode 100644 app/assets/javascripts/configurations2.js.coffee.erb diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index d80f0c0a..1e408d0a 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -13,8 +13,7 @@ //= require textchange //= require underscore //= require backbone -//= require configurations -//= require configurations2 +//= require_directory ./manifest/work //= require pettanr_editor //= require pettanr_sheeter //= require writing_formats diff --git a/app/assets/javascripts/configurations.js.coffee.erb b/app/assets/javascripts/configurations.js.coffee.erb deleted file mode 100644 index f8781b3d..00000000 --- a/app/assets/javascripts/configurations.js.coffee.erb +++ /dev/null @@ -1,3249 +0,0 @@ -#マニフェスト -@configurations = { - controllers: { - scroll: { - model_name: 'scroll', - actions: { - index: { - type: 'list', - list: { - list_name: 'public_list', - }, - }, - scroll_panels: { - type: 'list', - list: { - list_name: 'scroll_panels', - }, - }, - panels: { - type: 'list', - list: { - list_name: 'panels', - }, - }, - by_author: { - type: 'list', - list: { - list_name: 'by_author', - }, - }, - by_panel: { - type: 'list', - list: { - list_name: 'by_panel', - }, - }, - show: { - type: 'show', - name: 'show', - }, - }, - }, - scroll_panel: { - model_name: 'scroll_panel', - actions: { - index: { - type: 'list', - list: { - list_name: 'public_list', - - }, - }, - by_panel: { - type: 'list', - list: { - list_name: 'by_panel', - }, - }, - by_scroll: { - type: 'list', - list: { - list_name: 'by_scroll', - }, - }, - }, - }, - comic: { - model_name: 'comic', - actions: { - index: { - type: 'list', - list: { - list_name: 'public_list', - - }, - }, - stories: { - type: 'list', - list: { - list_name: 'stories', - }, - }, - by_author: { - type: 'list', - list: { - list_name: 'by_author', - }, - }, - }, - }, - story: { - model_name: 'story', - actions: { - index: { - type: 'list', - list: { - list_name: 'public_list', - - }, - }, - story_sheets: { - type: 'list', - list: { - list_name: 'story_sheets', - }, - }, - sheets: { - type: 'list', - list: { - list_name: 'sheets', - }, - }, - by_sheet: { - type: 'list', - list: { - list_name: 'by_sheet', - }, - }, - by_author: { - type: 'list', - list: { - list_name: 'by_author', - }, - }, - }, - }, - story_sheet: { - model_name: 'story_sheet', - actions: { - index: { - type: 'list', - list: { - list_name: 'public_list', - - }, - }, - by_story: { - type: 'list', - list: { - list_name: 'by_story', - }, - }, - by_sheet: { - type: 'list', - list: { - list_name: 'by_sheet', - }, - }, - }, - }, - sheet: { - model_name: 'sheet', - actions: { - index: { - type: 'list', - list: { - list_name: 'public_list', - - }, - }, - story_sheets: { - type: 'list', - list: { - list_name: 'story_sheets', - }, - }, - stories: { - type: 'list', - list: { - list_name: 'stories', - }, - }, - sheet_panels: { - type: 'list', - list: { - list_name: 'sheet_panels', - }, - }, - panels: { - type: 'list', - list: { - list_name: 'panels', - }, - }, - by_story: { - type: 'list', - list: { - list_name: 'by_story', - }, - }, - by_panel: { - type: 'list', - list: { - list_name: 'by_panel', - }, - }, - by_author: { - type: 'list', - list: { - list_name: 'by_author', - }, - }, - }, - }, - sheet_panel: { - model_name: 'sheet_panel', - actions: { - index: { - type: 'list', - list: { - list_name: 'public_list', - - }, - }, - by_sheet: { - type: 'list', - list: { - list_name: 'by_sheet', - }, - }, - by_panel: { - type: 'list', - list: { - list_name: 'by_panel', - }, - }, - }, - }, - panel: { - model_name: 'panel', - actions: { - index: { - type: 'list', - list: { - list_name: 'public_list', - - }, - }, - by_scroll: { - type: 'list', - list: { - list_name: 'by_scroll', - }, - }, - by_sheet: { - type: 'list', - list: { - list_name: 'by_sheet', - }, - }, - by_author: { - type: 'list', - list: { - list_name: 'by_author', - }, - }, - }, - }, - panel_picture: { - model_name: 'panel_picture', - actions: { - index: { - type: 'list', - list: { - list_name: 'public_list', - - }, - }, - }, - }, - speech_balloon: { - model_name: 'speech_balloon', - actions: { - index: { - type: 'list', - list: { - list_name: 'public_list', - - }, - }, - }, - }, - speech: { - model_name: 'speech', - actions: { - index: { - type: 'list', - list: { - list_name: 'public_list', - - }, - }, - }, - }, - balloon: { - model_name: 'balloon', - actions: { - index: { - type: 'list', - list: { - list_name: 'public_list', - - }, - }, - }, - }, - ground_picture: { - model_name: 'ground_picture', - actions: { - index: { - type: 'list', - list: { - list_name: 'public_list', - - }, - }, - }, - }, - ground_color: { - model_name: 'ground_color', - actions: { - index: { - type: 'list', - list: { - list_name: 'public_list', - - }, - }, - }, - }, - original_picture: { - model_name: 'original_picture', - actions: { - index: { - type: 'list', - list: { - list_name: 'private_list', - - }, - }, - }, - }, - picture: { - }, - resource_picture: { - model_name: 'resource_picture', - actions: { - index: { - type: 'list', - list: { - list_name: 'public_list', - - }, - }, - by_license: { - type: 'list', - list: { - list_name: 'by_license', - }, - }, - by_artist: { - type: 'list', - list: { - list_name: 'by_artist', - }, - }, - }, - }, - speech_balloon_template: { - model_name: 'speech_balloon_template', - actions: { - index: { - type: 'list', - list: { - list_name: 'public_list', - - }, - }, - }, - }, - writing_format: { - model_name: 'writing_format', - actions: { - index: { - type: 'list', - list: { - list_name: 'public_list', - - }, - }, - }, - }, - license_group: { - model_name: 'license_group', - actions: { - index: { - type: 'list', - list: { - list_name: 'public_list', - - }, - }, - }, - }, - license: { - model_name: 'license', - actions: { - index: { - type: 'list', - list: { - list_name: 'public_list', - - }, - }, - }, - }, - author: { - model_name: 'author', - actions: { - index: { - type: 'list', - list: { - list_name: 'public_list', - - }, - }, - }, - }, - artist: { - model_name: '', - actions: { - index: { - type: 'list', - list: { - list_name: 'public_list', - - }, - }, - }, - }, - system_picture: { - model_name: 'system_picture', - actions: { - index: { - type: 'list', - list: { - list_name: 'public_list', - - }, - }, - }, - }, - home: { - actions: { - scrolls: { - item_name: 'scroll', - type: 'list', - list: { - list_name: 'private_list', - - }, - }, - scroll_panel: { - item_name: 'scroll_panel', - type: 'list', - list: { - list_name: 'private_list', - - }, - }, - comics: { - item_name: 'comic', - type: 'list', - list: { - list_name: 'private_list', - - }, - }, - stories: { - item_name: 'story', - type: 'list', - list: { - list_name: 'private_list', - - }, - }, - story_sheets: { - item_name: 'story_sheet', - type: 'list', - list: { - list_name: 'private_list', - - }, - }, - sheets: { - item_name: 'sheet', - type: 'list', - list: { - list_name: 'private_list', - - }, - }, - sheet_panels: { - item_name: 'sheet_panel', - type: 'list', - list: { - list_name: 'private_list', - - }, - }, - panels: { - item_name: 'panel', - type: 'list', - list: { - list_name: 'private_list', - - }, - }, - panel_pictures: { - item_name: 'panel_picture', - type: 'list', - list: { - list_name: 'private_list', - - }, - }, - speech_balloons: { - item_name: 'speech_balloon', - type: 'list', - list: { - list_name: 'private_list', - - }, - }, - speeches { - item_name: 'speech', - type: 'list', - list: { - list_name: 'private_list', - - }, - }, - balloons: { - item_name: 'balloon', - type: 'list', - list: { - list_name: 'private_list', - - }, - }, - ground_pictures: { - item_name: 'ground_picture', - type: 'list', - list: { - list_name: 'private_list', - - }, - }, - ground_colors: { - item_name: 'ground_color', - type: 'list', - list: { - list_name: 'private_list', - - }, - }, - original_pictures: { - item_name: 'original_picture', - type: 'list', - list: { - list_name: 'private_list', - - }, - }, - resource_pictures: { - item_name: 'resource_picture', - type: 'list', - list: { - list_name: 'private_list', - - }, - }, - }, - }, - }, - lists: { - scroll: { - default_page_size: 25, - max_page_size: 100, - lists: { - public_list: { - type: 'public', - }, - private_list: { - type: 'private', - }, - scroll_panels: { - type: 'has_many', - association_name: 'scroll_panels', - }, - panels: { - type: 'has_many', - association_name: 'panels', - }, - by_author: { - type: 'filter', - from: 'author', - filter_key: 'author_id', - }, - by_panel: { - type: 'through_filter', - from: 'panel', - through: 'scroll_panels', - filter_key: 'panel_id', - }, - }, - }, - scroll_panel: { - default_page_size: 20, - lists: { - public_list: { - type: 'public', - }, - private_list: { - type: 'private', - }, - by_scroll: { - type: 'filter', - from: 'scroll', - filter_key: 'scroll_id', - }, - by_panel: { - type: 'filter', - from: 'panel', - filter_key: 'panel_id', - }, - }, - }, - comic: { - default_page_size: 20, - lists: { - public_list: { - type: 'public', - }, - private_list: { - type: 'private', - }, - stories: { - type: 'has_many', - association_name: 'stories', - }, - by_author: { - type: 'filter', - from: 'author', - filter_key: 'author_id', - }, - }, - }, - story: { - default_page_size: 20, - lists: { - public_list: { - type: 'public', - }, - private_list: { - type: 'private', - }, - story_sheets: { - type: 'has_many', - association_name: 'story_sheets', - }, - sheets: { - type: 'has_many', - association_name: 'sheets', - }, - by_comic: { - type: 'filter', - from: 'comic', - filter_key: 'comic_id', - }, - by_sheet: { - type: 'through_filter', - from: 'sheet', - through: 'sheet_panels', - filter_key: 'sheet_id', - }, - }, - }, - story_sheet: { - default_page_size: 20, - lists: { - public_list: { - type: 'public', - }, - private_list: { - type: 'private', - }, - by_story: { - type: 'filter', - from: 'story', - filter_key: 'story_id', - }, - by_sheet: { - type: 'filter', - with: 'story', - from: 'sheet', - filter_key: 'sheet_id', - }, - }, - }, - sheet: { - default_page_size: 20, - lists: { - public_list: { - type: 'public', - }, - private_list: { - type: 'private', - }, - story_sheets: { - type: 'has_many', - association_name: 'story_sheets', - }, - stories: { - type: 'has_many', - association_name: 'stories', - }, - sheet_panels: { - type: 'has_many', - association_name: 'sheet_panels', - }, - panels: { - type: 'has_many', - association_name: 'panels', - }, - by_story: { - type: 'through_filter', - from: 'story', - through: 'story_sheets', - filter_key: 'story_id', - }, - by_panel: { - type: 'through_filter', - from: 'panel', - through: 'sheet_panels', - filter_key: 'panel_id', - }, - by_author: { - type: 'filter', - from: 'author', - filter_key: 'author_id', - }, - }, - }, - sheet_panel: { - default_page_size: 20, - lists: { - public_list: { - type: 'public', - }, - private_list: { - type: 'private', - }, - by_sheet: { - type: 'filter', - association_name: 'sheet_panels', - from: 'sheet', - filter_key: 'sheet_id', - }, - by_panel: { - type: 'filter', - from: 'panel', - filter_key: 'panel_id', - }, - }, - }, - panel: { - default_page_size: 20, - lists: { - public_list: { - type: 'public', - }, - scroll_panels: { - type: 'has_many', - association_name: 'scroll_panels', - }, - scrolls: { - type: 'has_many', - association_name: 'scrolls', - }, - sheet_panels: { - type: 'has_many', - association_name: 'sheet_panels', - }, - sheets: { - type: 'has_many', - association_name: 'sheets', - }, - by_scroll: { - type: 'through_filter', - from: 'scroll', - through: 'scroll_panels', - filter_key: 'scroll_id', - }, - by_sheet: { - type: 'through_filter', - from: 'sheet', - through: 'sheet_panels', - filter_key: 'sheet_id', - }, - by_author: { - type: 'filter', - from: 'author', - filter_key: 'author_id', - }, - }, - }, - panel_picture: { - default_page_size: 20, - lists: { - public_list: { - type: 'public', - }, - }, - }, - speech_balloon: { - default_page_size: 20, - lists: { - public_list: { - type: 'public', - }, - }, - }, - speech: { - default_page_size: 20, - lists: { - public_list: { - type: 'public', - }, - }, - }, - balloon: { - default_page_size: 20, - lists: { - public_list: { - type: 'public', - }, - }, - }, - ground_picture: { - default_page_size: 20, - lists: { - public_list: { - type: 'public', - }, - }, - }, - ground_color: { - default_page_size: 20, - lists: { - public_list: { - type: 'public', - }, - }, - }, - original_picture: { - default_page_size: 20, - lists: { - private_list: { - type: 'private', - }, - }, - }, - picture: { - }, - resource_picture: { - default_page_size: 20, - lists: { - public_list: { - type: 'public', - }, - by_license: { - type: 'filter', - from: 'license', - filter_key: 'license_id', - }, - by_artist: { - type: 'filter', - from: 'artist', - filter_key: 'artist_id', - }, - }, - }, - speech_balloon_template: { - default_page_size: 20, - lists: { - public_list: { - type: 'public', - }, - }, - }, - writing_format: { - default_page_size: 20, - lists: { - public_list: { - type: 'public', - }, - }, - }, - license_group: { - default_page_size: 20, - lists: { - public_list: { - type: 'public', - }, - }, - }, - license: { - default_page_size: 20, - lists: { - public_list: { - type: 'public', - }, - }, - }, - author: { - default_page_size: 20, - lists: { - public_list: { - type: 'public', - }, - }, - }, - artist: { - default_page_size: 20, - lists: { - public_list: { - type: 'public', - }, - }, - }, - system_picture: { - default_page_size: 20, - lists: { - public_list: { - type: 'public', - }, - }, - }, - }, - system_resources: { - licenses: { - pettanr_creative_commons_v30_licenses: 'PettanrCreativeCommonsV30Licenses', - pettanr_pettan_commons_v01_licenses: 'PettanrPettanCommonsV01Licenses', - pettanr_pettan_protected_v01_licenses: 'PettanrPettanProtectedV01Licenses', - pettanr_pettan_public_v01_licenses: 'PettanrPettanPublicV01Licenses', - pettanr_public_domain_v01_licenses: 'PettanrPublicDomainV01Licenses', - pettanr_unknown_v01_licenses: 'PettanrUnknownV01Licenses', - }, - elements: { - PanelPicture: 'panel_pictures', - SpeechBalloon: 'speech_balloons', - GroundPicture: 'ground_pictures', - GroundColor: 'ground_colors', - }, - speech_balloon_templates: { - CircleSpeechBalloon: 'circle_speech_balloon', - PlainSpeechBalloon: 'plain_speech_balloon', - SquareSpeechBalloon: 'square_speech_balloon', - # TestSpeechBalloon: 'test_speech_balloon', - }, - writing_formats: { - SimpleFormat: 'pettanr_simple_format', - }, - }, - magic_numbers: { - run_mode: 1, - thumbnail_width: 64, - thumbnail_height: 64, - profile: { - users: { - caption: "ペンギン王国", - url: "http://localhost:3001/", - description: "ペンギン王国はペンギン素材を豊富に用意したペンギンマニアのサイトです。", - }, - admins: { - caption: "site name for admin", - url: "http://your.site.url/admins/", - description: "admin register", - }, - demand_users: { - caption: "provider name", - url: "http://your.site.url/demanders/", - description: "provider description", - }, - }, - provider_sources: [ - 'http://sourceforge.jp/projects/pettanr/wiki/ProviderSource/attach/provider_source.json' - ], - }, - select_items: { - provider_status_status_items: [ - ['select_items.provider_status.status.waiting', 0], - ['select_items.provider_status.status.receiving', 1], - ], - demander_status_status_items: [ - ['select_items.demander_status.status.waiting', 0], - ['select_items.demander_status.status.rejected', 1], - ['select_items.demander_status.status.requesting', 2], - ['select_items.demander_status.status.approved', 3], - ], - scroll_visible_items: [ - ['select_items.scroll.visible.private', 0], - ['select_items.scroll.visible.public', 1], - ], - comic_visible_items: [ - ['select_items.comic.visible.private', 0], - ['select_items.comic.visible.public', 1], - ], - story_visible_items: [ - ['select_items.story.visible.private', 0], - ['select_items.story.visible.public', 1], - ], - sheet_visible_items: [ - ['select_items.sheet.visible.private', 0], - ['select_items.sheet.visible.public', 1], - ], - panel_visible_items: [ - ['select_items.panel.visible.private', 0], - ['select_items.panel.visible.public', 1], - ], - ground_picture_repeat_items: [ - ['select_items.ground_pictures.repeat.repeat', 0], - ['select_items.ground_pictures.repeat.repeat-x', 1], - ['select_items.ground_pictures.repeat.repeat-y', 2], - ['select_items.ground_pictures.repeat.no-repeat', 3], - ], - ground_color_orientation_items: [ - ['select_items.ground_color.orientation.horizontal', 0], - ['select_items.ground_color.orientation.vertical', 1], - ], - speech_font_size_items: [ - ['select_items.speeches.font_size.ultra_small', 0.2], - ['select_items.speeches.font_size.very_small', 0.4], - ['select_items.speeches.font_size.small', 0.6], - ['select_items.speeches.font_size.semi_small', 0.8], - ['select_items.speeches.font_size.normal', 1.0], - ['select_items.speeches.font_size.semi_large', 1.5], - ['select_items.speeches.font_size.large', 2.0], - ['select_items.speeches.font_size.very_large', 3.5], - ['select_items.speeches.font_size.ultra_large', 5.0], - ], - speech_text_align_items: [ - ['select_items.speeches.text_align.none', 0], - ['select_items.speeches.text_align.left', 1], - ['select_items.speeches.text_align.right', 2], - ['select_items.speeches.text_align.center', 3], - ], - }, - locals: { - profilers: { - scroll: { - lists: { - 'scroll_panels.by_scroll': { - model_name: 'scroll_panel', - list_name: 'by_scroll', - }, - 'panels.by_scroll': { - model_name: 'panel', - list_name: 'by_scroll', - }, - }, - columns: [ - 'id', - 'title', - 'description', - 'visible', - 'author_id', - 'created_at', - 'updated_at', - ], - associations: { - belongs_to: [ - 'author', - ], - has_many: [ - 'scroll_panels.by_scroll', - 'panels.by_scroll' - ], - }, - }, - scroll_panel: { - lists: { - }, - columns: [ - 'id', - 'scroll_id', - 'panel_id', - 't', - 'author_id', - 'created_at', - 'updated_at', - ], - associations: { - belongs_to: [ - 'scroll', - 'panel' - ], - has_many: [ - ], - }, - }, - comic: { - lists: { - 'stories.by_comic': { - model_name: 'story', - list_name: 'by_comic', - }, - }, - columns: [ - 'id', - 'title', - 'description', - 'visible', - 'author_id', - 'created_at', - 'updated_at', - ], - associations: { - belongs_to: [ - 'author', - ], - has_many: [ - 'stories.by_comic', - ], - }, - }, - story: { - lists: { - 'story_sheets.by_story': { - model_name: 'story_sheet', - list_name: 'by_story', - }, - 'sheets.by_story': { - model_name: 'sheet', - list_name: 'by_sheet', - }, - }, - columns: [ - 'id', - 'comic_id', - 'title', - 'description', - 't', - 'visible', - 'created_at', - 'updated_at', - ], - associations: { - belongs_to: [ - 'comic', - ], - has_many: [ - 'story_sheets.by_story', - 'sheets.by_story' - ], - }, - }, - story_sheet: { - lists: { - }, - columns: [ - 'id', - 'story_id', - 'sheet_id', - 't', - 'author_id', - 'created_at', - 'updated_at', - ], - associations: { - belongs_to: [ - 'story', - 'sheet', - ], - has_many: [ - ], - }, - }, - sheet: { - lists: { - 'story_sheets.by_sheet': { - model_name: 'story_sheet', - list_name: 'by_sheet', - }, - 'stories.by_sheet': { - model_name: 'story', - list_name: 'by_sheet', - }, - 'sheet_panels.by_sheet': { - model_name: 'sheet_panel', - list_name: 'by_sheet', - }, - 'panels.by_sheet': { - model_name: 'panel', - list_name: 'by_sheet', - }, - }, - columns: [ - 'id', - 'caption', - 'width', - 'height', - 'visible', - 'author_id', - 'created_at', - 'updated_at', - ], - associations: { - belongs_to: [ - 'author', - ], - has_many: [ - 'story_sheets.by_sheet', - 'stories.by_sheet', - 'sheet_panels.by_sheet' - 'panels.by_sheet' - ], - }, - }, - sheet_panel: { - lists: { - }, - columns: [ - 'id', - 'sheet_id', - 'panel_id', - 'x', - 'y', - 'z', - 't', - 'author_id', - 'created_at', - 'updated_at', - ], - associations: { - belongs_to: [ - 'sheet', - 'panel', - ], - has_many: [ - ], - }, - }, - panel: { - lists: { - 'scroll_panels.by_panel': { - model_name: 'scroll_panel', - list_name: 'by_panel', - }, - 'scrolls.by_panel': { - model_name: 'scroll', - list_name: 'by_panel', - }, - 'sheet_panels.by_panel': { - model_name: 'sheet_panel', - list_name: 'by_panel', - }, - 'sheets.by_panel': { - model_name: 'sheet', - list_name: 'by_panel', - }, - 'panel_pictures.by_panel': { - model_name: 'panel_picture', - list_name: 'by_panel', - }, - 'speech_balloons.by_panel': { - model_name: 'speech_balloon', - list_name: 'by_panel', - }, - 'ground_pictures.by_panel': { - model_name: 'ground_picture', - list_name: 'by_panel', - }, - 'ground_colors.by_panel': { - model_name: 'ground_color', - list_name: 'by_panel', - }, - }, - columns: [ - 'id', - 'width', - 'height', - 'border', - 'caption', - 'publish', - 'author_id', - 'created_at', - 'updated_at', - ], - associations: { - belongs_to: [ - 'author', - ], - has_many: [ - 'scroll_panels.by_panel', - 'scrolls.by_panel', - 'sheet_panels.by_panel', - 'sheets.by_panel', - 'panel_pictures.by_panel', - 'speech_balloons.by_panel', - 'ground_pictures.by_panel', - 'ground_colors.by_panel', - ], - }, - }, - panel_picture: { - lists: { - 'scroll_panels.by_scroll': { - model_name: 'scroll_panel', - list_name: 'by_scroll', - }, - 'panels.by_scroll': { - model_name: 'panel', - list_name: 'by_scroll', - }, - }, - columns: [ - 'id', - 'panel_id', - 'picture_id', - 'caption', - 'x', - 'y', - 'width', - 'height', - 'link', - 'z', - 't', - 'created_at', - 'updated_at', - ], - associations: { - belongs_to: [ - 'panel', - ], - has_many: [ - ], - }, - }, - speech_balloon: { - lists: { - 'scroll_panels.by_scroll': { - model_name: 'scroll_panel', - list_name: 'by_scroll', - }, - 'panels.by_scroll': { - model_name: 'panel', - list_name: 'by_scroll', - }, - }, - columns: [ - 'id', - 'panel_id', - 'speech_balloon_template_id', - 'classname', - 'z', - 't', - 'settings', - 'caption', - 'created_at', - 'updated_at', - ], - associations: { - belongs_to: [ - 'panel', - ], - has_many: [ - ], - has_one: [ - 'balloon', - 'speech', - ], - }, - }, - speech: { - lists: { - 'scroll_panels.by_scroll': { - model_name: 'scroll_panel', - list_name: 'by_scroll', - }, - 'panels.by_scroll': { - model_name: 'panel', - list_name: 'by_scroll', - }, - }, - columns: [ - 'id', - 'speech_balloon_id', - 'writing_format_id', - 'content', - 'font_size', - 'text_align', - 'fore_color', - 'x', - 'y', - 'width', - 'height', - 'quotes', - 'settings', - 'created_at', - 'updated_at', - ], - associations: { - belongs_to: [ - 'speech_balloon', - 'writing_format', - ], - has_many: [ - ], - }, - }, - balloon: { - lists: { - 'scroll_panels.by_scroll': { - model_name: 'scroll_panel', - list_name: 'by_scroll', - }, - 'panels.by_scroll': { - model_name: 'panel', - list_name: 'by_scroll', - }, - }, - columns: [ - 'id', - 'speech_balloon_id', - 'system_picture_id', - 'x', - 'y', - 'width', - 'height', - 'r', - 'settings', - 'created_at', - 'updated_at', - ], - associations: { - belongs_to: [ - 'speech_balloon', - 'system_picture', - ], - has_many: [ - ], - }, - }, - ground_picture: { - lists: { - 'scroll_panels.by_scroll': { - model_name: 'scroll_panel', - list_name: 'by_scroll', - }, - 'panels.by_scroll': { - model_name: 'panel', - list_name: 'by_scroll', - }, - }, - columns: [ - 'id', - 'panel_id', - 'picture_id', - 'caption', - 'repeat', - 'x', - 'y', - 'z', - 't', - 'created_at', - 'updated_at', - ], - associations: { - belongs_to: [ - 'panel', - ], - has_many: [ - ], - }, - }, - ground_color: { - lists: { - 'scroll_panels.by_scroll': { - model_name: 'scroll_panel', - list_name: 'by_scroll', - }, - 'panels.by_scroll': { - model_name: 'panel', - list_name: 'by_scroll', - }, - }, - columns: [ - 'id', - 'panel_id', - 'caption', - 'code', - 'orientation', - 'xy', - 'wh', - 'z', - 't', - 'created_at', - 'updated_at', - ], - associations: { - belongs_to: [ - 'panel', - ], - has_many: [ - ], - }, - }, - original_picture: { - lists: { - 'scroll_panels.by_scroll': { - model_name: 'scroll_panel', - list_name: 'by_scroll', - }, - 'panels.by_scroll': { - model_name: 'panel', - list_name: 'by_scroll', - }, - }, - columns: [ - 'id', - 'ext', - 'width', - 'height', - 'filesize', - 'artist_id', - 'md5', - 'uploaded_at', - 'published_at', - 'stopped_at', - 'created_at', - 'updated_at', - ], - associations: { - belongs_to: [ - 'artist', - ], - has_many: [ - 'pictures', - ], - has_one: [ - 'resource_picture', - ], - }, - }, - picture: { - lists: { - 'scroll_panels.by_scroll': { - model_name: 'scroll_panel', - list_name: 'by_scroll', - }, - 'panels.by_scroll': { - model_name: 'panel', - list_name: 'by_scroll', - }, - }, - columns: [ - 'id', - 'original_picture_id', - 'revision', - 'ext', - 'width', - 'height', - 'filesize', - 'artist_id', - 'license_id', - 'md5', - 'artist_name', - 'credit', - 'settings', - 'classname', - 'created_at', - 'updated_at', - ], - associations: { - belongs_to: [ - 'license', - 'artist', - ], - has_many: [ - ], - has_one: [ - ], - }, - }, - resource_picture: { - lists: { - 'scroll_panels.by_scroll': { - model_name: 'scroll_panel', - list_name: 'by_scroll', - }, - 'panels.by_scroll': { - model_name: 'panel', - list_name: 'by_scroll', - }, - }, - columns: [ - 'id', - 'original_picture_id', - 'revision', - 'ext', - 'width', - 'height', - 'filesize', - 'artist_id', - 'license_id', - 'md5', - 'artist_name', - 'credit', - 'settings', - 'picture_id', - 'classname', - 'created_at', - 'updated_at', - ], - associations: { - belongs_to: [ - 'license', - 'artist', - ], - has_many: [ - ], - has_one: [ - ], - }, - }, - speech_balloon_template: { - lists: { - 'scroll_panels.by_scroll': { - model_name: 'scroll_panel', - list_name: 'by_scroll', - }, - 'panels.by_scroll': { - model_name: 'panel', - list_name: 'by_scroll', - }, - }, - columns: [ - 'id', - 'name', - 'classname', - 'caption', - 't', - 'system_picture_id', - 'settings', - 'created_at', - 'updated_at', - ], - associations: { - belongs_to: [ - 'system_picture', - ], - has_many: [ - 'speech_balloons', - 'panels', - ], - has_one: [ - ], - }, - }, - writing_format: { - lists: { - 'scroll_panels.by_scroll': { - model_name: 'scroll_panel', - list_name: 'by_scroll', - }, - 'panels.by_scroll': { - model_name: 'panel', - list_name: 'by_scroll', - }, - }, - columns: [ - 'id', - 'name', - 'classname', - 'caption', - 'system_picture_id', - 'settings', - 'created_at', - 'updated_at', - ], - associations: { - belongs_to: [ - 'system_picture', - ], - has_many: [ - 'speeches', - ], - has_one: [ - ], - }, - }, - license_group: { - lists: { - 'scroll_panels.by_scroll': { - model_name: 'scroll_panel', - list_name: 'by_scroll', - }, - 'panels.by_scroll': { - model_name: 'panel', - list_name: 'by_scroll', - }, - }, - columns: [ - 'id', - 'name', - 'classname', - 'caption', - 'url', - 'created_at', - 'updated_at', - ], - associations: { - belongs_to: [ - ], - has_many: [ - 'licenses', - ], - has_one: [ - ], - }, - }, - license: { - lists: { - 'scroll_panels.by_scroll': { - model_name: 'scroll_panel', - list_name: 'by_scroll', - }, - 'panels.by_scroll': { - model_name: 'panel', - list_name: 'by_scroll', - }, - }, - columns: [ - 'id', - 'license_group_id', - 'name', - 'caption', - 'system_picture_id', - 'url', - 'settings', - 'credit_pictures', - 'created_at', - 'updated_at', - ], - associations: { - belongs_to: [ - 'license_group', - 'system_picture', - ], - has_many: [ - 'resource_pictures', - ], - has_one: [ - ], - }, - }, - author: { - lists: { - 'scroll_panels.by_scroll': { - model_name: 'scroll_panel', - list_name: 'by_scroll', - }, - 'panels.by_scroll': { - model_name: 'panel', - list_name: 'by_scroll', - }, - }, - columns: [ - 'id', - 'name', - 'user_id', - 'created_at', - 'updated_at', - ], - associations: { - belongs_to: [ - ], - has_many: [ - 'scrolls', - 'comics', - 'stories', - 'sheets', - 'panels', - ], - has_one: [ - ], - }, - }, - artist: { - lists: { - 'scroll_panels.by_scroll': { - model_name: 'scroll_panel', - list_name: 'by_scroll', - }, - 'panels.by_scroll': { - model_name: 'panel', - list_name: 'by_scroll', - }, - }, - columns: [ - 'id', - 'name', - 'author_id', - 'created_at', - 'updated_at', - ], - associations: { - belongs_to: [ - ], - has_many: [ - 'resource_pictures', - ], - has_one: [ - ], - }, - }, - system_picture: { - lists: { - 'scroll_panels.by_scroll': { - model_name: 'scroll_panel', - list_name: 'by_scroll', - }, - 'panels.by_scroll': { - model_name: 'panel', - list_name: 'by_scroll', - }, - }, - columns: [ - 'id', - 'ext', - 'width', - 'height', - 'filesize', - 'md5', - 'created_at', - 'updated_at', - ], - associations: { - belongs_to: [ - ], - has_many: [ - ], - has_one: [ - ], - }, - }, - }, - filers: { - scroll: { - symbol: { - type: 'image', - name: '<%= asset_path('item.png') %>', - }, - caption: { - type: 'column', - name: 'title', - link: { - type: 'action' - name: 'play', - }, - }, - summary: { - type: 'template', - name: 'summary', - }, - edit: { - type: 'default', - }, - }, - scroll_panel: { - symbol: { - type: 'image', - name: '<%= asset_path('item.png') %>', - link: { - type: 'none' - }, - }, - caption: { - type: 'none', - }, - summary: { - type: 'template', - name: 'summary', - }, - edit: { - type: 'none' - }, - }, - comic: { - symbol: { - type: 'image', - name: '<%= asset_path('item.png') %>', - }, - caption: { - type: 'column', - name: 'title', - }, - summary: { - type: 'template', - name: 'summary', - }, - edit: { - type: 'default', - }, - }, - story: { - symbol: { - type: 'image', - name: '<%= asset_path('item.png') %>', - }, - caption: { - type: 'method', - name: 'title_with_t', - link: { - type: 'action' - name: 'play', - }, - }, - summary: { - type: 'template', - name: 'summary', - }, - edit: { - type: 'default', - }, - }, - story_sheet: { - symbol: { - type: 'image', - name: '<%= asset_path('item.png') %>', - link: { - type: 'none' - }, - }, - caption: { - type: 'none', - }, - summary: { - type: 'template', - name: 'summary', - }, - edit: { - type: 'none' - }, - }, - sheet: { - symbol: { - type: 'image', - name: '<%= asset_path('item.png') %>', - }, - caption: { - type: 'column', - name: 'caption', - link: { - type: 'action' - name: 'play', - }, - }, - summary: { - type: 'template', - name: 'summary', - }, - edit: { - type: 'default', - }, - }, - sheet_panel: { - symbol: { - type: 'image', - name: '<%= asset_path('item.png') %>', - link: { - type: 'none' - }, - }, - caption: { - type: 'none', - }, - summary: { - type: 'template', - name: 'summary', - }, - edit: { - type: 'none' - }, - }, - panel: { - symbol: { - type: 'image', - name: '<%= asset_path('item.png') %>', - }, - caption: { - type: 'method', - name: 'plain_scenario', - link: { - type: 'none' - }, - }, - summary: { - type: 'template', - name: 'summary', - }, - edit: { - type: 'default', - }, - }, - panel_picture: { - symbol: { - type: 'picture', - name: 'symbol_option', - }, - caption: { - type: 'column', - name: 'caption', - }, - summary: { - type: 'template', - name: 'summary', - }, - edit: { - type: 'none', - }, - }, - speech_balloon: { - symbol: { - type: 'picture', - name: 'symbol_option', - }, - caption: { - type: 'method', - name: 'plain_scenario', - link: { - type: 'none' - }, - }, - summary: { - type: 'template', - name: 'summary', - }, - edit: { - type: 'none', - }, - }, - speech: { - symbol: { - type: 'picture', - name: 'symbol_option', - }, - caption: { - type: 'column', - name: 'content', - link: { - type: 'none' - }, - }, - summary: { - type: 'template', - name: 'summary', - }, - edit: { - type: 'none', - }, - }, - balloon: { - symbol: { - type: 'picture', - name: 'symbol_option', - }, - caption: { - type: 'none', - }, - summary: { - type: 'template', - name: 'summary', - }, - edit: { - type: 'none', - }, - }, - ground_picture: { - symbol: { - type: 'picture', - name: 'symbol_option', - }, - caption: { - type: 'column', - name: 'caption', - }, - summary: { - type: 'template', - name: 'summary', - }, - edit: { - type: 'none', - }, - }, - ground_color: { - symbol: { - type: 'template', - name: 'symbol', - }, - caption: { - type: 'column', - name: 'caption', - }, - summary: { - type: 'template', - name: 'summary', - }, - edit: { - type: 'none', - }, - }, - original_picture: { - symbol: { - type: 'picture', - name: 'symbol_option', - }, - caption: { - type: 'method', - name: 'revision', - link: { - type: 'action' - name: 'history', - }, - }, - summary: { - type: 'template', - name: 'summary', - }, - edit: { - type: 'template', - name: 'publish', - }, - }, - picture: { - symbol: { - type: 'picture', - name: 'symbol_option', - }, - caption: { - type: 'column', - name: 'revision', - }, - summary: { - type: 'template', - name: 'summary', - }, - edit: { - type: 'none', - }, - }, - resource_picture: { - symbol: { - type: 'picture', - name: 'symbol_option', - }, - caption: { - type: 'none', - }, - summary: { - type: 'template', - name: 'summary', - }, - edit: { - type: 'none', - }, - }, - speech_balloon_template: { - symbol: { - type: 'picture', - name: 'symbol_option', - }, - caption: { - type: 'column', - name: 'caption', - }, - summary: { - type: 'none', - }, - edit: { - type: 'none', - }, - }, - writing_format: { - symbol: { - type: 'image', - name: '<%= asset_path('item.png') %>', - }, - caption: { - type: 'column', - name: 'caption', - }, - summary: { - type: 'none', - }, - edit: { - type: 'none', - }, - }, - license_group: { - symbol: { - type: 'image', - name: '<%= asset_path('item.png') %>', - }, - caption: { - type: 'column', - name: 'caption', - link: { - type: 'url_column' - name: 'url', - }, - }, - summary: { - type: 'none', - }, - edit: { - type: 'none', - }, - }, - license: { - symbol: { - type: 'image', - name: '<%= asset_path('item.png') %>', - }, - caption: { - type: 'method', - name: 'caption_with_group', - link: { - type: 'url_column' - name: 'url', - }, - }, - summary: { - type: 'template', - name: 'summary', - }, - edit: { - type: 'none', - }, - }, - author: { - symbol: { - type: 'image', - name: '<%= asset_path('item.png') %>', - }, - caption: { - type: 'column', - name: 'name', - }, - summary: { - type: 'template', - name: 'summary', - }, - edit: { - type: 'account', - }, - }, - artist: { - symbol: { - type: 'image', - name: '<%= asset_path('item.png') %>', - }, - caption: { - type: 'column', - name: 'name', - }, - summary: { - type: 'template', - name: 'summary', - }, - edit: { - type: 'account', - }, - }, - system_picture: { - symbol: { - type: 'picture', - name: 'symbol_option', - }, - caption: { - type: 'none', - }, - summary: { - type: 'none', - }, - edit: { - type: 'none', - }, - }, - }, - elements: [ - { - name: 'panel_picture', - path_name: 'panel_pictures', - parts: [] - }, - { - name: 'speech_balloon', - path_name: 'circle_speech_balloon/speech_balloons', - parts: ['balloon', 'speech'] - }, - { - name: 'ground_picture', - path_name: 'ground_pictures', - parts: [] - }, - { - name: 'ground_color', - path_name: 'ground_colors', - parts: [] - }, - ], - forms: { - Panel: 'panel', - panel: { - attributes: { - caption: { - column: 'caption', - type: 'text', - label: { - }, - options: { - row_break: true - } - }, - width: { - column: 'width', - type: 'number', - label: { - }, - options: { - size: 5, - }, - }, - height: { - column: 'height', - type: 'number', - label: { - }, - options: { - size: 5, - row_break: true - }, - }, - border: { - column: 'border', - type: 'number', - label: { - }, - options: { - size: 5, - }, - }, - publish: { - column: 'publish', - type: 'select', - label: { - }, - options: { - source: 'magic_number', - key: 'comic_visible_items', - size: 5, - row_break: true - } - }, - id: { - column: 'id', - type: 'hidden', - label: { - type: 'hidden' - }, - options: { - } - }, - author_id: { - column: 'author_id', - type: 'hidden', - label: { - type: 'hidden' - }, - options: { - } - }, - }, - fields: [ - 'caption', - 'width', - 'height', - 'border', - 'publish', - 'id', - 'author_id', - ] - }, - PanelPicture: 'panel_picture', - panel_picture: { - attributes: { - caption: { - column: 'caption', - type: 'text', - label: { - }, - options: { - row_break: true - } - }, - x: { - column: 'x', - type: 'number', - label: { - }, - options: { - size: 5, - } - }, - y: { - column: 'y', - type: 'number', - label: { - }, - options: { - size: 5, - row_break: true - } - }, - width: { - column: 'width', - type: 'number', - label: { - }, - options: { - size: 5, - row_break: true - }, - helpers: { - size: { - path: 'panels/size_helper', - options: { - class: 'panel_picture_width_tool', - } - } - }, - }, - height: { - column: 'height', - type: 'number', - label: { - }, - options: { - size: 5, - row_break: true - }, - helpers: { - size: { - path: 'panels/size_helper', - options: { - class: 'panel_picture_height_tool', - } - } - }, - }, - link: { - column: 'link', - type: 'text', - label: { - }, - options: { - row_break: true - } - }, - id: { - column: 'id', - type: 'hidden', - label: { - type: 'hidden' - }, - options: { - } - }, - panel_id: { - column: 'panel_id', - type: 'hidden', - label: { - type: 'hidden' - }, - options: { - } - }, - picture_id: { - column: 'picture_id', - type: 'hidden', - label: { - }, - helpers: { - popup: { - path: 'panels/popup_helper', - source: 'pictures', - options: { - } - } - } - options: { - } - }, - z: { - column: 'z', - type: 'hidden', - label: { - type: 'hidden' - }, - options: { - } - }, - t: { - column: 't', - type: 'hidden', - label: { - type: 'hidden' - }, - options: { - } - }, - }, - fields: [ - 'caption', - 'x', - 'y', - 'width', - 'height', - 'link', - 'id', - 'panel_id', - 'picture_id', - 'z', - 't', - ] - }, - speech_balloon: { - attributes: { - 'speech_balloon.id': { - column: 'id', - type: 'hidden', - label: { - type: 'hidden' - }, - options: { - } - }, - 'speech_balloon.panel_id': { - column: 'panel_id', - type: 'hidden', - label: { - type: 'hidden' - }, - options: { - } - }, - 'speech_balloon.speech_balloon_template_id': { - column: 'speech_balloon_template_id', - type: 'hidden', - label: { - type: 'hidden' - }, - options: { - } - }, - 'speech_balloon.caption': { - column: 'caption', - type: 'text', - label: { - }, - options: { - row_break: true - } - }, - 'speech_balloon.z': { - column: 'z', - type: 'hidden', - label: { - type: 'hidden' - }, - options: { - } - }, - 'speech_balloon.t': { - column: 't', - type: 'hidden', - label: { - type: 'hidden' - }, - options: { - } - }, - 'speech_balloon.classname': { - column: 'classname', - type: 'hidden', - label: { - type: 'hidden' - }, - options: { - } - }, - 'speech_balloon.settings': { - column: 'settings', - type: 'hidden', - label: { - type: 'hidden' - }, - options: { - } - }, - 'balloon.id': { - model: 'balloon', - part: 'balloon', - column: 'id', - type: 'hidden', - label: { - type: 'hidden' - }, - options: { - } - }, - 'balloon.speech_balloon_id': { - model: 'balloon', - part: 'balloon', - column: 'speech_balloon_id', - type: 'hidden', - label: { - type: 'hidden' - }, - options: { - } - }, - 'balloon.system_picture_id': { - model: 'balloon', - part: 'balloon', - column: 'system_picture_id', - type: 'hidden', - label: { - type: 'hidden' - }, - options: { - } - }, - 'balloon.r': { - model: 'balloon', - part: 'balloon', - column: 'r', - type: 'number', - label: { - }, - options: { - size: 5, - row_break: true - }, - helpers: { - tail_angle: { - path: 'panels/tail_angle_helper', - options: { - } - } - } - }, - 'balloon.x': { - model: 'balloon', - part: 'balloon', - column: 'x', - type: 'number', - label: { - }, - options: { - size: 5, - } - }, - 'balloon.y': { - model: 'balloon', - part: 'balloon', - column: 'y', - type: 'number', - label: { - }, - options: { - size: 5, - row_break: true - } - }, - 'balloon.width': { - model: 'balloon', - part: 'balloon', - column: 'width', - type: 'number', - label: { - }, - options: { - size: 5, - } - }, - 'balloon.height': { - model: 'balloon', - part: 'balloon', - column: 'height', - type: 'number', - label: { - }, - options: { - size: 5, - row_break: true - } - }, - 'balloon.settings': { - model: 'balloon', - part: 'balloon', - column: 'settings', - type: 'hidden', - label: { - type: 'hidden' - }, - options: { - } - }, - 'speech.id': { - model: 'speech', - part: 'speech', - column: 'id', - type: 'hidden', - label: { - type: 'hidden' - }, - options: { - } - }, - 'speech.speech_balloon_id': { - model: 'speech', - part: 'speech', - column: 'speech_balloon_id', - type: 'hidden', - label: { - type: 'hidden' - }, - options: { - } - }, - 'speech.x': { - model: 'speech', - part: 'speech', - column: 'x', - type: 'hidden', - label: { - type: 'hidden' - }, - options: { - } - }, - 'speech.y': { - model: 'speech', - part: 'speech', - column: 'y', - type: 'hidden', - label: { - type: 'hidden' - }, - options: { - } - }, - 'speech.width': { - model: 'speech', - part: 'speech', - column: 'width', - type: 'hidden', - label: { - type: 'hidden' - }, - options: { - } - }, - 'speech.height': { - model: 'speech', - part: 'speech', - column: 'height', - type: 'hidden', - label: { - type: 'hidden' - }, - options: { - } - }, - 'speech.writing_format_id': { - model: 'speech', - part: 'speech', - column: 'writing_format_id', - type: 'select', - label: { - }, - options: { - source: 'model', - model: 'writing_format', - method: 'enable_list', - caption: 'caption' - } - }, - 'speech.font_size': { - model: 'speech', - part: 'speech', - column: 'font_size', - type: 'select', - label: { - }, - options: { - source: 'magic_number', - key: 'speech_font_size_items', - row_break: true - } - }, - 'speech.text_align': { - model: 'speech', - part: 'speech', - column: 'text_align', - type: 'select', - label: { - }, - options: { - source: 'magic_number', - key: 'speech_text_align_items', - } - }, - 'speech.quotes': { - model: 'speech', - part: 'speech', - column: 'quotes', - type: 'text', - label: { - }, - options: { - size: 5, - } - }, - 'speech.content': { - model: 'speech', - part: 'speech', - column: 'content', - type: 'text_area', - label: { - row_break: true - }, - options: { - size: '45x5', - } - }, - 'speech.fore_color': { - model: 'speech', - part: 'speech', - column: 'fore_color', - type: 'hidden', - label: { - row_break: true - }, - options: { - }, - helpers: { - color: { - path: 'panels/color_helper', - options: { - }, - wrapper: 'speech-fore_color-wrap' - } - } - }, - 'speech.settings': { - model: 'speech', - part: 'speech', - column: 'settings', - type: 'hidden', - label: { - type: 'hidden' - }, - options: { - } - }, - }, - }, - CircleSpeechBalloon: 'circle_speech_balloon', - circle_speech_balloon: { - base: 'speech_balloon', - attributes: { - }, - fields: [ - 'speech_balloon.caption', - 'balloon.r', - 'balloon.x', - 'balloon.y', - 'balloon.width', - 'balloon.height', - 'balloon.id', - 'balloon.speech_balloon_id', - 'balloon.system_picture_id', - 'balloon.settings', - 'speech.writing_format_id', - 'speech.font_size', - 'speech.text_align', - 'speech.quotes', - 'speech.content', - 'speech.fore_color', - 'speech.id', - 'speech.speech_balloon_id', - 'speech.x', - 'speech.y', - 'speech.width', - 'speech.height', - 'speech.settings', - 'speech_balloon.id', - 'speech_balloon.panel_id', - 'speech_balloon.speech_balloon_template_id', - 'speech_balloon.classname', - 'speech_balloon.z', - 'speech_balloon.t', - 'speech_balloon.settings', - ] - }, - PlainSpeechBalloon: 'plain_speech_balloon', - plain_speech_balloon: { - base: 'speech_balloon', - attributes: { - 'balloon.r': { - model: 'balloon', - part: 'balloon', - column: 'r', - type: 'hidden', - label: { - type: 'hidden' - }, - options: { - }, - }, - }, - fields: [ - 'speech_balloon.caption', - 'balloon.r', - 'balloon.x', - 'balloon.y', - 'balloon.width', - 'balloon.height', - 'balloon.id', - 'balloon.speech_balloon_id', - 'balloon.system_picture_id', - 'balloon.settings', - 'speech.writing_format_id', - 'speech.font_size', - 'speech.text_align', - 'speech.quotes', - 'speech.content', - 'speech.fore_color', - 'speech.id', - 'speech.speech_balloon_id', - 'speech.x', - 'speech.y', - 'speech.width', - 'speech.height', - 'speech.settings', - 'speech_balloon.id', - 'speech_balloon.panel_id', - 'speech_balloon.speech_balloon_template_id', - 'speech_balloon.classname', - 'speech_balloon.z', - 'speech_balloon.t', - 'speech_balloon.settings', - ] - }, - SquareSpeechBalloon: 'square_speech_balloon', - square_speech_balloon: { - base: 'speech_balloon', - attributes: { - 'balloon.r': { - model: 'balloon', - part: 'balloon', - column: 'r', - type: 'hidden', - label: { - type: 'hidden' - }, - options: { - }, - }, - }, - fields: [ - 'speech_balloon.caption', - 'balloon.r', - 'balloon.x', - 'balloon.y', - 'balloon.width', - 'balloon.height', - 'balloon.id', - 'balloon.speech_balloon_id', - 'balloon.system_picture_id', - 'balloon.settings', - 'speech.writing_format_id', - 'speech.font_size', - 'speech.text_align', - 'speech.quotes', - 'speech.content', - 'speech.fore_color', - 'speech.id', - 'speech.speech_balloon_id', - 'speech.x', - 'speech.y', - 'speech.width', - 'speech.height', - 'speech.settings', - 'speech_balloon.id', - 'speech_balloon.panel_id', - 'speech_balloon.speech_balloon_template_id', - 'speech_balloon.classname', - 'speech_balloon.z', - 'speech_balloon.t', - 'speech_balloon.settings', - ] - }, - GroundPicture: 'ground_picture', - ground_picture: { - attributes: { - id: { - column: 'id', - type: 'hidden', - label: { - type: 'hidden' - }, - options: { - } - }, - panel_id: { - column: 'panel_id', - type: 'hidden', - label: { - type: 'hidden' - }, - options: { - } - }, - picture_id: { - column: 'picture_id', - type: 'hidden', - label: { - type: 'hidden' - }, - options: { - } - }, - caption: { - column: 'caption', - type: 'text', - label: { - }, - options: { - row_break: true - } - }, - repeat: { - column: 'repeat', - type: 'select', - label: { - }, - options: { - source: 'magic_number', - key: 'ground_picture_repeat_items', - row_break: true - } - }, - x: { - column: 'x', - type: 'number', - label: { - }, - options: { - size: 5, - } - }, - y: { - column: 'y', - type: 'number', - label: { - }, - options: { - size: 5, - row_break: true - } - }, - z: { - column: 'z', - type: 'hidden', - label: { - type: 'hidden' - }, - options: { - } - }, - t: { - column: 't', - type: 'hidden', - label: { - type: 'hidden' - }, - options: { - } - }, - }, - fields: [ - 'caption', - 'repeat', - 'x', - 'y', - 'z', - 't', - 'id', - 'panel_id', - 'picture_id', - ] - }, - GroundColor: 'ground_color', - ground_color: { - attributes: { - id: { - column: 'id', - type: 'hidden', - label: { - type: 'hidden' - }, - options: { - } - }, - panel_id: { - column: 'panel_id', - type: 'hidden', - label: { - type: 'hidden' - }, - options: { - } - }, - caption: { - column: 'caption', - type: 'text', - label: { - }, - options: { - row_break: true - } - }, - code: { - column: 'code', - type: 'hidden', - label: { - row_break: true - }, - options: { - row_break: true - } - helpers: { - color: { - path: 'panels/color_helper', - options: { - }, - wrapper: 'ground_color-code-wrap' - } - }, - }, - orientation: { - column: 'orientation', - type: 'select', - label: { - }, - options: { - source: 'magic_number', - key: 'ground_color_orientation_items', - row_break: true - } - }, - xy: { - column: 'xy', - type: 'number', - label: { - }, - options: { - size: 5, - } - }, - wh: { - column: 'wh', - type: 'number', - label: { - }, - options: { - size: 5, - row_break: true - } - }, - z: { - column: 'z', - type: 'hidden', - label: { - type: 'hidden' - }, - options: { - } - }, - t: { - column: 't', - type: 'hidden', - label: { - type: 'hidden' - }, - options: { - } - }, - }, - fields: [ - 'id', - 'panel_id', - 'caption', - 'code', - 'orientation', - 'xy', - 'wh', - 'z', - 't', - ] - } - }, - }, - locales: { - ja: { - } - }, -} - -@repeat_texts = ['repeat', 'repeat-x', 'repeat-y', 'no-repeat'] - -@text_align_texts = ['left', 'left', 'right', 'center'] - diff --git a/app/assets/javascripts/configurations2.js.coffee.erb b/app/assets/javascripts/configurations2.js.coffee.erb deleted file mode 100644 index a8ed0853..00000000 --- a/app/assets/javascripts/configurations2.js.coffee.erb +++ /dev/null @@ -1,2035 +0,0 @@ -#マニフェスト -@configurations2 = { - models: { - Scroll: 'scroll', - scroll: { - class_name: 'Scroll', - table_name: 'scrolls', - associations: { - belongs_to: { - author: { - id_column: 'author_id' - }, - }, - has_many: { - scroll_panels: { - foreign_key: 'scroll_id', - model: 'scroll_panel', - }, - panels: { - through: 'scroll_panel', - foreign_key: 'scroll_id' - model: 'panel', - }, - }, - }, - attributes: { - id: { - type: 'number', - primary_key: 1, - rules : { - number: true, - } - }, - title: { - type: 'text', - rules : { - required: true, - } - }, - description: { - type: 'text', - rules : { - } - }, - visible: { - type: 'number', - rules : { - required: true, - number: true, - }, - source: { - type: 'magic_number', - key: 'scroll_visible_items', - }, - }, - author_id: { - type: 'number', - rules : { - required: true, - number: true, - }, - }, - created_at: { - type: 'datetime', - }, - updated_at: { - type: 'datetime', - } - }, - select: { - list: { - name: 'public' - }, - caption: { - type: 'column', - name: 'title' - }, - }, - }, - ScrollPanel: 'scroll_panel', - scroll_panel: { - class_name: 'ScrollPanel', - table_name: 'scroll_panels', - associations: { - belongs_to: { - panel: { - id_column: 'panel_id' - }, - scroll: { - id_column: 'scroll_id' - }, - }, - has_many: { - }, - }, - attributes: { - id: { - type: 'number', - primary_key: 1, - rules : { - number: true, - } - }, - scroll_id: { - type: 'number', - rules : { - required: true, - number: true, - } - }, - panel_id: { - type: 'number', - rules : { - required: true, - number: true, - } - }, - t: { - type: 'number', - rules : { - required: true, - number: true, - min: 0, - } - }, - author_id: { - type: 'number', - rules : { - required: true, - number: true, - } - }, - created_at: { - type: 'datetime', - }, - updated_at: { - type: 'datetime', - } - }, - }, - Comic: 'comic', - comic: { - class_name: 'Comic', - table_name: 'comics', - associations: { - belongs_to: { - author: { - id_column: 'author_id' - }, - }, - has_many: { - stories: { - foreign_key: 'comic_id' - model: 'story', - }, - }, - has_many_through: { - }, - }, - attributes: { - id: { - type: 'number', - primary_key: 1, - rules : { - number: true, - } - }, - title: { - type: 'text', - rules : { - required: true, - } - }, - description: { - type: 'text', - rules : { - } - }, - visible: { - type: 'number', - rules : { - required: true, - number: true, - }, - source: { - type: 'magic_number', - key: 'comic_visible_items', - }, - }, - author_id: { - type: 'number', - rules : { - required: true, - number: true, - } - }, - created_at: { - type: 'datetime', - }, - updated_at: { - type: 'datetime', - } - }, - select: { - method: 'list', - caption: { - type: 'column', - name: 'title' - }, - }, - }, - Story: 'story', - story: { - class_name: 'Story', - table_name: 'stories', - associations: { - belongs_to: { - comic: { - id_column: 'comic_id' - }, - }, - has_many: { - story_sheets: { - foreign_key: 'story_id', - list_method: 'list_by_story', - }, - sheets: { - through: 'story_sheets', - foreign_key: 'story_id' - list_method: 'list_by_story', - }, - }, - }, - attributes: { - id: { - type: 'number', - primary_key: 1, - rules : { - number: true, - } - }, - comic_id: { - type: 'number', - rules : { - number: true, - } - }, - title: { - type: 'text', - rules : { - } - }, - description: { - type: 'text', - rules : { - } - }, - t: { - type: 'number', - rules : { - required: true, - number: true, - min: 0, - } - }, - visible: { - type: 'number', - rules : { - required: true, - number: true, - }, - source: { - type: 'magic_number', - key: 'story_visible_items', - }, - }, - created_at: { - type: 'datetime', - }, - updated_at: { - type: 'datetime', - } - }, - select: { - method: 'list', - caption: { - type: 'method', - name: 'title_with_t', - }, - }, - }, - StorySheet: 'story_sheet', - story_sheet: { - class_name: 'StorySheet', - table_name: 'story_sheets', - associations: { - belongs_to: { - story: { - id_column: 'story_id' - }, - sheet: { - id_column: 'sheet_id' - }, - }, - has_many: { - }, - }, - attributes: { - id: { - type: 'number', - primary_key: 1, - rules : { - number: true, - } - }, - story_id: { - type: 'number', - rules : { - number: true, - } - }, - sheet_id: { - type: 'number', - rules : { - number: true, - } - }, - t: { - type: 'number', - rules : { - required: true, - number: true, - min: 0, - } - }, - author_id: { - type: 'number', - rules : { - required: true, - number: true, - } - }, - created_at: { - type: 'datetime', - }, - updated_at: { - type: 'datetime', - } - } - }, - Sheet: 'sheet', - sheet: { - class_name: 'Sheet', - table_name: 'sheets', - associations: { - belongs_to: { - author: { - id_column: 'author_id' - }, - }, - has_many: { - story_sheets: { - foreign_key: 'story_id', - list_method: 'list_by_sheet', - }, - stories: { - through: 'story_sheets', - foreign_key: 'sheet_id' - list_method: 'list_by_sheet', - }, - sheet_panels: { - foreign_key: 'sheet_id', - list_method: 'list_by_sheet', - }, - panels: { - through: 'sheet_panels', - foreign_key: 'sheet_id' - list_method: 'list_by_sheet', - }, - }, - }, - attributes: { - id: { - type: 'number', - primary_key: 1, - rules : { - number: true, - } - }, - caption: { - type: 'text', - rules : { - } - }, - width: { - type: 'number', - rules : { - required: true, - number: true, - } - }, - height: { - type: 'number', - rules : { - required: true, - number: true, - } - }, - visible: { - type: 'number', - rules : { - required: true, - number: true, - }, - source: { - type: 'magic_number', - key: 'sheet_visible_items', - }, - }, - author_id: { - type: 'number', - rules : { - required: true, - number: true, - } - }, - created_at: { - type: 'datetime', - }, - updated_at: { - type: 'datetime', - } - }, - select: { - method: 'list', - caption: { - type: 'column', - name: 'caption' - }, - }, - }, - SheetPanel: 'sheet_panel', - sheet_panel: { - class_name: 'SheetPanel', - table_name: 'sheet_panels', - associations: { - belongs_to: { - sheet: { - id_column: 'sheet_id' - }, - panel: { - id_column: 'panel_id' - }, - }, - has_many: { - }, - }, - attributes: { - id: { - type: 'number', - primary_key: 1, - rules : { - number: true, - } - }, - sheet_id: { - type: 'number', - rules : { - number: true, - } - }, - panel_id: { - type: 'number', - rules : { - number: true, - } - }, - x: { - type: 'number', - rules : { - required: true, - number: true, - } - }, - y: { - type: 'number', - rules : { - required: true, - number: true, - } - }, - z: { - type: 'number', - rules : { - required: true, - number: true, - min: 1, - } - }, - t: { - type: 'number', - rules : { - required: true, - number: true, - min: 0, - } - }, - author_id: { - type: 'number', - rules : { - number: true, - } - }, - created_at: { - type: 'datetime', - }, - updated_at: { - type: 'datetime', - } - } - }, - Panel: 'panel', - panel: { - class_name: 'Panel', - table_name: 'panels', - associations: { - belongs_to: { - author: { - id_column: 'author_id' - }, - }, - has_many: { - scroll_panels: { - foreign_key: 'panel_id', - list_method: 'list_by_panel', - }, - scrolls: { - through: 'scroll_panels', - foreign_key: 'panel_id' - list_method: 'list_by_panel', - }, - sheet_panels: { - foreign_key: 'panel_id', - list_method: 'list_by_panel', - }, - sheets: { - through: 'sheet_panels', - foreign_key: 'panel_id' - list_method: 'list_by_panel', - }, - panel_pictures: { - foreign_key: 'panel_id', - list_method: 'list_by_panel', - }, - speech_balloons: { - foreign_key: 'panel_id', - list_method: 'list_by_panel', - }, - ground_pictures: { - foreign_key: 'panel_id', - list_method: 'list_by_panel', - }, - ground_colors: { - foreign_key: 'panel_id', - list_method: 'list_by_panel', - }, - }, - }, - attributes: { - id: { - type: 'number', - primary_key: 1, - rules : { - number: true, - } - }, - width: { - type: 'number', - rules : { - required: true, - number: true, - min: 1, - } - }, - height: { - type: 'number', - rules : { - required: true, - number: true, - min: 1, - } - }, - border: { - type: 'number', - rules : { - required: true, - number: true, - min: 0, - } - }, - caption: { - type: 'text', - rules : { - } - }, - publish: { - type: 'number', - rules : { - required: true, - number: true, - }, - source: { - type: 'magic_number', - key: 'panel_visible_items', - }, - }, - author_id: { - type: 'number', - rules : { - required: true, - number: true, - } - }, - created_at: { - type: 'datetime', - }, - updated_at: { - type: 'datetime', - } - }, - select: { - method: 'list', - caption: { - type: 'method', - name: 'plain_scenario', - }, - }, - }, - PanelPicture: 'panel_picture', - panel_picture: { - class_name: 'PanelPicture', - table_name: 'panel_pictures', - associations: { - belongs_to: { - panel: { - id_column: 'panel_id' - }, - }, - has_many: { - }, - }, - attributes: { - id: { - type: 'number', - primary_key: 1, - rules : { - number: true, - } - }, - panel_id: { - type: 'number', - rules : { - number: true, - } - }, - picture_id: { - type: 'number', - rules : { - required: true, - number: true, - } - }, - caption: { - type: 'text', - rules : { - } - }, - x: { - type: 'number', - rules : { - required: true, - number: true, - } - }, - y: { - type: 'number', - rules : { - required: true, - number: true, - } - }, - width: { - type: 'number', - rules : { - required: true, - number: true, - } - }, - height: { - type: 'number', - rules : { - required: true, - number: true, - } - }, - link: { - type: 'text', - rules : { - url: true, - } - }, - z: { - type: 'number', - rules : { - required: true, - number: true, - min: 1, - } - }, - t: { - type: 'number', - rules : { - required: true, - number: true, - min: 0, - } - }, - created_at: { - type: 'datetime', - }, - updated_at: { - type: 'datetime', - } - } - }, - SpeechBalloon: 'speech_balloon', - speech_balloon: { - class_name: 'SpeechBalloon', - table_name: 'speech_balloons', - extend: 'classname', - associations: { - belongs_to: { - panel: { - id_column: 'panel_id' - }, - }, - has_many: { - }, - has_one: { - balloon: { - foreign_key: 'speech_balloon_id', - list_method: 'list_by_speech_balloon', - }, - speech: { - foreign_key: 'speech_balloon_id', - list_method: 'list_by_speech_balloon', - }, - }, - }, - attributes: { - id: { - type: 'number', - primary_key: 1, - rules : { - number: true, - } - }, - panel_id: { - type: 'number', - rules : { - number: true, - } - }, - speech_balloon_template_id: { - type: 'number', - rules : { - required: true, - number: true, - } - }, - classname: { - type: 'text', - rules : { - required: true, - } - }, - z: { - type: 'number', - rules : { - required: true, - number: true, - min: 1, - } - }, - t: { - type: 'number', - rules : { - required: true, - number: true, - min: 0, - } - }, - settings: { - type: 'text', - rules : { - } - }, - caption: { - type: 'text', - rules : { - } - }, - created_at: { - type: 'datetime', - }, - updated_at: { - type: 'datetime', - } - }, - select: { - method: 'list', - caption: { - type: 'method', - name: 'plain_scenario', - }, - }, - }, - Balloon: 'balloon', - balloon: { - class_name: 'Balloon', - table_name: 'balloons', - associations: { - belongs_to: { - speech_balloon: { - id_column: 'speech_balloon_id' - }, - system_picture: { - id_column: 'system_picture_id' - }, - }, - has_many: { - }, - }, - attributes: { - id: { - type: 'number', - primary_key: 1, - rules : { - number: true, - } - }, - speech_balloon_id: { - type: 'number', - rules : { - number: true, - } - }, - system_picture_id: { - type: 'number', - rules : { - required: true, - number: true, - } - }, - x: { - type: 'number', - rules : { - required: true, - number: true, - } - }, - y: { - type: 'number', - rules : { - required: true, - number: true, - } - }, - width: { - type: 'number', - rules : { - required: true, - number: true, - min: 1, - } - }, - height: { - type: 'number', - rules : { - required: true, - number: true, - min: 1, - } - }, - r: { - type: 'number', - rules : { - required: true, - number: true, - } - }, - settings: { - type: 'text', - rules : { - } - }, - created_at: { - type: 'datetime', - }, - updated_at: { - type: 'datetime', - } - } - }, - Speech: 'speech', - speech: { - class_name: 'Speech', - table_name: 'speeches', - associations: { - belongs_to: { - speech_balloon: { - id_column: 'speech_balloon_id' - }, - writing_format: { - id_column: 'writing_format_id' - }, - }, - has_many: { - }, - }, - attributes: { - id: { - type: 'number', - primary_key: 1, - rules : { - number: true, - } - }, - speech_balloon_id: { - type: 'number', - rules : { - number: true, - } - }, - writing_format_id: { - type: 'number', - source: { - type: 'model', - model: 'writing_format', - method: 'enable_list', - caption: 'caption' - }, - rules : { - required: true, - number: true, - } - }, - content: { - type: 'text', - rules : { - } - }, - font_size: { - type: 'float', - rules : { - required: true, - number: true, - min: 0, - }, - source: { - type: 'magic_number', - key: 'speech_font_size_items', - }, - }, - text_align: { - type: 'number', - rules : { - required: true, - number: true, - range: [0, 3], - }, - source: { - type: 'magic_number', - key: 'speech_text_align_items', - }, - }, - fore_color: { - type: 'number', - rules : { - required: true, - number: true, - range: [0, 0xffffff], - } - }, - x: { - type: 'number', - rules : { - required: true, - number: true, - } - }, - y: { - type: 'number', - rules : { - required: true, - number: true, - } - }, - width: { - type: 'number', - rules : { - required: true, - number: true, - min: 1, - } - }, - height: { - type: 'number', - rules : { - required: true, - number: true, - min: 1, - } - }, - quotes: { - type: 'text', - rules : { - } - }, - settings: { - type: 'text', - rules : { - } - }, - created_at: { - type: 'datetime', - }, - updated_at: { - type: 'datetime', - } - } - }, - GroundPicture: 'ground_picture', - ground_picture: { - class_name: 'GroundPicture', - table_name: 'ground_pictures', - associations: { - belongs_to: { - panel: { - id_column: 'panel_id' - }, - }, - has_many: { - }, - }, - attributes: { - id: { - type: 'number', - primary_key: 1, - rules : { - number: true, - } - }, - panel_id: { - type: 'number', - rules : { - number: true, - } - }, - picture_id: { - type: 'number', - rules : { - required: true, - number: true, - } - }, - caption: { - type: 'text', - rules : { - } - }, - repeat: { - type: 'number', - rules : { - required: true, - number: true, - range: [0, 3], - }, - source: { - type: 'magic_number', - key: 'ground_picture_repeat_items', - }, - }, - x: { - type: 'number', - rules : { - required: true, - number: true, - } - }, - y: { - type: 'number', - rules : { - required: true, - number: true, - } - }, - z: { - type: 'number', - rules : { - required: true, - number: true, - min: 1, - } - }, - t: { - type: 'number', - rules : { - required: true, - number: true, - min: 0, - } - }, - created_at: { - type: 'datetime', - }, - updated_at: { - type: 'datetime', - } - } - }, - GroundColor: 'ground_color', - ground_color: { - class_name: 'GroundColor', - table_name: 'ground_colors', - associations: { - belongs_to: { - panel: { - id_column: 'panel_id' - }, - }, - has_many: { - }, - }, - attributes: { - id: { - type: 'number', - primary_key: 1, - rules : { - number: true, - } - }, - panel_id: { - type: 'number', - rules : { - number: true, - } - }, - caption: { - type: 'text', - rules : { - } - }, - code: { - type: 'number', - rules : { - required: true, - number: true, - range: [0, 0xffffff], - } - }, - orientation: { - type: 'number', - rules : { - required: true, - number: true, - range: [0, 1], - }, - source: { - type: 'magic_number', - key: 'ground_color_orientation_items', - }, - }, - xy: { - type: 'number', - rules : { - number: true, - } - }, - wh: { - type: 'number', - rules : { - number: true, - } - }, - z: { - type: 'number', - rules : { - required: true, - number: true, - min: 1, - } - }, - t: { - type: 'number', - rules : { - required: true, - number: true, - min: 0, - } - }, - created_at: { - type: 'datetime', - }, - updated_at: { - type: 'datetime', - } - } - }, - OriginalPicture: 'original_picture', - original_picture: { - class_name: 'OriginalPicture', - table_name: 'original_pictures', - associations: { - belongs_to: { - artist: { - id_column: 'artist_id' - }, - }, - has_many: { - pictures: { - foreign_key: 'original_picture_id', - list_method: 'list_by_original_picture', - }, - }, - has_one: { - resource_picture: { - foreign_key: 'original_picture_id', - list_method: 'list_by_original_picture', - }, - }, - }, - attributes: { - id: { - type: 'number', - primary_key: 1, - rules : { - number: true, - } - }, - ext: { - type: 'text', - rules : { - required: true, - } - }, - width: { - type: 'number', - rules : { - required: true, - number: true, - } - }, - height: { - type: 'number', - rules : { - required: true, - number: true, - } - }, - filesize: { - type: 'number', - rules : { - required: true, - number: true, - } - }, - artist_id: { - type: 'number', - rules : { - required: true, - number: true, - } - }, - md5: { - type: 'text', - rules : { - required: true, - required: true, - } - }, - uploaded_at: { - type: 'datetime', - }, - published_at: { - type: 'datetime', - }, - stopped_at: { - type: 'datetime', - }, - created_at: { - type: 'datetime', - }, - updated_at: { - type: 'datetime', - } - }, - }, - Picture: 'picture', - picture: { - class_name: 'Picture', - table_name: 'pictures', - associations: { - belongs_to: { - license: { - id_column: 'license_id' - }, - artist: { - id_column: 'artist_id' - }, - }, - has_many: { - }, - has_one: { - }, - }, - attributes: { - id: { - type: 'number', - primary_key: 1, - rules : { - number: true, - } - }, - original_picture_id: { - type: 'number', - rules : { - required: true, - number: true, - } - }, - revision: { - type: 'number', - rules : { - required: true, - number: true, - } - }, - ext: { - type: 'text', - rules : { - required: true, - } - }, - width: { - type: 'number', - rules : { - required: true, - number: true, - } - }, - height: { - type: 'number', - rules : { - required: true, - number: true, - } - }, - filesize: { - type: 'number', - rules : { - required: true, - number: true, - } - }, - artist_id: { - type: 'number', - rules : { - required: true, - number: true, - } - }, - license_id: { - type: 'number', - rules : { - required: true, - number: true, - } - }, - md5: { - type: 'text', - rules : { - required: true, - } - }, - artist_name: { - type: 'text', - rules : { - required: true, - } - }, - credit: { - type: 'text', - rules : { - } - }, - settings: { - type: 'text', - rules : { - } - }, - classname: { - type: 'text', - rules : { - required: true, - } - }, - created_at: { - type: 'datetime', - }, - updated_at: { - type: 'datetime', - } - } - }, - ResourcePicture: 'resource_picture', - resource_picture: { - class_name: 'ResourcePicture', - table_name: 'resource_pictures', - associations: { - belongs_to: { - license: { - id_column: 'license_id' - }, - artist: { - id_column: 'artist_id' - }, - }, - has_many: { - }, - has_one: { - }, - }, - attributes: { - id: { - type: 'number', - primary_key: 1, - rules : { - number: true, - } - }, - original_picture_id: { - type: 'number', - rules : { - required: true, - number: true, - } - }, - revision: { - type: 'number', - rules : { - required: true, - number: true, - } - }, - ext: { - type: 'text', - rules : { - required: true, - } - }, - width: { - type: 'number', - rules : { - required: true, - number: true, - } - }, - height: { - type: 'number', - rules : { - required: true, - number: true, - } - }, - filesize: { - type: 'number', - rules : { - required: true, - number: true, - } - }, - artist_id: { - type: 'number', - rules : { - required: true, - number: true, - } - }, - license_id: { - type: 'number', - rules : { - required: true, - number: true, - } - }, - md5: { - type: 'text', - rules : { - required: true, - } - }, - artist_name: { - type: 'text', - rules : { - required: true, - } - }, - credit: { - type: 'text', - rules : { - } - }, - settings: { - type: 'text', - rules : { - } - }, - picture_id: { - type: 'number', - rules : { - required: true, - number: true, - } - }, - classname: { - type: 'text', - rules : { - required: true, - } - }, - created_at: { - type: 'datetime', - }, - updated_at: { - type: 'datetime', - } - } - }, - SpeechBalloonTemplate: 'speech_balloon_template', - speech_balloon_template: { - class_name: 'SpeechBalloonTemplate', - table_name: 'speech_balloon_templates', - associations: { - belongs_to: { - system_picture: { - id_column: 'system_picture_id' - }, - }, - has_many: { - speech_balloons: { - foreign_key: 'speech_balloon_template_id', - list_method: 'list_by_speech_balloon_template', - }, - panels: { - through: 'speech_balloons', - foreign_key: 'speech_balloon_template_id', - list_method: 'list_by_speech_balloon_template', - }, - }, - has_one: { - }, - }, - attributes: { - id: { - type: 'number', - primary_key: 1, - rules : { - number: true, - } - }, - name: { - type: 'text', - rules : { - required: true, - } - }, - classname: { - type: 'text', - rules : { - required: true, - } - }, - caption: { - type: 'text', - rules : { - required: true, - } - }, - t: { - type: 'number', - rules : { - required: true, - number: true, - min: 0, - } - }, - system_picture_id: { - type: 'number', - rules : { - required: true, - number: true, - } - }, - settings: { - type: 'text', - rules : { - required: true, - } - }, - created_at: { - type: 'datetime', - }, - updated_at: { - type: 'datetime', - } - }, - select: { - method: 'enable_list', - caption: { - type: 'column', - name: 'caption', - }, - }, - }, - WritingFormat: 'writing_format', - writing_format: { - class_name: 'WritingFormat', - table_name: 'writing_formats', - associations: { - belongs_to: { - system_picture: { - id_column: 'system_picture_id' - }, - }, - has_many: { - speeches: { - foreign_key: 'writing_format_id', - list_method: 'list_by_writing_format', - }, - }, - has_one: { - }, - }, - attributes: { - id: { - type: 'number', - primary_key: 1, - rules : { - number: true, - } - }, - name: { - type: 'text', - rules : { - required: true, - } - }, - classname: { - type: 'text', - rules : { - required: true, - } - }, - caption: { - type: 'text', - rules : { - required: true, - } - }, - system_picture_id: { - type: 'number', - rules : { - required: true, - number: true, - } - }, - settings: { - type: 'text', - rules : { - required: true, - } - }, - created_at: { - type: 'datetime', - }, - updated_at: { - type: 'datetime', - } - }, - select: { - method: 'enable_list', - caption: { - type: 'column', - name: 'caption', - }, - }, - }, - LicenseGroup: 'license_group', - license_group: { - class_name: 'LicenseGroup', - table_name: 'license_groups', - associations: { - belongs_to: { - }, - has_many: { - licenses: { - foreign_key: 'license_group_id', - list_method: 'list_by_license_group', - }, - }, - has_one: { - }, - }, - attributes: { - id: { - type: 'number', - primary_key: 1, - rules : { - number: true, - } - }, - name: { - type: 'text', - rules : { - required: true, - } - }, - classname: { - type: 'text', - rules : { - required: true, - } - }, - caption: { - type: 'text', - rules : { - required: true, - } - }, - url: { - type: 'text', - rules : { - required: true, - } - }, - created_at: { - type: 'datetime', - }, - updated_at: { - type: 'datetime', - } - }, - select: { - method: 'list', - caption: { - type: 'column', - name: 'caption', - }, - }, - }, - License: 'license', - license: { - class_name: 'License', - table_name: 'licenses', - associations: { - belongs_to: { - license_group: { - id_column: 'license_group_id' - }, - system_picture: { - id_column: 'system_picture_id' - }, - }, - has_many: { - resource_pictures: { - foreign_key: 'license_id', - list_method: 'list_by_license', - }, - }, - has_one: { - }, - }, - attributes: { - id: { - type: 'number', - primary_key: 1, - rules : { - number: true, - } - }, - license_group_id: { - type: 'number', - rules : { - number: true, - } - }, - name: { - type: 'text', - rules : { - required: true, - } - }, - caption: { - type: 'text', - rules : { - required: true, - } - }, - system_picture_id: { - type: 'number', - rules : { - required: true, - number: true, - } - }, - url: { - type: 'text', - rules : { - required: true, - } - }, - settings: { - type: 'text', - rules : { - } - }, - credit_pictures: { - type: 'text', - rules : { - } - }, - created_at: { - type: 'datetime', - }, - updated_at: { - type: 'datetime', - } - } - }, - Author: 'author', - author: { - class_name: 'Author', - table_name: 'authors', - associations: { - belongs_to: { - }, - has_many: { - scrolls: { - foreign_key: 'author_id', - list_method: 'list_by_author', - }, - comics: { - foreign_key: 'author_id', - list_method: 'list_by_author', - }, - stories: { - foreign_key: 'author_id', - list_method: 'list_by_author', - }, - sheets: { - foreign_key: 'author_id', - list_method: 'list_by_author', - }, - panels: { - foreign_key: 'author_id', - list_method: 'list_by_author', - }, - }, - has_one: { - }, - }, - attributes: { - id: { - type: 'number', - primary_key: 1, - rules : { - number: true, - } - }, - name: { - type: 'text', - rules : { - required: true, - } - }, - user_id: { - type: 'number', - rules : { - required: true, - number: true, - } - }, - created_at: { - type: 'datetime', - }, - updated_at: { - type: 'datetime', - } - }, - select: { - method: 'list', - caption: { - type: 'column', - name: 'name', - }, - }, - }, - Artist: 'artist', - artist: { - class_name: 'Artist', - table_name: 'artists', - associations: { - belongs_to: { - }, - has_many: { - resource_pictures: { - foreign_key: 'artist_id', - list_method: 'list_by_artist', - }, - }, - has_one: { - }, - }, - attributes: { - id: { - type: 'number', - primary_key: 1, - rules : { - number: true, - } - }, - name: { - type: 'text', - rules : { - required: true, - } - }, - author_id: { - type: 'number', - rules : { - required: true, - number: true, - } - }, - created_at: { - type: 'datetime', - }, - updated_at: { - type: 'datetime', - } - }, - select: { - method: 'list', - caption: { - type: 'column', - name: 'name', - }, - }, - }, - SystemPicture: 'system_picture', - system_picture: { - class_name: 'SystemPicture', - table_name: 'system_pictures', - associations: { - belongs_to: { - }, - has_many: { - }, - has_one: { - }, - }, - attributes: { - id: { - type: 'number', - primary_key: 1, - rules : { - number: true, - } - }, - ext: { - type: 'text', - rules : { - required: true, - } - }, - width: { - type: 'number', - rules : { - required: true, - number: true, - } - }, - height: { - type: 'number', - rules : { - required: true, - number: true, - } - }, - filesize: { - type: 'number', - rules : { - required: true, - number: true, - } - }, - md5: { - type: 'text', - rules : { - required: true, - required: true, - } - }, - created_at: { - type: 'datetime', - }, - updated_at: { - type: 'datetime', - } - } - }, - }, -} - diff --git a/app/assets/javascripts/panels.js.coffee b/app/assets/javascripts/panels.js.coffee index 464975c4..070b83fe 100644 --- a/app/assets/javascripts/panels.js.coffee +++ b/app/assets/javascripts/panels.js.coffee @@ -2,10 +2,22 @@ $ -> confirm_confirm_confirm = () -> confirm( ) editor = window.PettanrEditor - _.extend(window.configurations, window.configurations2) - j = JSON.stringify(window.configurations, undefined, 2) + configurations = { + controllers: window.controllers, + models: window.models, + lists: window.lists, + system_resources: window.system_resources, + magic_numbers: window.magic_numbers, + select_items: window.select_items, + locals: { + profilers: window.profilers, + filers: window.filers, + elements: window.elements, + forms: window.forms, + } + } + j = JSON.stringify(configurations, undefined, 2) $('#pettanr-configurations').val(j) - configurations = window.configurations WritingFormat = window.PettanrWritingFormat WritingFormat.load($('#writing_formats')) SpeechBalloonTemplate = window.PettanrSpeechBalloonTemplate diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 6d495b1c..906f5b41 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -125,6 +125,24 @@ class ApplicationController < ActionController::Base end end + def my_list params + controller_name = params[:controller] + action_name = params[:action] + controller = Pettanr::Application::manifest.controller_managers[controller_name] + @action = controller.open(action_name, params, @operators) + @items = @action.items + + respond_to do |format| + format.html { + @filer = @action.filer + render :template => 'system/filer', :locals => { + :filer => @filer + } + } + format.json { render json: @items.to_json(Scroll.list_json_opt) } + end + end + def format_filer format format.html { @paginate = @@model.list_paginate(@page, @page_size) diff --git a/app/controllers/artists_controller.rb b/app/controllers/artists_controller.rb index 60cf49ed..9176367b 100644 --- a/app/controllers/artists_controller.rb +++ b/app/controllers/artists_controller.rb @@ -8,7 +8,6 @@ class ArtistsController < ApplicationController before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy] before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy] end - before_filter :authenticate_admin!, :only => [:list, :browse] def self.model Artist @@ -50,30 +49,12 @@ class ArtistsController < ApplicationController end end - def list - @artists = Artist.all - - respond_to do |format| - format.html { render layout: 'system' } - format.json { render json: @artists } - end - end - - def browse - @artist = Artist.find(params[:id]) - - respond_to do |format| - format.html { render layout: 'system' } - format.json { render json: @artist } - end - end - def new @artist = Artist.new @artist.supply_default respond_to do |format| - format.html # new.html.erb + format.html format.js format.json { render json: @artist.to_json(Artist.show_json_opt) } end diff --git a/app/controllers/authors_controller.rb b/app/controllers/authors_controller.rb index 886b714f..eafdb524 100644 --- a/app/controllers/authors_controller.rb +++ b/app/controllers/authors_controller.rb @@ -8,7 +8,6 @@ class AuthorsController < ApplicationController before_filter :authenticate_user, :only => [:new, :create, :edit, :update] before_filter :authenticate_author, :only => [:edit, :update] end - before_filter :authenticate_admin!, :only => [:list, :browse] def self.model Author @@ -265,28 +264,12 @@ class AuthorsController < ApplicationController end end - def list - @authors = Author.all - - respond_to do |format| - format.html { render layout: 'system' } - end - end - - def browse - @au = Author.find(params[:id]) - - respond_to do |format| - format.html { render layout: 'system' } - end - end - def new @author = Author.new @author.supply_default respond_to do |format| - format.html # new.html.erb + format.html format.js format.json { render json: @au.to_json(Author.show_json_opt) } end diff --git a/app/controllers/comics_controller.rb b/app/controllers/comics_controller.rb index c3ce66ab..f8f0a04f 100644 --- a/app/controllers/comics_controller.rb +++ b/app/controllers/comics_controller.rb @@ -8,7 +8,6 @@ class ComicsController < ApplicationController before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy] before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy] end - before_filter :authenticate_admin!, :only => [:list, :browse] def self.model Comic @@ -38,36 +37,18 @@ class ComicsController < ApplicationController end end - def list - @comics = Comic.all - - respond_to do |format| - format.html { render layout: 'system' }# index.html.erb - format.json { render json: @comics } - end - end - - def browse - @comic = Comic.find(params[:id]) - - respond_to do |format| - format.html { render layout: 'system' } # show.html.erb - format.json { render json: @comic } - end - end - def new @comic = Comic.new @comic.supply_default respond_to do |format| - format.html # new.html.erb + format.html format.js format.json { render json: @comic.to_json(Comic.show_json_opt) } end end def edit - @comic = Comic.edit(params[:id], @author) + @comic = Comic.edit(params[:id], @operators) respond_to do |format| format.html format.js @@ -111,7 +92,7 @@ class ComicsController < ApplicationController end def destroy - @comic = Comic.edit(params[:id], @author) + @comic = Comic.edit(params[:id], @operators) respond_to do |format| if @comic.destroy_with_story flash[:notice] = I18n.t('flash.notice.destroyed', :model => Comic.model_name.human) diff --git a/app/controllers/ground_colors_controller.rb b/app/controllers/ground_colors_controller.rb index da4a45f5..582d34b9 100644 --- a/app/controllers/ground_colors_controller.rb +++ b/app/controllers/ground_colors_controller.rb @@ -29,8 +29,8 @@ class GroundColorsController < ApplicationController end def new - raise Pettanr::NotWork unless @author.working_panel - @panel = Panel.edit(@author.working_panel, @author) + raise Pettanr::NotWork unless @operators.author.working_panel + @panel = Panel.edit(@operators.author.working_panel, @operators) @ground_color = GroundColor.new :panel_id => @panel.id, :code => params[:code].to_i @ground_color.supply_default @@ -41,8 +41,8 @@ class GroundColorsController < ApplicationController end def edit - @ground_color = GroundColor.show(params[:id], @author) - @panel = Panel.edit(@ground_color.panel.id, @author) + @ground_color = GroundColor.show(params[:id], @operators) + @panel = Panel.edit(@ground_color.panel.id, @operators) respond_to do |format| format.html @@ -50,8 +50,8 @@ class GroundColorsController < ApplicationController end def create - raise Pettanr::NotWork unless @author.working_panel - @panel = Panel.edit(@author.working_panel, @author) + raise Pettanr::NotWork unless @operators.author.working_panel + @panel = Panel.edit(@operators.author.working_panel, @operators) @ground_color = GroundColor.new @ground_color.attributes = params[:ground_color] @@ -59,7 +59,7 @@ class GroundColorsController < ApplicationController respond_to do |format| if @ground_color.valid? - if @ground_color.store @author + if @ground_color.store @operators flash[:notice] = I18n.t('flash.notice.created', :model => Panel.model_name.human) format.html { redirect_to @panel } format.json { render json: @panel.panel_elements_as_json, status: :created, location: @panel } @@ -77,13 +77,13 @@ class GroundColorsController < ApplicationController end def update - @ground_color = GroundColor.show(params[:id], @author) + @ground_color = GroundColor.show(params[:id], @operators) @ground_color.attributes = params[:ground_color] - @panel = Panel.edit(@ground_color.panel.id, @author) + @panel = Panel.edit(@ground_color.panel.id, @operators) @ground_color.overwrite @panel.id respond_to do |format| - if @ground_color.store @author + if @ground_color.store @operators flash[:notice] = I18n.t('flash.notice.updated', :model => GroundColor.model_name.human) format.html { redirect_to @ground_color } format.json { head :ok } @@ -96,11 +96,11 @@ class GroundColorsController < ApplicationController end def destroy - @ground_color = GroundColor.show(params[:id], @author) - @panel = Panel.edit(@ground_color.panel.id, @author) + @ground_color = GroundColor.show(params[:id], @operators) + @panel = Panel.edit(@ground_color.panel.id, @operators) respond_to do |format| - if @ground_color.remove @author + if @ground_color.remove @operators flash[:notice] = I18n.t('flash.notice.destroyed', :model => GroundColor.model_name.human) format.html { redirect_to @panel } format.json { head :ok } diff --git a/app/controllers/ground_pictures_controller.rb b/app/controllers/ground_pictures_controller.rb index a4faa835..9a222d38 100644 --- a/app/controllers/ground_pictures_controller.rb +++ b/app/controllers/ground_pictures_controller.rb @@ -29,10 +29,10 @@ class GroundPicturesController < ApplicationController end def new - raise Pettanr::NotWork unless @author.working_panel - @picture = Picture.show params[:picture_id], @author + raise Pettanr::NotWork unless @operators.author.working_panel + @picture = Picture.show params[:picture_id], @operators raise ActiveRecord::Forbidden unless @picture.enable? - @panel = Panel.edit(@author.working_panel, @author) + @panel = Panel.edit(@operators.author.working_panel, @operators) @ground_picture = GroundPicture.new :panel_id => @panel.id, :picture_id => @picture.id @ground_picture.supply_default @@ -44,8 +44,8 @@ class GroundPicturesController < ApplicationController end def edit - @ground_picture = GroundPicture.show(params[:id], @author) - @panel = Panel.edit(@ground_picture.panel.id, @author) + @ground_picture = GroundPicture.show(params[:id], @operators) + @panel = Panel.edit(@ground_picture.panel.id, @operators) respond_to do |format| format.html @@ -53,19 +53,19 @@ class GroundPicturesController < ApplicationController end def create - raise Pettanr::NotWork unless @author.working_panel - @panel = Panel.edit(@author.working_panel, @author) + raise Pettanr::NotWork unless @operators.author.working_panel + @panel = Panel.edit(@operators.author.working_panel, @operators) @ground_picture = GroundPicture.new @ground_picture.attributes = params[:ground_picture] @ground_picture.overwrite @panel.id - @picture = Picture.show @ground_picture.picture_id, @author + @picture = Picture.show @ground_picture.picture_id, @operators raise ActiveRecord::Forbidden unless @picture.enable? respond_to do |format| if @ground_picture.valid? - if @ground_picture.store @author + if @ground_picture.store @operators flash[:notice] = I18n.t('flash.notice.created', :model => Panel.model_name.human) format.html { redirect_to @panel } format.json { render json: @panel.panel_elements_as_json, status: :created, location: @panel } @@ -83,16 +83,16 @@ class GroundPicturesController < ApplicationController end def update - @ground_picture = GroundPicture.show(params[:id], @author) + @ground_picture = GroundPicture.show(params[:id], @operators) @ground_picture.attributes = params[:ground_picture] - @panel = Panel.edit(@ground_picture.panel.id, @author) + @panel = Panel.edit(@ground_picture.panel.id, @operators) @ground_picture.overwrite @panel.id - @picture = Picture.show @ground_picture.picture_id, @author + @picture = Picture.show @ground_picture.picture_id, @operators raise ActiveRecord::Forbidden unless @picture.enable? respond_to do |format| - if @ground_picture.store @author + if @ground_picture.store @operators flash[:notice] = I18n.t('flash.notice.updated', :model => GroundPicture.model_name.human) format.html { redirect_to @ground_picture } format.json { head :ok } @@ -105,11 +105,11 @@ class GroundPicturesController < ApplicationController end def destroy - @ground_picture = GroundPicture.show(params[:id], @author) - @panel = Panel.edit(@ground_picture.panel.id, @author) + @ground_picture = GroundPicture.show(params[:id], @operators) + @panel = Panel.edit(@ground_picture.panel.id, @operators) respond_to do |format| - if @ground_picture.remove @author + if @ground_picture.remove @operators flash[:notice] = I18n.t('flash.notice.destroyed', :model => GroundPicture.model_name.human) format.html { redirect_to @panel } format.json { head :ok } diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 5ee20524..201ae898 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -41,226 +41,55 @@ class HomeController < ApplicationController end def scrolls - model = Scroll - controller_name = params[:controller] - action_name = params[:action] - controller = Pettanr::Application::manifest.controller_managers[controller_name] - @action = controller.open(action_name, params, @operators) - @items = @action.items - - respond_to do |format| - format.html { - @filer = @action.filer - render :template => 'system/filer', :locals => { - :filer => @filer - } - } - format.json { render json: @items.to_json(Scroll.list_json_opt) } - end + my_list params end def scroll_panels - @page = Author.page params[:page] - @page_size = Author.scroll_panel_page_size params[:page_size] - @scroll_panels = ScrollPanel.mylist(@author, @page, @page_size) - - respond_to do |format| - format.html { - @paginate = ScrollPanel.mylist_paginate(@author, @page, @page_size) - render :template => 'system/filer', :locals => { - :items => @scroll_panels, :model => ScrollPanel, - :roles => [@user, @admin], :pager => @paginate - } - } - format.json { render json: @scroll_panels.to_json(ScrollPanel.list_json_opt) } - end + my_list params end def comics - @page = Author.page params[:page] - @page_size = Author.comic_page_size params[:page_size] - @comics = Comic.mylist(@author, @page, @page_size) - - respond_to do |format| - format.html { - @paginate = Comic.mylist_paginate(@author, @page, @page_size) - render :template => 'system/filer', :locals => { - :items => @comics, :model => Comic, - :roles => [@user, @admin], :pager => @paginate - } - } - format.json { render json: @comics.to_json(Comic.list_json_opt) } - end + my_list params end def stories - @page = Author.page params[:page] - @page_size = Author.story_page_size params[:page_size] - @stories = Story.mylist(@author, @page, @page_size) - - respond_to do |format| - format.html { - @paginate = Story.mylist_paginate(@author, @page, @page_size) - render :template => 'system/filer', :locals => { - :items => @stories, :model => Story, - :roles => [@user, @admin], :pager => @paginate - } - } - format.json { render json: @stories.to_json(Story.list_json_opt) } - end + my_list params end def story_sheets - @page = Author.page params[:page] - @page_size = Author.story_sheet_page_size params[:page_size] - @story_sheets = StorySheet.mylist(@author, @page, @page_size) - - respond_to do |format| - format.html { - @paginate = StorySheet.mylist_paginate(@author, @page, @page_size) - render :template => 'system/filer', :locals => { - :items => @story_sheets, :model => StorySheet, - :roles => [@user, @admin], :pager => @paginate - } - } - format.json { render json: @story_sheets.to_json(StorySheet.list_json_opt) } - end + my_list params end def sheets - @page = Author.page params[:page] - @page_size = Author.sheet_page_size params[:page_size] - @sheets = Sheet.mylist(@author, @page, @page_size) - - respond_to do |format| - format.html { - @paginate = Sheet.mylist_paginate(@author, @page, @page_size) - render :template => 'system/filer', :locals => { - :items => @sheets, :model => Sheet, - :roles => [@user, @admin], :pager => @paginate - } - } - format.json { render json: @sheets.to_json(Sheet.list_json_opt) } - end + my_list params end def sheet_panels - @page = Author.page params[:page] - @page_size = Author.sheet_panel_page_size params[:page_size] - @sheet_panels = SheetPanel.mylist(@author, @page, @page_size) - - respond_to do |format| - format.html { - @paginate = SheetPanel.mylist_paginate(@author, @page, @page_size) - render :template => 'system/filer', :locals => { - :items => @sheet_panels, :model => SheetPanel, - :roles => [@user, @admin], :pager => @paginate - } - } - format.json { render json: @sheet_panels.to_json(SheetPanel.list_json_opt) } - end + my_list params end def panels - @page = Author.page params[:page] - @page_size = Author.panel_page_size params[:page_size] - @panels = Panel.mylist(@author, @page, @page_size) - - respond_to do |format| - format.html { - @paginate = Panel.mylist_paginate(@author, @page, @page_size) - render :template => 'system/filer', :locals => { - :items => @panels, :model => Panel, - :roles => [@user, @admin], :pager => @paginate - } - } - format.json { render text: Panel.list_as_json_text(@panels) } - end + my_list params end def panel_pictures - @page = Author.page params[:page] - @page_size = Author.panel_picture_page_size params[:page_size] - @panel_pictures = PanelPicture.mylist(@author, @page, @page_size) - - respond_to do |format| - format.html { - @paginate = PanelPicture.mylist_paginate(@author, @page, @page_size) - render :template => 'system/filer', :locals => { - :items => @panel_pictures, :model => PanelPicture, - :roles => [@user, @admin], :pager => @paginate - } - } - format.json { render json: @panel_pictures.to_json(PanelPicture.list_json_opt) } - end + my_list params end def speech_balloons - @page = Author.page params[:page] - @page_size = Author.speech_balloon_page_size params[:page_size] - @speech_balloons = SpeechBalloon.mylist(@author, @page, @page_size) - - respond_to do |format| - format.html { - @paginate = SpeechBalloon.mylist_paginate(@author, @page, @page_size) - render :template => 'system/filer', :locals => { - :items => @speech_balloons, :model => SpeechBalloon, - :roles => [@user, @admin], :pager => @paginate - } - } - format.json { render json: @speech_balloons.to_json(SpeechBalloon.list_json_opt) } - end + my_list params end def ground_pictures - @page = Author.page params[:page] - @page_size = Author.ground_picture_page_size params[:page_size] - @ground_pictures = GroundPicture.mylist(@author, @page, @page_size) - - respond_to do |format| - format.html { - @paginate = GroundPicture.mylist_paginate(@author, @page, @page_size) - render :template => 'system/filer', :locals => { - :items => @ground_pictures, :model => GroundPicture, - :roles => [@user, @admin], :pager => @paginate - } - } - format.json { render json: @ground_pictures.to_json(GroundPicture.list_json_opt) } - end + my_list params end def ground_colors - @page = Author.page params[:page] - @page_size = Author.ground_color_page_size params[:page_size] - @ground_colors = GroundColor.mylist(@author, @page, @page_size) - - respond_to do |format| - format.html { - @paginate = GroundColor.mylist_paginate(@author, @page, @page_size) - render :template => 'system/filer', :locals => { - :items => @ground_colors, :model => GroundColor, - :roles => [@user, @admin], :pager => @paginate - } - } - format.json { render json: @ground_colors.to_json(GroundColor.list_json_opt) } - end + my_list params end def resource_pictures - @page = Author.page params[:page] - @page_size = Author.resource_picture_page_size params[:page_size] - @resource_pictures = ResourcePicture.mylist(@artist, @page, @page_size) - - respond_to do |format| - format.html { - @paginate = ResourcePicture.mylist_paginate(@author, @page, @page_size) - render :template => 'system/filer', :locals => { - :items => @resource_pictures, :model => ResourcePicture, - :roles => [@user, @admin], :pager => @paginate - } - } - format.json { render json: @resource_pictures.to_json(ResourcePicture.list_json_opt) } - end + my_list params end end diff --git a/app/controllers/licenses_controller.rb b/app/controllers/licenses_controller.rb index a3651984..6e7ead52 100644 --- a/app/controllers/licenses_controller.rb +++ b/app/controllers/licenses_controller.rb @@ -1,15 +1,12 @@ class LicensesController < ApplicationController layout 'test' if MagicNumber['test_layout'] - before_filter :authenticate_admin!, :only => [:list, :browse] - @@model = License + def self.model + License + end + def index - set_filer - - respond_to do |format| - format_filer format - format.json { render json: @items.to_json(@@model.list_json_opt) } - end + public_list end def show @@ -32,21 +29,4 @@ class LicensesController < ApplicationController end end - def list - @licenses = License.all - - respond_to do |format| - format.html { render layout: 'system' } - format.json { render json: @licenses } - end - end - - def browse - @license = License.find(params[:id]) - - respond_to do |format| - format.html { render layout: 'system' } - format.json { render json: @license } - end - end end diff --git a/app/controllers/original_pictures_controller.rb b/app/controllers/original_pictures_controller.rb index 51987a44..88428c2f 100644 --- a/app/controllers/original_pictures_controller.rb +++ b/app/controllers/original_pictures_controller.rb @@ -4,7 +4,6 @@ class OriginalPicturesController < ApplicationController before_filter :authenticate_reader, :only => [:show, :history] before_filter :authenticate_user, :only => [:index, :new, :edit, :create, :update, :destroy] before_filter :authenticate_artist, :only => [:index, :new, :edit, :create, :update, :destroy] - before_filter :authenticate_admin!, :only => [:list, :browse] def self.model OriginalPicture @@ -34,46 +33,28 @@ class OriginalPicturesController < ApplicationController end def history - @original_picture = OriginalPicture.show(params[:id], [@artist, @admin]) + @original_picture = OriginalPicture.show(params[:id], @operators) @history = @original_picture.history respond_to do |format| - format.html # index.html.erb + format.html format.json { render json: @history.to_json } end end - def list - @original_pictures = OriginalPicture.all - - respond_to do |format| - format.html { render layout: 'system' } - format.json { render json: @original_pictures } - end - end - - def browse - @original_picture = OriginalPicture.find(params[:id]) - - respond_to do |format| - format.html { render layout: 'system' } - format.json { render json: @original_picture } - end - end - def new @original_picture = OriginalPicture.new @original_picture.supply_default respond_to do |format| - format.html # new.html.erb + format.html format.js format.json { render json: @original_picture.to_json(OriginalPicture.show_json_opt) } end end def edit - @original_picture = OriginalPicture.edit(params[:id], @artist) + @original_picture = OriginalPicture.edit(params[:id], @operators) respond_to do |format| format.html format.js @@ -88,7 +69,7 @@ class OriginalPicturesController < ApplicationController end @original_picture = OriginalPicture.new @original_picture.supply_default - @original_picture.overwrite @artist + @original_picture.overwrite @operators respond_to do |format| if @original_picture.store(@imager) @@ -109,8 +90,8 @@ class OriginalPicturesController < ApplicationController else nil end - @original_picture = OriginalPicture.edit(params[:id], @artist) - @original_picture.overwrite @artist + @original_picture = OriginalPicture.edit(params[:id], @operators) + @original_picture.overwrite @operators respond_to do |format| if @original_picture.store(@imager) @@ -126,7 +107,7 @@ class OriginalPicturesController < ApplicationController end def destroy - @original_picture = OriginalPicture.edit(params[:id], @artist) + @original_picture = OriginalPicture.edit(params[:id], @operators) respond_to do |format| if @original_picture.destroy_with_resource_picture diff --git a/app/controllers/panel_pictures_controller.rb b/app/controllers/panel_pictures_controller.rb index 1a23777e..cf55a8fa 100644 --- a/app/controllers/panel_pictures_controller.rb +++ b/app/controllers/panel_pictures_controller.rb @@ -8,7 +8,6 @@ class PanelPicturesController < ApplicationController before_filter :authenticate_user, :only => [:new, :edit, :create, :update, :destroy] before_filter :authenticate_author, :only => [:new, :edit, :create, :update, :destroy] end - before_filter :authenticate_admin!, :only => [:list, :browse] def self.model PanelPicture @@ -30,29 +29,11 @@ class PanelPicturesController < ApplicationController end end - def list - @panel_pictures = PanelPicture.all - - respond_to do |format| - format.html { render layout: 'system' } - format.json { render json: @panel_pictures } - end - end - - def browse - @panel_picture = PanelPicture.find(params[:id]) - - respond_to do |format| - format.html { render layout: 'system' } - format.json { render json: @panel_picture} - end - end - def new - raise Pettanr::NotWork unless @author.working_panel - @picture = Picture.show params[:picture_id], @author + raise Pettanr::NotWork unless @operators.author.working_panel + @picture = Picture.show params[:picture_id], @operators raise ActiveRecord::Forbidden unless @picture.enable? - @panel = Panel.edit(@author.working_panel, @author) + @panel = Panel.edit(@operators.author.working_panel, @operators) @panel_picture = PanelPicture.new :panel_id => @panel.id, :picture_id => @picture.id @panel_picture.supply_default @@ -64,8 +45,8 @@ class PanelPicturesController < ApplicationController end def edit - @panel_picture = PanelPicture.show(params[:id], @author) - @panel = Panel.edit(@panel_picture.panel.id, @author) + @panel_picture = PanelPicture.show(params[:id], @operators) + @panel = Panel.edit(@panel_picture.panel.id, @operators) respond_to do |format| format.html @@ -74,18 +55,18 @@ class PanelPicturesController < ApplicationController def create raise Pettanr::NotWork unless @author.working_panel - @panel = Panel.edit(@author.working_panel, @author) + @panel = Panel.edit(@operators.author.working_panel, @operators) @panel_picture = PanelPicture.new @panel_picture.attributes = params[:panel_picture] @panel_picture.overwrite @panel.id - @picture = Picture.show @panel_picture.picture_id, @author + @picture = Picture.show @panel_picture.picture_id, @operators raise ActiveRecord::Forbidden unless @picture.enable? respond_to do |format| if @panel_picture.valid? - if @panel_picture.store @author + if @panel_picture.store @operators flash[:notice] = I18n.t('flash.notice.created', :model => Panel.model_name.human) format.html { redirect_to @panel } format.json { render json: @panel.panel_elements_as_json, status: :created, location: @panel } @@ -103,16 +84,16 @@ class PanelPicturesController < ApplicationController end def update - @panel_picture = PanelPicture.show(params[:id], @author) + @panel_picture = PanelPicture.show(params[:id], @operators) @panel_picture.attributes = params[:panel_picture] - @panel = Panel.edit(@panel_picture.panel.id, @author) + @panel = Panel.edit(@panel_picture.panel.id, @operators) @panel_picture.overwrite @panel.id - @picture = Picture.show @panel_picture.picture_id, @author + @picture = Picture.show @panel_picture.picture_id, @operators raise ActiveRecord::Forbidden unless @picture.enable? respond_to do |format| - if @panel_picture.store @author + if @panel_picture.store @operators flash[:notice] = I18n.t('flash.notice.updated', :model => PanelPicture.model_name.human) format.html { redirect_to @panel_picture } format.json { head :ok } @@ -125,11 +106,11 @@ class PanelPicturesController < ApplicationController end def destroy - @panel_picture = PanelPicture.show(params[:id], @author) - @panel = Panel.edit(@panel_picture.panel.id, @author) + @panel_picture = PanelPicture.show(params[:id], @operators) + @panel = Panel.edit(@panel_picture.panel.id, @operators) respond_to do |format| - if @panel_picture.remove @author + if @panel_picture.remove @operators flash[:notice] = I18n.t('flash.notice.destroyed', :model => PanelPicture.model_name.human) format.html { redirect_to @panel } format.json { head :ok } diff --git a/app/controllers/panels_controller.rb b/app/controllers/panels_controller.rb index fb76c25d..76b3f065 100644 --- a/app/controllers/panels_controller.rb +++ b/app/controllers/panels_controller.rb @@ -8,7 +8,6 @@ class PanelsController < ApplicationController before_filter :authenticate_user, :only => [:new, :edit, :create, :update, :destroy, :catch] before_filter :authenticate_author, :only => [:new, :edit, :create, :update, :destroy, :catch] end - before_filter :authenticate_admin!, :only => [:list, :browse] def self.model Panel @@ -43,23 +42,6 @@ class PanelsController < ApplicationController end end - def list - @panels = Panel.all :order => 'updated_at' - - respond_to do |format| - format.html { render layout: 'system' } - format.json { render json: @panels } - end - end - - def browse - @panel = Panel.find(params[:id]) - - respond_to do |format| - format.html { render layout: 'system' } - end - end - def new @panel = Panel.new @panel.supply_default @@ -72,7 +54,7 @@ class PanelsController < ApplicationController end def edit - @panel = Panel.edit(params[:id], @author) + @panel = Panel.edit(params[:id], @operators) respond_to do |format| format.html format.js @@ -88,7 +70,7 @@ class PanelsController < ApplicationController end @prm = params[:panel] || jsn respond_to do |format| - if @panel.store @prm, @author + if @panel.store @prm, @operators flash[:notice] = I18n.t('flash.notice.created', :model => Panel.model_name.human) format.html { redirect_to @panel } format.json { render json: @panel.panel_elements_as_json, status: :created, location: @panel } @@ -100,14 +82,14 @@ class PanelsController < ApplicationController end def update - @panel = Panel.edit(params[:id], @author) + @panel = Panel.edit(params[:id], @operators) jsn = nil if params[:json] jsn = JSON.parse(params[:json]) end @prm = params[:panel] || jsn respond_to do |format| - if @panel.store @prm, @author + if @panel.store @prm, @operators flash[:notice] = I18n.t('flash.notice.updated', :model => Panel.model_name.human) format.html { redirect_to @panel } format.json { head :ok } @@ -119,7 +101,7 @@ class PanelsController < ApplicationController end def destroy - @panel = Panel.edit(params[:id], @author) + @panel = Panel.edit(params[:id], @operators) respond_to do |format| Panel.transaction do if @panel.destroy_with_elements @@ -136,11 +118,11 @@ class PanelsController < ApplicationController end def catch - @panel = Panel.edit(params[:id], @author) + @panel = Panel.edit(params[:id], @operators) respond_to do |format| - @author.working_panel_id = @panel.id - if @author.save + @operators.author.working_panel_id = @panel.id + if @operators.author.save format.html { redirect_to @panel } else end diff --git a/app/controllers/pictures_controller.rb b/app/controllers/pictures_controller.rb index 959f171d..5f4d81e7 100644 --- a/app/controllers/pictures_controller.rb +++ b/app/controllers/pictures_controller.rb @@ -8,7 +8,6 @@ class PicturesController < ApplicationController before_filter :authenticate_resource_reader, :only => [:show, :credit, :search] before_filter :authenticate_author, :only => [] end - before_filter :authenticate_admin!, :only => [:list, :browse] def show @item = Picture.show(params[:id], @operators) @@ -27,10 +26,10 @@ class PicturesController < ApplicationController end def credit - @picture = Picture.show(params[:id], [@user, @admin, @demand_user]) + @picture = Picture.show(params[:id], @operators) respond_to do |format| - format.html { render :layout => false } # show.html.erb + format.html { render :layout => false } format.json { render :json => @picture.to_json} end end @@ -44,21 +43,4 @@ class PicturesController < ApplicationController end end - def list - @pictures = Picture.all - - respond_to do |format| - format.html { render layout: 'system' }# index.html.erb - format.json { render json: @pictures } - end - end - - def browse - @picture = Picture.find(params[:id]) - - respond_to do |format| - format.html { render layout: 'system' } # show.html.erb - format.json { render json: @picture } - end - end end diff --git a/app/controllers/resource_pictures_controller.rb b/app/controllers/resource_pictures_controller.rb index bd6d1c68..e75fc0b7 100644 --- a/app/controllers/resource_pictures_controller.rb +++ b/app/controllers/resource_pictures_controller.rb @@ -8,7 +8,6 @@ class ResourcePicturesController < ApplicationController before_filter :authenticate_user, :only => [:new, :create, :update, :destroy] before_filter :authenticate_artist, :only => [:new, :create, :update, :destroy] end - before_filter :authenticate_admin!, :only => [:list, :browse] def self.model ResourcePicture @@ -35,7 +34,7 @@ class ResourcePicturesController < ApplicationController end def credit - @resource_picture = ResourcePicture.show(params[:id], [@user, @admin, @demand_user]) + @resource_picture = ResourcePicture.show(params[:id], @operators) respond_to do |format| format.html { render :layout => false } # show.html.erb @@ -44,7 +43,7 @@ class ResourcePicturesController < ApplicationController end def new - @original_picture = OriginalPicture.edit params[:original_picture_id], @artist + @original_picture = OriginalPicture.edit params[:original_picture_id], @operators @imager = PettanImager.load @original_picture.restore @original_picture_license_group = OriginalPictureLicenseGroup.new params[:original_picture_license_group] @license_group = LicenseGroup.show @original_picture_license_group.license_group_id @@ -64,7 +63,7 @@ class ResourcePicturesController < ApplicationController end def create - @original_picture = OriginalPicture.edit params[:original_picture_id], @artist + @original_picture = OriginalPicture.edit params[:original_picture_id], @operators @imager = PettanImager.load @original_picture.restore @original_picture_license_group = OriginalPictureLicenseGroup.new params[:original_picture_license_group] @license_group = LicenseGroup.show @original_picture_license_group.license_group_id @@ -89,7 +88,7 @@ class ResourcePicturesController < ApplicationController end def destroy - @resource_picture = ResourcePicture.edit(params[:id], @artist) + @resource_picture = ResourcePicture.edit(params[:id], @operators) respond_to do |format| if @resource_picture.unpublish @@ -109,22 +108,4 @@ class ResourcePicturesController < ApplicationController end end - def list - @resource_pictures = ResourcePicture.all - - respond_to do |format| - format.html { render layout: 'system' } - format.json { render json: @resource_pictures } - end - end - - def browse - @resource_picture = ResourcePicture.find(params[:id]) - - respond_to do |format| - format.html { render layout: 'system' } - format.json { render json: @resource_picture } - end - end - end diff --git a/app/controllers/scroll_panels_controller.rb b/app/controllers/scroll_panels_controller.rb index 982e9ff9..f9db91f5 100644 --- a/app/controllers/scroll_panels_controller.rb +++ b/app/controllers/scroll_panels_controller.rb @@ -8,7 +8,6 @@ class ScrollPanelsController < ApplicationController before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy] before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy] end - before_filter :authenticate_admin!, :only => [:list, :browse] def self.model ScrollPanel @@ -30,36 +29,18 @@ class ScrollPanelsController < ApplicationController end end - def list - @scroll_panels = ScrollPanel.all - - respond_to do |format| - format.html { render layout: 'system' }# index.html.erb - format.json { render json: @scroll_panels } - end - end - - def browse - @scroll_panel = ScrollPanel.find(params[:id]) - - respond_to do |format| - format.html { render layout: 'system' } # show.html.erb - format.json { render json: @scroll_panel } - end - end - def new @scroll_panel = ScrollPanel.new @scroll_panel.supply_default respond_to do |format| - format.html # new.html.erb + format.html format.js - format.json { render json: @scroll_panel.scroll_panel_as_json(@author) } + format.json { render json: @scroll_panel.scroll_panel_as_json(@operators.author) } end end def edit - @scroll_panel = ScrollPanel.edit(params[:id], @author) + @scroll_panel = ScrollPanel.edit(params[:id], @operators) respond_to do |format| format.html format.js @@ -70,15 +51,15 @@ class ScrollPanelsController < ApplicationController @scroll_panel = ScrollPanel.new @scroll_panel.supply_default @scroll_panel.attributes = params[:scroll_panel] - @scroll_panel.overwrite @author - @scroll = Scroll.edit(@scroll_panel.scroll_id, @author) if @scroll_panel.scroll_id - @panel = Panel.show(@scroll_panel.panel_id, @author) if @scroll_panel.panel_id + @scroll_panel.overwrite @operators + @scroll = Scroll.edit(@scroll_panel.scroll_id, @operators) if @scroll_panel.scroll_id + @panel = Panel.show(@scroll_panel.panel_id, @operators) if @scroll_panel.panel_id respond_to do |format| - if @scroll_panel.store + if @scroll_panel.store @operators flash[:notice] = I18n.t('flash.notice.created', :model => ScrollPanel.model_name.human) format.html { redirect_to play_scroll_path(@scroll) } - format.json { render json: @scroll_panel.scroll_panel_as_json(@author) } + format.json { render json: @scroll_panel.scroll_panel_as_json(@operators.author) } else flash[:notice] = I18n.t('flash.notice.not_created', :model => ScrollPanel.model_name.human) format.html { render action: "new" } @@ -88,13 +69,13 @@ class ScrollPanelsController < ApplicationController end def update - @scroll_panel = ScrollPanel.edit(params[:id], @author) + @scroll_panel = ScrollPanel.edit(params[:id], @operators) ot = @scroll_panel.t @scroll_panel.attributes = params[:scroll_panel] - @scroll_panel.overwrite @author - @scroll = Scroll.edit(@scroll_panel.scroll_id, @author) if @scroll_panel.scroll_id + @scroll_panel.overwrite @operators + @scroll = Scroll.edit(@scroll_panel.scroll_id, @operators) if @scroll_panel.scroll_id respond_to do |format| - if @scroll_panel.store ot + if @scroll_panel.store @operators, ot flash[:notice] = I18n.t('flash.notice.updated', :model => ScrollPanel.model_name.human) format.html { redirect_to play_scroll_path(@scroll) } format.json { head :ok } @@ -107,8 +88,8 @@ class ScrollPanelsController < ApplicationController end def destroy - @scroll_panel = ScrollPanel.edit(params[:id], @author) - @scroll = Scroll.edit(@scroll_panel.scroll_id, @author) if @scroll_panel.scroll_id + @scroll_panel = ScrollPanel.edit(params[:id], @operators) + @scroll = Scroll.edit(@scroll_panel.scroll_id, @operators) if @scroll_panel.scroll_id respond_to do |format| if @scroll_panel.destroy_and_shorten flash[:notice] = I18n.t('flash.notice.destroyed', :model => ScrollPanel.model_name.human) diff --git a/app/controllers/scrolls_controller.rb b/app/controllers/scrolls_controller.rb index 6d96c1d3..80e40a8d 100644 --- a/app/controllers/scrolls_controller.rb +++ b/app/controllers/scrolls_controller.rb @@ -8,7 +8,6 @@ class ScrollsController < ApplicationController before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy] before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy] end - before_filter :authenticate_admin!, :only => [:list, :browse] def self.model Scroll @@ -25,7 +24,9 @@ class ScrollsController < ApplicationController format.html { @scroll = @item if @operators.author - @new_panels = Panel.mylist(@operators.author, 1, 5) + controller = Pettanr::Application::manifest.controller_managers['home'] + @action = controller.open('panels', {:page => 1, :page_size => 5}, @operators) + @new_panels_filer = @action.filer end } format.json { render json: @item.to_json(Scroll.show_json_opt) } @@ -75,36 +76,18 @@ class ScrollsController < ApplicationController end end - def list - @scrolls = Scroll.all - - respond_to do |format| - format.html { render layout: 'system' }# index.html.erb - format.json { render json: @scrolls } - end - end - - def browse - @scroll = Scroll.find(params[:id]) - - respond_to do |format| - format.html { render layout: 'system' } # show.html.erb - format.json { render json: @scroll } - end - end - def new @scroll = Scroll.new @scroll.supply_default respond_to do |format| - format.html # new.html.erb + format.html format.js format.json { render json: @scroll.to_json(Scroll.show_json_opt) } end end def edit - @scroll = Scroll.edit(params[:id], @author) + @scroll = Scroll.edit(params[:id], @operators) respond_to do |format| format.html format.js @@ -131,9 +114,9 @@ class ScrollsController < ApplicationController end def update - @scroll = Scroll.edit(params[:id], @author) + @scroll = Scroll.edit(params[:id], @operators) @scroll.attributes = params[:scroll] - @scroll.overwrite @author + @scroll.overwrite @operators respond_to do |format| if @scroll.save flash[:notice] = I18n.t('flash.notice.updated', :model => Scroll.model_name.human) @@ -148,7 +131,7 @@ class ScrollsController < ApplicationController end def destroy - @scroll = Scroll.edit(params[:id], @author) + @scroll = Scroll.edit(params[:id], @operators) respond_to do |format| if @scroll.destroy_with_scroll_panel flash[:notice] = I18n.t('flash.notice.destroyed', :model => Scroll.model_name.human) diff --git a/app/controllers/sheet_panels_controller.rb b/app/controllers/sheet_panels_controller.rb index c0d5565a..5d512783 100644 --- a/app/controllers/sheet_panels_controller.rb +++ b/app/controllers/sheet_panels_controller.rb @@ -8,7 +8,6 @@ class SheetPanelsController < ApplicationController before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy] before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy] end - before_filter :authenticate_admin!, :only => [:list, :browse] def self.model SheetPanel @@ -26,25 +25,7 @@ class SheetPanelsController < ApplicationController @sheet_panel = @item } format_prof format - format.json { render json: @item.sheet_panel_as_json(@author) } - end - end - - def list - @sheet_panels = SheetPanel.all - - respond_to do |format| - format.html { render layout: 'system' }# index.html.erb - format.json { render json: @sheet_panels } - end - end - - def browse - @sheet_panel = SheetPanel.find(params[:id]) - - respond_to do |format| - format.html { render layout: 'system' } # show.html.erb - format.json { render json: @sheet_panel } + format.json { render json: @item.sheet_panel_as_json(@operators.author) } end end @@ -52,14 +33,14 @@ class SheetPanelsController < ApplicationController @sheet_panel = SheetPanel.new @sheet_panel.supply_default respond_to do |format| - format.html # new.html.erb + format.html format.js - format.json { render json: @sheet_panel.sheet_panel_as_json(@author) } + format.json { render json: @sheet_panel.sheet_panel_as_json(@operators.author) } end end def edit - @sheet_panel = SheetPanel.edit(params[:id], @author) + @sheet_panel = SheetPanel.edit(params[:id], @operators) respond_to do |format| format.html format.js @@ -70,15 +51,15 @@ class SheetPanelsController < ApplicationController @sheet_panel = SheetPanel.new @sheet_panel.supply_default @sheet_panel.attributes = params[:sheet_panel] - @sheet_panel.overwrite @author - @sheet = Sheet.edit(@sheet_panel.sheet_id, @author) if @sheet_panel.sheet_id - @panel = Panel.show(@sheet_panel.panel_id, @author) if @sheet_panel.panel_id + @sheet_panel.overwrite @operators + @sheet = Sheet.edit(@sheet_panel.sheet_id, @operators) if @sheet_panel.sheet_id + @panel = Panel.show(@sheet_panel.panel_id, @operators) if @sheet_panel.panel_id respond_to do |format| - if @sheet_panel.store + if @sheet_panel.store @operators flash[:notice] = I18n.t('flash.notice.created', :model => SheetPanel.model_name.human) format.html { redirect_to play_sheet_path(@sheet) } - format.json { render json: @sheet_panel.sheet_panel_as_json(@author) } + format.json { render json: @sheet_panel.sheet_panel_as_json(@operators.author) } else flash[:notice] = I18n.t('flash.notice.not_created', :model => SheetPanel.model_name.human) format.html { render action: "new" } @@ -88,13 +69,13 @@ class SheetPanelsController < ApplicationController end def update - @sheet_panel = SheetPanel.edit(params[:id], @author) + @sheet_panel = SheetPanel.edit(params[:id], @operators) ot = @sheet_panel.t @sheet_panel.attributes = params[:sheet_panel] - @sheet_panel.overwrite @author - @sheet = Sheet.edit(@sheet_panel.sheet_id, @author) if @sheet_panel.sheet_id + @sheet_panel.overwrite @operators + @sheet = Sheet.edit(@sheet_panel.sheet_id, @operators) if @sheet_panel.sheet_id respond_to do |format| - if @sheet_panel.store ot + if @sheet_panel.store @operators, ot flash[:notice] = I18n.t('flash.notice.updated', :model => SheetPanel.model_name.human) format.html { redirect_to play_sheet_path(@sheet) } format.json { head :ok } @@ -107,8 +88,8 @@ class SheetPanelsController < ApplicationController end def destroy - @sheet_panel = SheetPanel.edit(params[:id], @author) - @sheet = Sheet.edit(@sheet_panel.sheet_id, @author) if @sheet_panel.sheet_id + @sheet_panel = SheetPanel.edit(params[:id], @operators) + @sheet = Sheet.edit(@sheet_panel.sheet_id, @operators) if @sheet_panel.sheet_id respond_to do |format| if @sheet_panel.destroy_and_shorten flash[:notice] = I18n.t('flash.notice.destroyed', :model => SheetPanel.model_name.human) diff --git a/app/controllers/sheets_controller.rb b/app/controllers/sheets_controller.rb index db4777e5..c6929a9b 100644 --- a/app/controllers/sheets_controller.rb +++ b/app/controllers/sheets_controller.rb @@ -8,7 +8,6 @@ class SheetsController < ApplicationController before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy] before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy] end - before_filter :authenticate_admin!, :only => [:list, :browse] def self.model Sheet @@ -38,7 +37,7 @@ class SheetsController < ApplicationController end def play - @sheet = Sheet.show(params[:id], [@user, @admin]) + @sheet = Sheet.show(params[:id], @operators) respond_to do |format| format.html { if @author @@ -59,36 +58,18 @@ class SheetsController < ApplicationController end end - def list - @sheets = Sheet.all - - respond_to do |format| - format.html { render layout: 'system' }# index.html.erb - format.json { render json: @sheets } - end - end - - def browse - @sheet = Sheet.find(params[:id]) - - respond_to do |format| - format.html { render layout: 'system' } # show.html.erb - format.json { render json: @sheet } - end - end - def new @sheet = Sheet.new @sheet.supply_default respond_to do |format| - format.html # new.html.erb + format.html format.js format.json { render json: @sheet.to_json(Sheet.show_json_opt) } end end def edit - @sheet = Sheet.edit(params[:id], @author) + @sheet = Sheet.edit(params[:id], @operators) respond_to do |format| format.html format.js @@ -105,7 +86,7 @@ class SheetsController < ApplicationController @prm = params[:sheet] || jsn respond_to do |format| - if @sheet.store @prm, @author + if @sheet.store @prm, @operators flash[:notice] = I18n.t('flash.notice.created', :model => Sheet.model_name.human) format.html { redirect_to @sheet } format.json { render json: @sheet.to_json(Sheet.show_json_opt), status: :created, location: @sheet } @@ -118,14 +99,14 @@ class SheetsController < ApplicationController end def update - @sheet = Sheet.edit(params[:id], @author) + @sheet = Sheet.edit(params[:id], @operators) jsn = nil if params[:json] jsn = JSON.parse(params[:json]) end @prm = params[:sheet] || jsn respond_to do |format| - if @sheet.store @prm, @author + if @sheet.store @prm, @operators flash[:notice] = I18n.t('flash.notice.updated', :model => Sheet.model_name.human) format.html { redirect_to @sheet } format.json { head :ok } @@ -138,7 +119,7 @@ class SheetsController < ApplicationController end def destroy - @sheet = Sheet.edit(params[:id], @author) + @sheet = Sheet.edit(params[:id], @operators) respond_to do |format| if @sheet.destroy_with_sheet_panel flash[:notice] = I18n.t('flash.notice.destroyed', :model => Sheet.model_name.human) diff --git a/app/controllers/stories_controller.rb b/app/controllers/stories_controller.rb index 85c47d64..378a275c 100644 --- a/app/controllers/stories_controller.rb +++ b/app/controllers/stories_controller.rb @@ -8,7 +8,6 @@ class StoriesController < ApplicationController before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy] before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy] end - before_filter :authenticate_admin!, :only => [:list, :browse] def self.model Story @@ -58,36 +57,18 @@ class StoriesController < ApplicationController end end - def list - @stories = Story.all - - respond_to do |format| - format.html { render layout: 'system' }# index.html.erb - format.json { render json: @stories } - end - end - - def browse - @story = Story.find(params[:id]) - - respond_to do |format| - format.html { render layout: 'system' } # show.html.erb - format.json { render json: @story } - end - end - def new @story = Story.new @story.supply_default respond_to do |format| - format.html # new.html.erb + format.html format.js format.json { render json: @story.to_json(Story.show_json_opt) } end end def edit - @story = Story.edit(params[:id], @author) + @story = Story.edit(params[:id], @operators) respond_to do |format| format.html format.js @@ -99,10 +80,10 @@ class StoriesController < ApplicationController @story.supply_default @story.attributes = params[:story] @story.overwrite - @comic = Comic.edit(@story.comic_id, @author) if @story.comic_id + @comic = Comic.edit(@story.comic_id, @operators) if @story.comic_id respond_to do |format| - if @story.store @author + if @story.store @operators flash[:notice] = I18n.t('flash.notice.created', :model => Story.model_name.human) format.html { redirect_to play_story_path(@story, :page => @story.t.to_i + 1) } format.json { render json: @story.to_json(Story.show_json_opt) } @@ -115,12 +96,12 @@ class StoriesController < ApplicationController end def update - @story = Story.edit(params[:id], @author) + @story = Story.edit(params[:id], @operators) ot = @story.t @story.attributes = params[:story] @story.overwrite respond_to do |format| - if @story.store @author, ot + if @story.store @operators, ot flash[:notice] = I18n.t('flash.notice.updated', :model => Story.model_name.human) format.html { redirect_to play_story_path(@story, :page => @story.t.to_i + 1) } format.json { head :ok } @@ -133,7 +114,7 @@ class StoriesController < ApplicationController end def destroy - @story = Story.edit(params[:id], @author) + @story = Story.edit(params[:id], @operators) respond_to do |format| if @story.destroy_and_shorten flash[:notice] = I18n.t('flash.notice.destroyed', :model => Story.model_name.human) diff --git a/app/controllers/story_sheets_controller.rb b/app/controllers/story_sheets_controller.rb index d4f6cf5e..c9762289 100644 --- a/app/controllers/story_sheets_controller.rb +++ b/app/controllers/story_sheets_controller.rb @@ -8,7 +8,6 @@ class StorySheetsController < ApplicationController before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy] before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy] end - before_filter :authenticate_admin!, :only => [:list, :browse] def self.model StorySheet @@ -30,29 +29,11 @@ class StorySheetsController < ApplicationController end end - def list - @story_sheets = StorySheet.all - - respond_to do |format| - format.html { render layout: 'system' }# index.html.erb - format.json { render json: @story_sheets } - end - end - - def browse - @story_sheet = StorySheet.find(params[:id]) - - respond_to do |format| - format.html { render layout: 'system' } # show.html.erb - format.json { render json: @story_sheet } - end - end - def new @story_sheet = StorySheet.new @story_sheet.supply_default respond_to do |format| - format.html # new.html.erb + format.html format.js format.json { render json: @story_sheet.to_json(StorySheet.show_json_opt) } end @@ -70,12 +51,12 @@ class StorySheetsController < ApplicationController @story_sheet = StorySheet.new @story_sheet.supply_default @story_sheet.attributes = params[:story_sheet] - @story_sheet.overwrite @author - @story = Story.edit(@story_sheet.story_id, @author) if @story_sheet.story_id - @sheet = Sheet.show(@story_sheet.sheet_id, @author) if @story_sheet.sheet_id + @story_sheet.overwrite @operators + @story = Story.edit(@story_sheet.story_id, @operators) if @story_sheet.story_id + @sheet = Sheet.show(@story_sheet.sheet_id, @operators) if @story_sheet.sheet_id respond_to do |format| - if @story_sheet.store + if @story_sheet.store @operators flash[:notice] = I18n.t('flash.notice.created', :model => StorySheet.model_name.human) format.html { redirect_to play_story_path(@story) } format.json { render json: @story_sheet.to_json(StorySheet.show_json_opt) } @@ -88,13 +69,13 @@ class StorySheetsController < ApplicationController end def update - @story_sheet = StorySheet.edit(params[:id], @author) + @story_sheet = StorySheet.edit(params[:id], @operators) ot = @story_sheet.t @story_sheet.attributes = params[:story_sheet] - @story_sheet.overwrite @author - @story = Story.edit(@story_sheet.story_id, @author) if @story_sheet.story_id + @story_sheet.overwrite @operators + @story = Story.edit(@story_sheet.story_id, @operators) if @story_sheet.story_id respond_to do |format| - if @story_sheet.store ot + if @story_sheet.store @operators, ot flash[:notice] = I18n.t('flash.notice.updated', :model => StorySheet.model_name.human) format.html { redirect_to play_story_path(@story) } format.json { head :ok } @@ -107,8 +88,8 @@ class StorySheetsController < ApplicationController end def destroy - @story_sheet = StorySheet.edit(params[:id], @author) - @story = Story.edit(@story_sheet.story_id, @author) if @story_sheet.story_id + @story_sheet = StorySheet.edit(params[:id], @operators) + @story = Story.edit(@story_sheet.story_id, @operators) if @story_sheet.story_id respond_to do |format| if @story_sheet.destroy_and_shorten flash[:notice] = I18n.t('flash.notice.destroyed', :model => StorySheet.model_name.human) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 5a57fd5f..007d3acb 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -79,16 +79,14 @@ module ApplicationHelper end def panel_editor_javascript_include_tags - writing_format_list = Pettanr::Application::manifest.list_managers[WritingFormat.item_name].open('public_list', nil, nil, @operators) - speech_balloon_template_list = Pettanr::Application::manifest.list_managers[SpeechBalloonTemplate.item_name].open('public_list', nil, nil, @operators) - writing_format_list.items.map {|wf| + WritingFormat.enable_list().map {|wf| # javascript_include_tag wf.engine_name javascript_include_tag wf.engine_name + "/application" }.join("\n") + - speech_balloon_template_list.items.map {|sbt| + SpeechBalloonTemplate.enable_list().map {|sbt| stylesheet_link_tag sbt.engine_name + "/application" }.join("\n") + - speech_balloon_template_list.items.map {|sbt| + SpeechBalloonTemplate.enable_list().map {|sbt| javascript_include_tag sbt.engine_name + "/application" }.join("\n") end diff --git a/app/models/artist.rb b/app/models/artist.rb index 87b70828..38061332 100644 --- a/app/models/artist.rb +++ b/app/models/artist.rb @@ -25,7 +25,7 @@ class Artist < Pettanr::Owner end def self.list_where - 'artists.provider = 0' + 'artists.provider_id is null' end def self.list_order diff --git a/app/models/ground_color.rb b/app/models/ground_color.rb index 1a757fa6..ea59cc4d 100644 --- a/app/models/ground_color.rb +++ b/app/models/ground_color.rb @@ -12,8 +12,8 @@ class GroundColor < Pettanr::Content validates :z, :presence => true, :numericality => {:greater_than => 0} validates :t, :presence => true, :numericality => {:greater_than_or_equal_to => 0} - def owner_model - self.panel + def self.owner_model + Panel end def self.valid_encode_columns @@ -144,7 +144,7 @@ class GroundColor < Pettanr::Content {:include => {:panel => {:include => {:author => {}}} }} end - def store au + def store operators if self.new_record? self.panel.ground_colors.build(self.attributes) else @@ -156,11 +156,11 @@ class GroundColor < Pettanr::Content break end end - self.panel.store({}, au) + self.panel.store({}, operators) end - def remove au - self.panel.remove_element(self, au) + def remove operators + self.panel.remove_element(self, operators) end def scenario diff --git a/app/models/ground_picture.rb b/app/models/ground_picture.rb index 98e0abbc..0959c612 100644 --- a/app/models/ground_picture.rb +++ b/app/models/ground_picture.rb @@ -14,8 +14,8 @@ class GroundPicture < Pettanr::Content @@repeat_texts = ['repeat', 'repeat-x', 'repeat-y', 'no-repeat'] - def owner_model - self.panel + def self.owner_model + Panel end def self.valid_encode_columns @@ -116,7 +116,7 @@ class GroundPicture < Pettanr::Content {:include => {:panel => {:include => {:author => {}}}, :picture => {:include => {:artist => {}, :license => {}}} }} end - def store au + def store operators if self.new_record? self.panel.ground_pictures.build(self.attributes) else @@ -128,11 +128,11 @@ class GroundPicture < Pettanr::Content break end end - self.panel.store({}, au) + self.panel.store({}, operators) end - def remove au - self.panel.remove_element(self, au) + def remove operators + self.panel.remove_element(self, operators) end def scenario diff --git a/app/models/license_group.rb b/app/models/license_group.rb index b628f017..23873475 100644 --- a/app/models/license_group.rb +++ b/app/models/license_group.rb @@ -25,6 +25,12 @@ class LicenseGroup < Pettanr::Item 'license_groups.name asc' end + def self.enable_list + LicenseGroup.find(:all).delete_if {|lg| + lg.enable? == false + } + end + def self.list_opt {:include => {:licenses => {}}} end @@ -41,6 +47,21 @@ class LicenseGroup < Pettanr::Item {:include => {:licenses => {}}} end + def engine_name + Pettanr::Application.manifest.system_resources.license_groups[self.classname] + end + + def enable? + Pettanr::Application.manifest.system_resources.license_groups.include? self.classname + end + + def engine_module_name + self.engine_name.camelize + end + + def engine + Object.const_get self.engine_module_name + end def self.store name, attr #ライセンスデータがあるとライセンスグループのデータ生成で邪魔するので移しておく lattr = attr["licenses_attributes"] diff --git a/app/models/original_picture.rb b/app/models/original_picture.rb index 5b3b29dd..3004bb58 100644 --- a/app/models/original_picture.rb +++ b/app/models/original_picture.rb @@ -18,14 +18,14 @@ class OriginalPicture < Pettanr::Content def supply_default end - def overwrite ar + def overwrite operators self.uploaded_at = Time.now - self.artist_id = ar.id + return unless operators.artist + self.artist_id = operators.artist.id end def visible? operators - return false unless super - false + self.own? operators end def filename "#{self.id}.#{self.ext}" diff --git a/app/models/panel.rb b/app/models/panel.rb index fe47e368..11ac1120 100644 --- a/app/models/panel.rb +++ b/app/models/panel.rb @@ -48,8 +48,9 @@ class Panel < Pettanr::Content self.publish = 0 end - def overwrite au - self.author_id = au.id + def overwrite operators + return false unless operators.author + self.author_id = operators.author.id end def visible? operators @@ -58,8 +59,8 @@ class Panel < Pettanr::Content self.publish? end - def usable? au - visible? au + def usable? operators + self.visible? operators end def publish? @@ -270,13 +271,13 @@ class Panel < Pettanr::Content end end - def store attr, au + def store attr, operators if attr == false self.errors.add :base, I18n.t('errors.invalid_json') return false end self.attributes = attr - self.overwrite au + self.overwrite operators res = false Panel.transaction do self.panel_elements.each do |elm| @@ -294,7 +295,7 @@ class Panel < Pettanr::Content res end - def remove_element target, au + def remove_element target, operators ct = target.t cz = target.z panel_attributes = {} @@ -312,7 +313,7 @@ class Panel < Pettanr::Content panel_attributes[elm.class.to_s.tableize + '_attributes'] ||= {} panel_attributes[elm.class.to_s.tableize + '_attributes'][elm.id] = attr end - self.store(panel_attributes, au) + self.store(panel_attributes, operators) end def destroy_with_elements diff --git a/app/models/panel_picture.rb b/app/models/panel_picture.rb index a68af587..e74806cf 100644 --- a/app/models/panel_picture.rb +++ b/app/models/panel_picture.rb @@ -14,8 +14,8 @@ class PanelPicture < Pettanr::Content validates :z, :presence => true, :numericality => {:greater_than => 0} validates :t, :presence => true, :numericality => {:greater_than_or_equal_to => 0} - def owner_model - self.panel + def self.owner_model + Panel end def self.valid_encode_columns @@ -147,7 +147,7 @@ class PanelPicture < Pettanr::Content {:include => {:panel => {:include => {:author => {}}}, :picture => {:include => {:artist => {}, :license => {}}} }} end - def store au + def store operators if self.new_record? self.panel.panel_pictures.build(self.attributes) else @@ -159,11 +159,11 @@ class PanelPicture < Pettanr::Content break end end - self.panel.store({}, au) + self.panel.store({}, operators) end - def remove au - self.panel.remove_element(self, au) + def remove operators + self.panel.remove_element(self, operators) end def scenario diff --git a/app/models/picture.rb b/app/models/picture.rb index 5aeeee30..89b95fb2 100644 --- a/app/models/picture.rb +++ b/app/models/picture.rb @@ -41,9 +41,9 @@ class Picture < Pettanr::Content return true end - def showable? au = nil + def showable? operators = nil return false unless self.original_picture - return true if self.own?(au) + return true if self.own?(operators) self.enable? and self.head? end diff --git a/app/models/scroll_panel.rb b/app/models/scroll_panel.rb index b628edf1..9ff9fc24 100644 --- a/app/models/scroll_panel.rb +++ b/app/models/scroll_panel.rb @@ -8,8 +8,8 @@ class ScrollPanel < Pettanr::Content validates :author_id, :presence => true, :numericality => true, :existence => {:both => false} validates :t, :presence => true, :numericality => {:greater_than_or_equal_to => 0} - def owner_model - self.scroll + def self.owner_model + Scroll end def supply_default @@ -18,9 +18,9 @@ class ScrollPanel < Pettanr::Content self.t = nil end - def overwrite au - return false unless au - self.author_id = au.id + def overwrite operators + return false unless operators.author + self.author_id = operators.author.id end def visible? operators @@ -181,15 +181,15 @@ class ScrollPanel < Pettanr::Content end end - def allow? + def allow? operators return nil if self.scroll_id == nil or self.panel_id == nil - self.scroll.own?(self.author) and self.panel.usable?(self.author) + self.scroll.own?(operators) and self.panel.usable?(operators) end - def store old_t = nil + def store operators, old_t = nil res = false ScrollPanel.transaction do - case self.allow? + case self.allow? operators when true self.rotate old_t when false diff --git a/app/models/sheet.rb b/app/models/sheet.rb index b79dd525..3161dab7 100644 --- a/app/models/sheet.rb +++ b/app/models/sheet.rb @@ -38,9 +38,9 @@ class Sheet < Pettanr::Content self.visible = 0 if self.visible.blank? end - def overwrite au - return false unless au - self.author_id = au.id + def overwrite operators + return false unless operators.author + self.author_id = operators.author.id end def visible? operators @@ -49,8 +49,8 @@ class Sheet < Pettanr::Content self.visible > 0 end - def usable? au - visible? au + def usable? operators + self.visible? operators end def symbol_filename @@ -186,18 +186,18 @@ class Sheet < Pettanr::Content end end - def store attr, au + def store attr, operators if attr == false self.errors.add :base, I18n.t('errors.invalid_json') return false end self.attributes = attr - self.overwrite au + self.overwrite operators res = false Sheet.transaction do self.sheet_elements.each do |elm| elm.new_sheet = self - elm.boost au + elm.boost operators end res = self.save unless validate_child diff --git a/app/models/sheet_panel.rb b/app/models/sheet_panel.rb index 3af52192..b3abfe68 100644 --- a/app/models/sheet_panel.rb +++ b/app/models/sheet_panel.rb @@ -12,8 +12,8 @@ class SheetPanel < Pettanr::Content validates :z, :presence => true, :numericality => {:greater_than => 0} validates :t, :presence => true, :numericality => {:greater_than_or_equal_to => 0} - def owner_model - self.sheet + def self.owner_model + Sheet end def supply_default @@ -30,9 +30,9 @@ class SheetPanel < Pettanr::Content end end - def overwrite au - return false unless au - self.author_id = au.id + def overwrite operators + return false unless operators.author + self.author_id = operators.author.id end def visible? operators @@ -158,9 +158,9 @@ class SheetPanel < Pettanr::Content end end - def boost au + def boost operators if self.panel - self.panel.author_id = au.id + self.panel.author_id = operators.author.id self.panel.panel_elements.each do |elm| elm.new_panel = self elm.boost @@ -246,15 +246,15 @@ class SheetPanel < Pettanr::Content end end - def allow? + def allow? operators return nil if self.sheet_id == nil or self.panel_id == nil - self.sheet.own?(self.author) and self.panel.usable?(self.author) + self.sheet.own?(operators) and self.panel.usable?(operators) end - def store old_t = nil + def store operators, old_t = nil res = false SheetPanel.transaction do - case self.allow? + case self.allow? operators when true self.rotate old_t when false diff --git a/app/models/speech_balloon.rb b/app/models/speech_balloon.rb index c839a97f..63764ddb 100644 --- a/app/models/speech_balloon.rb +++ b/app/models/speech_balloon.rb @@ -16,8 +16,8 @@ class SpeechBalloon < Pettanr::Content validates :t, :presence => true, :numericality => {:greater_than_or_equal_to => 0} validates :settings, :extend_speech_balloon => true - def owner_model - self.panel + def self.owner_model + Panel end def self.valid_encode_columns diff --git a/app/models/speech_balloon_template.rb b/app/models/speech_balloon_template.rb index b2f3d998..dd20d250 100644 --- a/app/models/speech_balloon_template.rb +++ b/app/models/speech_balloon_template.rb @@ -25,16 +25,9 @@ class SpeechBalloonTemplate < Pettanr::Item self.system_picture.tmb_opt_img_tag end - def self.list - opt = {} - opt.merge!(self.list_opt) - opt.merge!({:order => 'speech_balloon_templates.t asc'}) - SpeechBalloonTemplate.find(:all, opt) - end - def self.enable_list - SpeechBalloonTemplate.list.delete_if {|sbt| - Pettanr::Application.manifest.system_resources.speech_balloon_templates[sbt.classname] == nil + SpeechBalloonTemplate.find(:all).delete_if {|sbt| + sbt.enable? == false } end @@ -72,6 +65,10 @@ class SpeechBalloonTemplate < Pettanr::Item Pettanr::Application.manifest.system_resources.speech_balloon_templates[self.classname] end + def enable? + Pettanr::Application.manifest.system_resources.speech_balloon_templates.include? self.classname + end + def engine_module_name self.engine_name.camelize end diff --git a/app/models/story.rb b/app/models/story.rb index 7a9b829f..899ff125 100644 --- a/app/models/story.rb +++ b/app/models/story.rb @@ -8,8 +8,8 @@ class Story < Pettanr::Content validates :visible, :presence => true, :numericality => true, :inclusion => {:in => 0..1} validates :t, :presence => true, :numericality => {:greater_than_or_equal_to => 0} - def owner_model - self.comic + def self.owner_model + Comic end def self.valid_encode_columns @@ -156,15 +156,15 @@ class Story < Pettanr::Content end end - def allow? au + def allow? operators return nil if self.comic_id == nil - self.comic.own?(au) + self.comic.own?(operators) end - def store au, old_t = nil + def store operators, old_t = nil res = false Story.transaction do - case self.allow? au + case self.allow? operators when true self.rotate old_t when false diff --git a/app/models/story_sheet.rb b/app/models/story_sheet.rb index ef1dda8c..02712f69 100644 --- a/app/models/story_sheet.rb +++ b/app/models/story_sheet.rb @@ -8,8 +8,8 @@ class StorySheet < Pettanr::Content validates :author_id, :presence => true, :numericality => true, :existence => {:both => false} validates :t, :presence => true, :numericality => {:greater_than_or_equal_to => 0} - def owner_model - self.story + def self.owner_model + Story end def supply_default @@ -18,9 +18,9 @@ class StorySheet < Pettanr::Content self.t = nil end - def overwrite au - return false unless au - self.author_id = au.id + def overwrite operators + return false unless operators.author + self.author_id = operators.author.id end def visible? operators @@ -185,15 +185,15 @@ class StorySheet < Pettanr::Content end end - def allow? + def allow? operators return nil if self.story_id == nil or self.sheet_id == nil - self.story.own?(self.author) and self.sheet.usable?(self.author) + self.story.own?(operators) and self.sheet.usable?(operators) end - def store old_t = nil + def store operators, old_t = nil res = false StorySheet.transaction do - case self.allow? + case self.allow? operators when true self.rotate old_t when false diff --git a/app/models/system_picture.rb b/app/models/system_picture.rb index 144c152d..b89e595b 100644 --- a/app/models/system_picture.rb +++ b/app/models/system_picture.rb @@ -1,6 +1,6 @@ class SystemPicture < Pettanr::Item has_many :balloons - has_many :balloon_templates + has_many :speech_balloon_templates has_many :licenses validates :ext, :presence => true, :length => {:maximum => 4}, :inclusion => {:in => ['png', 'jpeg', 'gif']} diff --git a/app/models/writing_format.rb b/app/models/writing_format.rb index 88f2016c..cf68b4d1 100644 --- a/app/models/writing_format.rb +++ b/app/models/writing_format.rb @@ -9,10 +9,6 @@ class WritingFormat < Pettanr::Item validates :system_picture_id, :presence => true, :numericality => true, :existence => {:both => false} validates :settings, :presence => true -def self.list - WritingFormat.find :all -end - def self.valid_encode_columns super + ['name', 'classname', 'caption', 'settings'] end @@ -32,8 +28,12 @@ end 'writing_formats.t asc' end +#engine vw +def self.list + self.enable_list +end def self.enable_list - WritingFormat.list.delete_if {|wf| + WritingFormat.find(:all).delete_if {|wf| wf.enable? == false } end diff --git a/app/views/original_picture_license_groups/_allform.html.erb b/app/views/original_picture_license_groups/_allform.html.erb index f21cc9fc..5c6ec22e 100644 --- a/app/views/original_picture_license_groups/_allform.html.erb +++ b/app/views/original_picture_license_groups/_allform.html.erb @@ -3,7 +3,7 @@
<%= f.label :license_group_id %>
- <%= f.collection_select :license_group_id, LicenseGroup.list.map {|l| [l.caption, l.id] }, :last, :first %> + <%= f.collection_select :license_group_id, LicenseGroup.enable_list().map {|l| [l.caption, l.id] }, :last, :first %> <%= f.hidden_field :original_picture_id %>
<%= hidden_field_tag :original_picture_id, @original_picture.id %> diff --git a/app/views/original_picture_license_groups/_form.html.erb b/app/views/original_picture_license_groups/_form.html.erb index d0a50191..732e6156 100644 --- a/app/views/original_picture_license_groups/_form.html.erb +++ b/app/views/original_picture_license_groups/_form.html.erb @@ -4,7 +4,7 @@ - +
<%= t_m 'OriginalPictureLicenseGroup.license_group_id' -%><%= f.collection_select :license_group_id, LicenseGroup.list.map {|l| [l.caption, l.id] }, :last, :first %><%= f.collection_select :license_group_id, LicenseGroup.enable_list().map {|l| [l.caption, l.id] }, :last, :first %> <%= t 'original_picture_license_groups.new.no_blank' %>
diff --git a/app/views/original_pictures/_form.html.erb b/app/views/original_pictures/_form.html.erb index b6295da2..e045829b 100644 --- a/app/views/original_pictures/_form.html.erb +++ b/app/views/original_pictures/_form.html.erb @@ -1,4 +1,4 @@ -<% if @artist -%> +<% if @operators.artist -%> <%= form_tag( original_pictures_path , { :multipart => true, :method => :post }) do %> <% if @original_picture -%> <%= render 'system/error_explanation', :obj => @original_picture %> diff --git a/app/views/scrolls/show.html.erb b/app/views/scrolls/show.html.erb index 8134fa8d..ac1d9f4e 100644 --- a/app/views/scrolls/show.html.erb +++ b/app/views/scrolls/show.html.erb @@ -32,12 +32,8 @@ <%= l @scroll.updated_at %>

-<% if @scroll.own? @author -%> +<% if @scroll.own? @operators -%> <%= link_to t('link.edit'), edit_scroll_path(@scroll) %>

<%= t('scroll_panels.append.new_panels') -%>

- - <% @new_panels.each do |panel| %> - <%= render 'scroll_panels/append_panel', :scroll => @scroll, :panel => panel, :author => @author %> - <% end %> -
+ <%= render 'system/filer', {:filer => @new_panels_filer} %> <% end %> diff --git a/app/views/sheets/_body.html.erb b/app/views/sheets/_body.html.erb index cdc19f27..e1c58dfb 100644 --- a/app/views/sheets/_body.html.erb +++ b/app/views/sheets/_body.html.erb @@ -1,5 +1,5 @@
- <% if sheet.visible? author -%> + <% if sheet.visible? @operators -%> <% sheet.sheet_elements.each do |elm| %> <%= render elm.class.to_s.tableize + '/element', :elm => elm, :author => author %> <% end %> diff --git a/config/routes.rb b/config/routes.rb index 9cf242b9..604cd7b7 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -4,14 +4,14 @@ Pettanr::Application.routes.draw do devise_for :admins devise_for :demand_users - Pettanr::Application.manifest.system_resources.licenses.each do |name, klass| + Pettanr::Application.manifest.system_resources.license_groups.each do |klass, name| mount Module.const_get(klass)::Engine => "/#{name}" end Pettanr::Application.manifest.system_resources.speech_balloon_templates.each do |klass , name| mount Module.const_get(klass)::Engine => "/#{name}" end - resources :authors do + resources :scrolls do new do get :new end @@ -20,44 +20,34 @@ Pettanr::Application.routes.draw do get :show get :count post :create - get :list end member do + get :scroll_panels + get :panels + get :by_author + get :by_panel + get :play get :edit put :update delete :destroy get :browse - get :scrolls - get :scroll_panels - get :comics - get :stories - get :story_sheets - get :sheets - get :sheet_panels - get :panels - get :panel_pictures - get :speech_balloons - get :ground_pictures - get :ground_colors end end - resources :artists do + resources :scroll_panels do new do get :new end collection do get :index get :show - get :count post :create - get :list end member do + get :by_panel + get :by_scroll get :edit put :update delete :destroy - get :browse - get :resource_pictures end end resources :comics do @@ -69,7 +59,6 @@ Pettanr::Application.routes.draw do get :show get :count post :create - get :list end member do get :stories @@ -78,7 +67,6 @@ Pettanr::Application.routes.draw do get :edit put :update delete :destroy - get :browse end end resources :stories do @@ -89,18 +77,16 @@ Pettanr::Application.routes.draw do get :index get :show post :create - get :list end member do - get :play get :story_sheets get :sheets get :by_sheet get :by_author + get :play get :edit put :update delete :destroy - get :browse end end resources :story_sheets do @@ -111,7 +97,6 @@ Pettanr::Application.routes.draw do get :index get :show post :create - get :list end member do get :by_story @@ -119,7 +104,6 @@ Pettanr::Application.routes.draw do get :edit put :update delete :destroy - get :browse end end resources :sheets do @@ -131,7 +115,6 @@ Pettanr::Application.routes.draw do get :show get :count post :create - get :list end member do get :story_sheets @@ -145,7 +128,6 @@ Pettanr::Application.routes.draw do get :edit put :update delete :destroy - get :browse end end resources :sheet_panels do @@ -156,7 +138,6 @@ Pettanr::Application.routes.draw do get :index get :show post :create - get :list end member do get :by_sheet @@ -164,49 +145,6 @@ Pettanr::Application.routes.draw do get :edit put :update delete :destroy - get :browse - end - end - resources :scrolls do - new do - get :new - end - collection do - get :index - get :show - get :count - post :create - get :list - end - member do - get :play - get :scroll_panels - get :panels - get :by_author - get :by_panel - get :edit - put :update - delete :destroy - get :browse - end - end - resources :scroll_panels do - new do - get :new - end - collection do - get :index - get :show - post :create - get :list - end - member do - get :by_panel - get :by_scroll - get :edit - put :update - delete :destroy - get :browse end end resources :panels do @@ -218,9 +156,16 @@ Pettanr::Application.routes.draw do get :show get :count post :create - get :list end member do + get :scroll_panels + get :scrolls + get :sheet_panels + get :sheets + get :panel_pictures + get :speech_balloons + get :ground_pictures + get :ground_colors get :by_scroll get :by_sheet get :by_author @@ -228,7 +173,6 @@ Pettanr::Application.routes.draw do get :edit put :update delete :destroy - get :browse end end resources :panel_pictures do @@ -239,13 +183,13 @@ Pettanr::Application.routes.draw do get :index get :show post :create - get :list end member do + get :by_panel + get :by_author get :edit put :update delete :destroy - get :browse end end resources :speech_balloons do @@ -256,36 +200,34 @@ Pettanr::Application.routes.draw do get :index get :show post :create - get :list end member do + get :by_panel + get :by_author get :edit put :update delete :destroy - get :browse end end resources :balloons do collection do get :index get :show - get :list end member do - get :browse + #get :by_system_picture end end resources :speeches do collection do get :index get :show - get :list end member do - get :browse + get :by_writing_format end end - resources :ground_colors do + resources :ground_pictures do new do get :new end @@ -294,13 +236,14 @@ Pettanr::Application.routes.draw do get :show end member do + get :by_panel + get :by_author get :edit put :update delete :destroy - get :browse end end - resources :ground_pictures do + resources :ground_colors do new do get :new end @@ -309,10 +252,11 @@ Pettanr::Application.routes.draw do get :show end member do + get :by_panel + get :by_author get :edit put :update delete :destroy - get :browse end end resources :original_pictures do @@ -323,13 +267,23 @@ Pettanr::Application.routes.draw do get :index get :show post :create - get :list end member do get :edit put :update delete :destroy get :history + end + end + resources :pictures do + collection do + get :show + get :credit + get :search + get :list + end + member do + get :credit get :browse end end @@ -340,52 +294,45 @@ Pettanr::Application.routes.draw do get :new post :create get :count - get :list end member do get :by_license + get :by_license_group get :artist delete :destroy get :credit - get :browse end end - resources :pictures do + resources :speech_balloon_templates do collection do + get :index get :show - get :credit - get :search - get :list end member do - get :credit - get :browse + get :speech_balloons + get :panels + get :by_system_picture + delete :destroy end end - resources :speech_balloon_templates do + resources :writing_formats do collection do get :index get :show - get :list end member do + get :speeches get :by_system_picture - get :speech_balloons - get :panels - get :browse - delete :destroy end end - resources :writing_formats do + resources :license_groups do collection do get :index get :show - get :list end member do - get :by_system_picture - get :speeches - get :browse + get :licenses + delete :destroy end end resources :licenses do @@ -393,42 +340,78 @@ Pettanr::Application.routes.draw do get :index get :show get :search - get :list end member do - get :browse + get :resource_pictures + get :by_license_group + get :by_system_picture end end - resources :license_groups do + resources :authors do + new do + get :new + end collection do get :index get :show - get :list + get :count + post :create end member do - get :browse + get :scrolls + get :scroll_panels + get :comics + get :stories + get :story_sheets + get :sheets + get :sheet_panels + get :panels + get :panel_pictures + get :speech_balloons + get :ground_pictures + get :ground_colors + get :edit + put :update delete :destroy end end - resources :original_picture_license_groups do + resources :artists do new do - post :new + get :new end collection do + get :index + get :show + get :count post :create end + member do + get :resource_pictures + get :edit + put :update + delete :destroy + end end resources :system_pictures do collection do get :index get :show - get :list end member do - get :browse + #get :balloons + get :speech_balloon_templates + get :licenses delete :destroy end end + resources :original_picture_license_groups do + new do + post :new + end + collection do + post :create + end + end resources :provider_sources do collection do get :index diff --git a/lib/content.rb b/lib/content.rb index 7b5b00b0..45e0aaf0 100644 --- a/lib/content.rb +++ b/lib/content.rb @@ -2,10 +2,18 @@ class Pettanr::Content < Pettanr::Item self.abstract_class = true # ClassMethods + def self.owner_model + nil + end + def self.owner_type :author end + def self.content? + true + end + def self.operator operators case self.owner_type when :author @@ -30,7 +38,7 @@ class Pettanr::Content < Pettanr::Item #InstanceMethods def owner_model - self + self.class.owner_model ? self.__send__(self.class.owner_model.item_name) : self end def visible? operators diff --git a/lib/item.rb b/lib/item.rb index 3716f0a4..5e4aa45e 100644 --- a/lib/item.rb +++ b/lib/item.rb @@ -18,6 +18,14 @@ class Pettanr::Item < ActiveRecord::Base self.singular.underscore end + def self.item? + true + end + + def self.content? + false + end + def self.path_name with_engine = false self.plural.underscore end diff --git a/lib/manifest/controller.rb b/lib/manifest/controller.rb index fff689e5..cfb5124d 100644 --- a/lib/manifest/controller.rb +++ b/lib/manifest/controller.rb @@ -55,6 +55,7 @@ module Pettanr end list_name = @controller_manifest.list_name action_name @list = @manifest.list_managers[name].open(list_name, params[:page], params[:page_size], operators) + raise "undefined controller for #{@item_name}::#{action_name}\nconf:#{@controller_conf}\n" unless @actions[action_name] @actions[action_name].new action_name, name, operators, @list, @controller_conf, @manifest end diff --git a/lib/manifest/filer.rb b/lib/manifest/filer.rb index 811435af..21d94d73 100644 --- a/lib/manifest/filer.rb +++ b/lib/manifest/filer.rb @@ -355,9 +355,14 @@ module Pettanr @date = date @edit = edit @manifest = manifest - @file_items = @items.map {|item| - FileItem.new item, operators, symbol, caption, summary, icon, date, edit, manifest - } + begin + @file_items = @items.map {|item| + FileItem.new item, operators, symbol, caption, summary, icon, date, edit, manifest + } + rescue + raise "List define err for #{@item_name} in #{@items}\n" + + end end def model_name diff --git a/lib/manifest/list.rb b/lib/manifest/list.rb index 88ca897f..8707b4c0 100644 --- a/lib/manifest/list.rb +++ b/lib/manifest/list.rb @@ -16,6 +16,10 @@ module Pettanr @model = @item_name.classify.constantize @offset = (@page -1) * @page_size @table_name = @model.table_name + if @model.content? + @owner_model = @model.owner_model + @owner_table_name = @owner_model.table_name if @owner_model + end end def page_number prm = nil @@ -36,7 +40,7 @@ module Pettanr end def includes - @model.list_opt + @owner_model ? {@owner_model.item_name => {}} : {} end def order @@ -48,7 +52,8 @@ module Pettanr end def paginate - Kaminari.paginate_array(Array.new(@model.where(self.where()).includes(self.includes).count, nil)).page(@offset).per(@page_size) + c = @model.where(self.where()).includes(self.includes).count + Kaminari.paginate_array(Array.new(c, nil)).page(@offset).per(@page_size) end end @@ -56,25 +61,6 @@ module Pettanr class PublicList < BaseList end - class SystemResourceList < BaseList - def items - @model.where(self.where()).includes(@model.list_opt).order(@model.order).offset(@offset).limit(@page_size).delete_if {|sbt| - Pettanr::Application.manifest.system_resources.speech_balloon_templates[sbt.classname] == nil - } - end - - def all_items - @model.where(self.where()).includes(@model.list_opt).order(@model.order).delete_if {|sbt| - Pettanr::Application.manifest.system_resources.speech_balloon_templates[sbt.classname] == nil - } - end - - def paginate - Kaminari.paginate_array(Array.new(@model.where(self.where()).includes(@model.list_opt).count, nil)).page(@offset).per(@page_size) - end - - end - class PrivateList < BaseList def where case @model.owner_type @@ -83,7 +69,8 @@ module Pettanr when :artist operator = @operators.artist end - [@model.plural + '.' + @model.owner_type.to_s + '_id = ?', operator.id] + t = @owner_model ? @owner_table_name : @table_name + [t + '.' + @model.owner_type.to_s + '_id = ?', operator.id] end end @@ -97,18 +84,19 @@ module Pettanr @association_model_name = @association_conf['model'] @association_model = @association_model_name.classify.constantize @foreign_key = @association_conf['foreign_key'] - @with_model_name = @association_conf['with'] end def where parent_item w = @model.list_where w += ' and ' unless w.blank? + t = @owner_model ? @owner_table_name : @table_name [w + @association_model_name + '.' + @foreign_key + ' = ?', parent_item.id] end def includes - w = @with_model_name ? {@with_model_name.classify.constantize.table_name => {}} : {} - {@association_model.table_name => w } + @with_model_name ? {@with_model_name.classify.constantize.table_name => {}} : {} + w = @owner_model ? {@owner_model.item_name => {}} : {} + w.merge({@association_model.table_name => {} }) end def items parent_item @@ -116,7 +104,7 @@ module Pettanr end def paginate parent_item - Kaminari.paginate_array(Array.new(@model.where(self.where(parent_item)).includes(self.includes).count, nil)).page(@offset).per(@page_size) + Kaminari.paginate_array(Array.new(@model.where(self.where(parent_item).includes(self.includes)).count, nil)).page(@offset).per(@page_size) end end @@ -138,8 +126,8 @@ module Pettanr end def includes - w = @with_model_name ? {@with_model_name => {}} : {} - {@from => w } + w = @owner_model ? {@owner_model.item_name => {}} : {} + w.merge({@from => {} }) end def items filter_item @@ -147,45 +135,46 @@ module Pettanr end def paginate filter_item - Kaminari.paginate_array(Array.new(@model.where(self.where(filter_item)).includes(self.includes).count, nil)).page(@offset).per(@page_size) + Kaminari.paginate_array(Array.new(@model.where(self.where(filter_item).includes(self.includes)).count, nil)).page(@offset).per(@page_size) end end - class WithFilterList < FilterList + class ThroughFilterList < FilterList def initialize page, page_size, operators, item_name, list_name, conf, manifest super - @with = @list_list_conf['with'] + @through = @list_list_conf['through'] end def includes - {@from => {@with => {}} } + {@through => {@from => {}} } end - end - - class ThroughFilterList < FilterList - def initialize page, page_size, operators, item_name, list_name, conf, manifest - super - @through = @list_list_conf['through'] + def where filter_item + w = @model.list_where + w += ' and ' unless w.blank? + [w + @through + '.' + @filter_key + ' = ?', filter_item.id] end + end + + class ElementFilterList < FilterList def includes - {@through => {@from => {}} } + {@owner_model.item_name => {}} end def where filter_item w = @model.list_where w += ' and ' unless w.blank? - [w + @through + '.' + @filter_key + ' = ?', filter_item.id] + [w + @owner_table_name + '.' + @filter_key + ' = ?', filter_item.id] end end @@types = { - 'public' => PublicList, 'system_resource' => SystemResourceList, 'private' => PrivateList, - 'has_many' => HasManyList, 'filter' => FilterList, 'with_filter' => WithFilterList, - 'through_filter' => ThroughFilterList + 'public' => PublicList, 'private' => PrivateList, + 'has_many' => HasManyList, 'filter' => FilterList, + 'through_filter' => ThroughFilterList, 'element_filter' => ElementFilterList } def initialize list_manifest @list_manifest = list_manifest @@ -200,6 +189,7 @@ module Pettanr end def open list_name, page, page_size, operators + raise "undefined list for #{@item_name}::#{list_name}\nconf:#{@list_conf}\n" unless @lists[list_name] @lists[list_name].new page, page_size, operators, @item_name, list_name, @list_conf, @manifest end diff --git a/lib/manifest/manifest.rb b/lib/manifest/manifest.rb index b0eb591d..14d43972 100644 --- a/lib/manifest/manifest.rb +++ b/lib/manifest/manifest.rb @@ -48,13 +48,14 @@ module Pettanr end class SystemResources - attr :conf, :licenses, :elements, :speech_balloon_templates, :writing_formats + attr :conf, :license_groups, :elements, :speech_balloon_templates, :writing_formats def initialize system_resource_conf @conf = system_resource_conf || {} - @licenses = @conf['licenses'] || {} + @engine_resources = @conf['engine_resources'] || {} + @license_groups = @engine_resources['license_groups'] || {} + @speech_balloon_templates = @engine_resources['speech_balloon_templates'] || {} + @writing_formats = @engine_resources['writing_formats'] || {} @elements = @conf['elements'] || {} - @speech_balloon_templates = @conf['speech_balloon_templates'] || {} - @writing_formats = @conf['writing_formats'] || {} end end diff --git a/lib/manifest/profiler.rb b/lib/manifest/profiler.rb index 6bccdc29..0b6140ed 100644 --- a/lib/manifest/profiler.rb +++ b/lib/manifest/profiler.rb @@ -120,8 +120,10 @@ module Pettanr def each_has_many @has_many_conf.each do |profiler_list_name| + raise "undefined lists for #{profiler_list_name} in #{@lists}\n" unless @lists[profiler_list_name] model_name = @lists[profiler_list_name]['model_name'] list_name = @lists[profiler_list_name]['list_name'] + raise "undefined has_many list for #{model_name}::#{list_name}\nconf:#{@controller_conf}\n" unless @manifest.list_managers[model_name] list = @manifest.list_managers[model_name].open(list_name, 1, 3, @operators) items = list.items @item has_many_filer = @manifest.filer_managers[model_name].open model_name, items, @operators, nil diff --git a/lib/tasks/licenses.rake b/lib/tasks/licenses.rake index 8caed780..0351a429 100644 --- a/lib/tasks/licenses.rake +++ b/lib/tasks/licenses.rake @@ -1,8 +1,9 @@ namespace :licenses do desc "Import json format license data in license engine" task :import => :environment do - licenses = YAML.load(open(Rails.root + 'config/license.yml').read) - licenses.each do |name, klass| + Pettanr::Application.manifest = JSON.parse(open(Rails.root + 'public/manifest.json').read) + licenses = Pettanr::Application.manifest.system_resources.license_groups + licenses.each do |klass, name| puts name + "\n" system 'rake ' + name + ':import' end @@ -10,8 +11,9 @@ namespace :licenses do desc "Copy migration file for license " task :install => :environment do - licenses = YAML.load(open(Rails.root + 'config/license.yml').read) - licenses.each do |name, klass| + Pettanr::Application.manifest = JSON.parse(open(Rails.root + 'public/manifest.json').read) + licenses = Pettanr::Application.manifest.system_resources.license_groups + licenses.each do |klass, name| puts name + "\n" system 'rake ' + name + ':install:migrations' end diff --git a/lib/tasks/speech_balloons.rake b/lib/tasks/speech_balloons.rake index eb6f9f63..bac19d88 100644 --- a/lib/tasks/speech_balloons.rake +++ b/lib/tasks/speech_balloons.rake @@ -1,8 +1,9 @@ namespace :speech_balloons do desc "Import json format speech balloon data in speech balloon engine" task :import => :environment do - speech_balloons = YAML.load(open(Rails.root + 'config/speech_balloon.yml').read) - speech_balloons.each do |klass , name| + Pettanr::Application.manifest = JSON.parse(open(Rails.root + 'public/manifest.json').read) + speech_balloon_templates = Pettanr::Application.manifest.system_resources.speech_balloon_templates + speech_balloon_templates.each do |klass , name| puts name + "\n" system 'rake ' + name + ':import' end @@ -10,8 +11,9 @@ namespace :speech_balloons do desc "Copy migration file for speech balloon " task :install => :environment do - speech_balloons = YAML.load(open(Rails.root + 'config/speech_balloon.yml').read) - speech_balloons.each do |klass , name| + Pettanr::Application.manifest = JSON.parse(open(Rails.root + 'public/manifest.json').read) + speech_balloon_templates = Pettanr::Application.manifest.system_resources.speech_balloon_templates + speech_balloon_templates.each do |klass , name| puts name + "\n" system 'rake ' + name + ':install:migrations' end diff --git a/public/manifest.json b/public/manifest.json index d8cd3162..232f777d 100644 --- a/public/manifest.json +++ b/public/manifest.json @@ -228,6 +228,54 @@ "list_name": "public_list" } }, + "scroll_panels": { + "type": "list", + "list": { + "list_name": "scroll_panels" + } + }, + "scrolls": { + "type": "list", + "list": { + "list_name": "scrolls" + } + }, + "sheet_panels": { + "type": "list", + "list": { + "list_name": "sheet_panels" + } + }, + "sheets": { + "type": "list", + "list": { + "list_name": "sheets" + } + }, + "panel_pictures": { + "type": "list", + "list": { + "list_name": "panel_pictures" + } + }, + "speech_balloons": { + "type": "list", + "list": { + "list_name": "speech_balloons" + } + }, + "ground_pictures": { + "type": "list", + "list": { + "list_name": "ground_pictures" + } + }, + "ground_colors": { + "type": "list", + "list": { + "list_name": "ground_colors" + } + }, "by_scroll": { "type": "list", "list": { @@ -245,6 +293,12 @@ "list": { "list_name": "by_author" } + }, + "by_speech_balloon_template": { + "type": "list", + "list": { + "list_name": "by_speech_balloon_template" + } } } }, @@ -256,6 +310,18 @@ "list": { "list_name": "public_list" } + }, + "by_panel": { + "type": "list", + "list": { + "list_name": "by_panel" + } + }, + "by_author": { + "type": "list", + "list": { + "list_name": "by_author" + } } } }, @@ -267,6 +333,18 @@ "list": { "list_name": "public_list" } + }, + "by_panel": { + "type": "list", + "list": { + "list_name": "by_panel" + } + }, + "by_author": { + "type": "list", + "list": { + "list_name": "by_author" + } } } }, @@ -278,6 +356,12 @@ "list": { "list_name": "public_list" } + }, + "by_writing_format": { + "type": "list", + "list": { + "list_name": "by_writing_format" + } } } }, @@ -300,6 +384,18 @@ "list": { "list_name": "public_list" } + }, + "by_panel": { + "type": "list", + "list": { + "list_name": "by_panel" + } + }, + "by_author": { + "type": "list", + "list": { + "list_name": "by_author" + } } } }, @@ -311,6 +407,18 @@ "list": { "list_name": "public_list" } + }, + "by_panel": { + "type": "list", + "list": { + "list_name": "by_panel" + } + }, + "by_author": { + "type": "list", + "list": { + "list_name": "by_author" + } } } }, @@ -357,6 +465,18 @@ "list": { "list_name": "public_list" } + }, + "speech_balloons": { + "type": "list", + "list": { + "list_name": "speech_balloons" + } + }, + "panels": { + "type": "list", + "list": { + "list_name": "panels" + } } } }, @@ -368,6 +488,18 @@ "list": { "list_name": "public_list" } + }, + "speeches": { + "type": "list", + "list": { + "list_name": "speeches" + } + }, + "by_system_picture": { + "type": "list", + "list": { + "list_name": "by_system_picture" + } } } }, @@ -379,6 +511,12 @@ "list": { "list_name": "public_list" } + }, + "licenses": { + "type": "list", + "list": { + "list_name": "licenses" + } } } }, @@ -390,6 +528,24 @@ "list": { "list_name": "public_list" } + }, + "resource_pictures": { + "type": "list", + "list": { + "list_name": "resource_pictures" + } + }, + "by_license_group": { + "type": "list", + "list": { + "list_name": "by_license_group" + } + }, + "by_system_picture": { + "type": "list", + "list": { + "list_name": "by_system_picture" + } } } }, @@ -401,6 +557,60 @@ "list": { "list_name": "public_list" } + }, + "scrolls": { + "type": "list", + "list": { + "list_name": "scrolls" + } + }, + "comics": { + "type": "list", + "list": { + "list_name": "comics" + } + }, + "stories": { + "type": "list", + "list": { + "list_name": "stories" + } + }, + "sheets": { + "type": "list", + "list": { + "list_name": "sheets" + } + }, + "panels": { + "type": "list", + "list": { + "list_name": "panels" + } + }, + "panel_pictures": { + "type": "list", + "list": { + "list_name": "panel_pictures" + } + }, + "speech_balloons": { + "type": "list", + "list": { + "list_name": "speech_balloons" + } + }, + "ground_pictures": { + "type": "list", + "list": { + "list_name": "ground_pictures" + } + }, + "ground_colors": { + "type": "list", + "list": { + "list_name": "ground_colors" + } } } }, @@ -412,6 +622,12 @@ "list": { "list_name": "public_list" } + }, + "resource_pictures": { + "type": "list", + "list": { + "list_name": "resource_pictures" + } } } }, @@ -434,2730 +650,2117 @@ "list": { "list_name": "private_list" } - } - } - } - }, - "lists": { - "scroll": { - "default_page_size": 25, - "max_page_size": 100, - "lists": { - "public_list": { - "type": "public" - }, - "private_list": { - "type": "private" }, "scroll_panels": { - "type": "has_many", - "association_name": "scroll_panels" + "item_name": "scroll_panel", + "type": "list", + "list": { + "list_name": "private_list" + } }, - "panels": { - "type": "has_many", - "association_name": "panels" + "comics": { + "item_name": "comic", + "type": "list", + "list": { + "list_name": "private_list" + } }, - "by_author": { - "type": "filter", - "from": "author", - "filter_key": "author_id" + "stories": { + "item_name": "story", + "type": "list", + "list": { + "list_name": "private_list" + } }, - "by_panel": { - "type": "through_filter", - "from": "panel", - "through": "scroll_panels", - "filter_key": "panel_id" - } - } - }, - "scroll_panel": { - "default_page_size": 20, - "lists": { - "public_list": { - "type": "public" + "story_sheets": { + "item_name": "story_sheet", + "type": "list", + "list": { + "list_name": "private_list" + } }, - "private_list": { - "type": "private" + "sheets": { + "item_name": "sheet", + "type": "list", + "list": { + "list_name": "private_list" + } }, - "by_scroll": { - "type": "filter", - "from": "scroll", - "filter_key": "scroll_id" + "sheet_panels": { + "item_name": "sheet_panel", + "type": "list", + "list": { + "list_name": "private_list" + } }, - "by_panel": { - "type": "filter", - "from": "panel", - "filter_key": "panel_id" - } - } - }, - "comic": { - "default_page_size": 20, - "lists": { - "public_list": { - "type": "public" + "panels": { + "item_name": "panel", + "type": "list", + "list": { + "list_name": "private_list" + } }, - "private_list": { - "type": "private" + "panel_pictures": { + "item_name": "panel_picture", + "type": "list", + "list": { + "list_name": "private_list" + } }, - "stories": { - "type": "has_many", - "association_name": "stories" + "speech_balloons": { + "item_name": "speech_balloon", + "type": "list", + "list": { + "list_name": "private_list" + } }, - "by_author": { - "type": "filter", - "from": "author", - "filter_key": "author_id" - } - } - }, - "story": { - "default_page_size": 20, - "lists": { - "public_list": { - "type": "public" + "speeches": { + "item_name": "speech", + "type": "list", + "list": { + "list_name": "private_list" + } }, - "private_list": { - "type": "private" + "balloons": { + "item_name": "balloon", + "type": "list", + "list": { + "list_name": "private_list" + } }, - "story_sheets": { - "type": "has_many", - "association_name": "story_sheets" + "ground_pictures": { + "item_name": "ground_picture", + "type": "list", + "list": { + "list_name": "private_list" + } }, - "sheets": { - "type": "has_many", - "association_name": "sheets" + "ground_colors": { + "item_name": "ground_color", + "type": "list", + "list": { + "list_name": "private_list" + } }, - "by_comic": { - "type": "filter", - "from": "comic", - "filter_key": "comic_id" + "original_pictures": { + "item_name": "original_picture", + "type": "list", + "list": { + "list_name": "private_list" + } }, - "by_sheet": { - "type": "through_filter", - "from": "sheet", - "through": "sheet_panels", - "filter_key": "sheet_id" + "resource_pictures": { + "item_name": "resource_picture", + "type": "list", + "list": { + "list_name": "private_list" + } } } - }, - "story_sheet": { - "default_page_size": 20, - "lists": { - "public_list": { - "type": "public" - }, - "private_list": { - "type": "private" - }, - "by_story": { - "type": "filter", - "from": "story", - "filter_key": "story_id" + } + }, + "models": { + "Scroll": "scroll", + "scroll": { + "class_name": "Scroll", + "table_name": "scrolls", + "associations": { + "belongs_to": { + "author": { + "id_column": "author_id" + } }, - "by_sheet": { - "type": "filter", - "with": "story", - "from": "sheet", - "filter_key": "sheet_id" + "has_many": { + "scroll_panels": { + "foreign_key": "scroll_id", + "model": "scroll_panel" + }, + "panels": { + "through": "scroll_panel", + "foreign_key": "scroll_id", + "model": "panel" + } } - } - }, - "sheet": { - "default_page_size": 20, - "lists": { - "public_list": { - "type": "public" - }, - "private_list": { - "type": "private" - }, - "story_sheets": { - "type": "has_many", - "association_name": "story_sheets" + }, + "attributes": { + "id": { + "type": "number", + "primary_key": 1, + "rules": { + "number": true + } }, - "stories": { - "type": "has_many", - "association_name": "stories" + "title": { + "type": "text", + "rules": { + "required": true + } }, - "sheet_panels": { - "type": "has_many", - "association_name": "sheet_panels" + "description": { + "type": "text", + "rules": {} }, - "panels": { - "type": "has_many", - "association_name": "panels" + "visible": { + "type": "number", + "rules": { + "required": true, + "number": true + }, + "source": { + "type": "magic_number", + "key": "scroll_visible_items" + } }, - "by_story": { - "type": "through_filter", - "from": "story", - "through": "story_sheets", - "filter_key": "story_id" + "author_id": { + "type": "number", + "rules": { + "required": true, + "number": true + } }, - "by_panel": { - "type": "through_filter", - "from": "panel", - "through": "sheet_panels", - "filter_key": "panel_id" + "created_at": { + "type": "datetime" }, - "by_author": { - "type": "filter", - "from": "author", - "filter_key": "author_id" + "updated_at": { + "type": "datetime" } - } - }, - "sheet_panel": { - "default_page_size": 20, - "lists": { - "public_list": { - "type": "public" - }, - "private_list": { - "type": "private" - }, - "by_sheet": { - "type": "filter", - "association_name": "sheet_panels", - "from": "sheet", - "filter_key": "sheet_id" + }, + "select": { + "list": { + "name": "public" }, - "by_panel": { - "type": "filter", - "from": "panel", - "filter_key": "panel_id" + "caption": { + "type": "column", + "name": "title" } } }, - "panel": { - "default_page_size": 20, - "lists": { - "public_list": { - "type": "public" - }, - "scroll_panels": { - "type": "has_many", - "association_name": "scroll_panels" + "ScrollPanel": "scroll_panel", + "scroll_panel": { + "class_name": "ScrollPanel", + "table_name": "scroll_panels", + "associations": { + "belongs_to": { + "panel": { + "id_column": "panel_id" + }, + "scroll": { + "id_column": "scroll_id" + } }, - "scrolls": { - "type": "has_many", - "association_name": "scrolls" + "has_many": {} + }, + "attributes": { + "id": { + "type": "number", + "primary_key": 1, + "rules": { + "number": true + } }, - "sheet_panels": { - "type": "has_many", - "association_name": "sheet_panels" + "scroll_id": { + "type": "number", + "rules": { + "required": true, + "number": true + } }, - "sheets": { - "type": "has_many", - "association_name": "sheets" + "panel_id": { + "type": "number", + "rules": { + "required": true, + "number": true + } }, - "by_scroll": { - "type": "through_filter", - "from": "scroll", - "through": "scroll_panels", - "filter_key": "scroll_id" + "t": { + "type": "number", + "rules": { + "required": true, + "number": true, + "min": 0 + } }, - "by_sheet": { - "type": "through_filter", - "from": "sheet", - "through": "sheet_panels", - "filter_key": "sheet_id" + "author_id": { + "type": "number", + "rules": { + "required": true, + "number": true + } }, - "by_author": { - "type": "filter", - "from": "author", - "filter_key": "author_id" - } - } - }, - "panel_picture": { - "default_page_size": 20, - "lists": { - "public_list": { - "type": "public" - } - } - }, - "speech_balloon": { - "default_page_size": 20, - "lists": { - "public_list": { - "type": "public" - } - } - }, - "speech": { - "default_page_size": 20, - "lists": { - "public_list": { - "type": "public" - } - } - }, - "balloon": { - "default_page_size": 20, - "lists": { - "public_list": { - "type": "public" + "created_at": { + "type": "datetime" + }, + "updated_at": { + "type": "datetime" } } }, - "ground_picture": { - "default_page_size": 20, - "lists": { - "public_list": { - "type": "public" + "Comic": "comic", + "comic": { + "class_name": "Comic", + "table_name": "comics", + "associations": { + "belongs_to": { + "author": { + "id_column": "author_id" + } + }, + "has_many": { + "stories": { + "foreign_key": "comic_id", + "model": "story" + } + }, + "has_many_through": {} + }, + "attributes": { + "id": { + "type": "number", + "primary_key": 1, + "rules": { + "number": true + } + }, + "title": { + "type": "text", + "rules": { + "required": true + } + }, + "description": { + "type": "text", + "rules": {} + }, + "visible": { + "type": "number", + "rules": { + "required": true, + "number": true + }, + "source": { + "type": "magic_number", + "key": "comic_visible_items" + } + }, + "author_id": { + "type": "number", + "rules": { + "required": true, + "number": true + } + }, + "created_at": { + "type": "datetime" + }, + "updated_at": { + "type": "datetime" } - } - }, - "ground_color": { - "default_page_size": 20, - "lists": { - "public_list": { - "type": "public" + }, + "select": { + "method": "list", + "caption": { + "type": "column", + "name": "title" } } }, - "original_picture": { - "default_page_size": 20, - "lists": { - "private_list": { - "type": "private" + "Story": "story", + "story": { + "class_name": "Story", + "table_name": "stories", + "associations": { + "belongs_to": { + "comic": { + "id_column": "comic_id" + } + }, + "has_many": { + "story_sheets": { + "foreign_key": "story_id", + "list_method": "list_by_story" + }, + "sheets": { + "through": "story_sheets", + "foreign_key": "story_id", + "list_method": "list_by_story" + } } - } - }, - "picture": {}, - "resource_picture": { - "default_page_size": 20, - "lists": { - "public_list": { - "type": "public" + }, + "attributes": { + "id": { + "type": "number", + "primary_key": 1, + "rules": { + "number": true + } }, - "by_license": { - "type": "filter", - "from": "license", - "filter_key": "license_id" + "comic_id": { + "type": "number", + "rules": { + "number": true + } }, - "by_artist": { - "type": "filter", - "from": "artist", - "filter_key": "artist_id" - } - } - }, - "speech_balloon_template": { - "default_page_size": 20, - "lists": { - "public_list": { - "type": "public" + "title": { + "type": "text", + "rules": {} + }, + "description": { + "type": "text", + "rules": {} + }, + "t": { + "type": "number", + "rules": { + "required": true, + "number": true, + "min": 0 + } + }, + "visible": { + "type": "number", + "rules": { + "required": true, + "number": true + }, + "source": { + "type": "magic_number", + "key": "story_visible_items" + } + }, + "created_at": { + "type": "datetime" + }, + "updated_at": { + "type": "datetime" } - } - }, - "writing_format": { - "default_page_size": 20, - "lists": { - "public_list": { - "type": "public" + }, + "select": { + "method": "list", + "caption": { + "type": "method", + "name": "title_with_t" } } }, - "license_group": { - "default_page_size": 20, - "lists": { - "public_list": { - "type": "public" + "StorySheet": "story_sheet", + "story_sheet": { + "class_name": "StorySheet", + "table_name": "story_sheets", + "associations": { + "belongs_to": { + "story": { + "id_column": "story_id" + }, + "sheet": { + "id_column": "sheet_id" + } + }, + "has_many": {} + }, + "attributes": { + "id": { + "type": "number", + "primary_key": 1, + "rules": { + "number": true + } + }, + "story_id": { + "type": "number", + "rules": { + "number": true + } + }, + "sheet_id": { + "type": "number", + "rules": { + "number": true + } + }, + "t": { + "type": "number", + "rules": { + "required": true, + "number": true, + "min": 0 + } + }, + "author_id": { + "type": "number", + "rules": { + "required": true, + "number": true + } + }, + "created_at": { + "type": "datetime" + }, + "updated_at": { + "type": "datetime" } } }, - "license": { - "default_page_size": 20, - "lists": { - "public_list": { - "type": "public" + "Sheet": "sheet", + "sheet": { + "class_name": "Sheet", + "table_name": "sheets", + "associations": { + "belongs_to": { + "author": { + "id_column": "author_id" + } + }, + "has_many": { + "story_sheets": { + "foreign_key": "story_id", + "list_method": "list_by_sheet" + }, + "stories": { + "through": "story_sheets", + "foreign_key": "sheet_id", + "list_method": "list_by_sheet" + }, + "sheet_panels": { + "foreign_key": "sheet_id", + "list_method": "list_by_sheet" + }, + "panels": { + "through": "sheet_panels", + "foreign_key": "sheet_id", + "list_method": "list_by_sheet" + } } - } - }, - "author": { - "default_page_size": 20, - "lists": { - "public_list": { - "type": "public" + }, + "attributes": { + "id": { + "type": "number", + "primary_key": 1, + "rules": { + "number": true + } + }, + "caption": { + "type": "text", + "rules": {} + }, + "width": { + "type": "number", + "rules": { + "required": true, + "number": true + } + }, + "height": { + "type": "number", + "rules": { + "required": true, + "number": true + } + }, + "visible": { + "type": "number", + "rules": { + "required": true, + "number": true + }, + "source": { + "type": "magic_number", + "key": "sheet_visible_items" + } + }, + "author_id": { + "type": "number", + "rules": { + "required": true, + "number": true + } + }, + "created_at": { + "type": "datetime" + }, + "updated_at": { + "type": "datetime" } - } - }, - "artist": { - "default_page_size": 20, - "lists": { - "public_list": { - "type": "public" + }, + "select": { + "method": "list", + "caption": { + "type": "column", + "name": "caption" } } }, - "system_picture": { - "default_page_size": 20, - "lists": { - "public_list": { - "type": "public" + "SheetPanel": "sheet_panel", + "sheet_panel": { + "class_name": "SheetPanel", + "table_name": "sheet_panels", + "associations": { + "belongs_to": { + "sheet": { + "id_column": "sheet_id" + }, + "panel": { + "id_column": "panel_id" + } + }, + "has_many": {} + }, + "attributes": { + "id": { + "type": "number", + "primary_key": 1, + "rules": { + "number": true + } + }, + "sheet_id": { + "type": "number", + "rules": { + "number": true + } + }, + "panel_id": { + "type": "number", + "rules": { + "number": true + } + }, + "x": { + "type": "number", + "rules": { + "required": true, + "number": true + } + }, + "y": { + "type": "number", + "rules": { + "required": true, + "number": true + } + }, + "z": { + "type": "number", + "rules": { + "required": true, + "number": true, + "min": 1 + } + }, + "t": { + "type": "number", + "rules": { + "required": true, + "number": true, + "min": 0 + } + }, + "author_id": { + "type": "number", + "rules": { + "number": true + } + }, + "created_at": { + "type": "datetime" + }, + "updated_at": { + "type": "datetime" } } - } - }, - "system_resources": { - "licenses": { - "pettanr_creative_commons_v30_licenses": "PettanrCreativeCommonsV30Licenses", - "pettanr_pettan_commons_v01_licenses": "PettanrPettanCommonsV01Licenses", - "pettanr_pettan_protected_v01_licenses": "PettanrPettanProtectedV01Licenses", - "pettanr_pettan_public_v01_licenses": "PettanrPettanPublicV01Licenses", - "pettanr_public_domain_v01_licenses": "PettanrPublicDomainV01Licenses", - "pettanr_unknown_v01_licenses": "PettanrUnknownV01Licenses" }, - "elements": { - "PanelPicture": "panel_pictures", - "SpeechBalloon": "speech_balloons", - "GroundPicture": "ground_pictures", - "GroundColor": "ground_colors" - }, - "speech_balloon_templates": { - "CircleSpeechBalloon": "circle_speech_balloon", - "PlainSpeechBalloon": "plain_speech_balloon", - "SquareSpeechBalloon": "square_speech_balloon" - }, - "writing_formats": { - "SimpleFormat": "pettanr_simple_format" - } - }, - "magic_numbers": { - "run_mode": 1, - "thumbnail_width": 64, - "thumbnail_height": 64, - "profile": { - "users": { - "caption": "ペンギン王国", - "url": "http://localhost:3001/", - "description": "ペンギン王国はペンギン素材を豊富に用意したペンギンマニアのサイトです。" + "Panel": "panel", + "panel": { + "class_name": "Panel", + "table_name": "panels", + "associations": { + "belongs_to": { + "author": { + "id_column": "author_id" + } + }, + "has_many": { + "scroll_panels": { + "foreign_key": "panel_id", + "list_method": "list_by_panel" + }, + "scrolls": { + "through": "scroll_panels", + "foreign_key": "panel_id", + "list_method": "list_by_panel" + }, + "sheet_panels": { + "foreign_key": "panel_id", + "list_method": "list_by_panel" + }, + "sheets": { + "through": "sheet_panels", + "foreign_key": "panel_id", + "list_method": "list_by_panel" + }, + "panel_pictures": { + "foreign_key": "panel_id", + "list_method": "list_by_panel" + }, + "speech_balloons": { + "foreign_key": "panel_id", + "list_method": "list_by_panel" + }, + "ground_pictures": { + "foreign_key": "panel_id", + "list_method": "list_by_panel" + }, + "ground_colors": { + "foreign_key": "panel_id", + "list_method": "list_by_panel" + } + } }, - "admins": { - "caption": "site name for admin", - "url": "http://your.site.url/admins/", - "description": "admin register" + "attributes": { + "id": { + "type": "number", + "primary_key": 1, + "rules": { + "number": true + } + }, + "width": { + "type": "number", + "rules": { + "required": true, + "number": true, + "min": 1 + } + }, + "height": { + "type": "number", + "rules": { + "required": true, + "number": true, + "min": 1 + } + }, + "border": { + "type": "number", + "rules": { + "required": true, + "number": true, + "min": 0 + } + }, + "caption": { + "type": "text", + "rules": {} + }, + "publish": { + "type": "number", + "rules": { + "required": true, + "number": true + }, + "source": { + "type": "magic_number", + "key": "panel_visible_items" + } + }, + "author_id": { + "type": "number", + "rules": { + "required": true, + "number": true + } + }, + "created_at": { + "type": "datetime" + }, + "updated_at": { + "type": "datetime" + } }, - "demand_users": { - "caption": "provider name", - "url": "http://your.site.url/demanders/", - "description": "provider description" + "select": { + "method": "list", + "caption": { + "type": "method", + "name": "plain_scenario" + } } }, - "provider_sources": [ - "http://sourceforge.jp/projects/pettanr/wiki/ProviderSource/attach/provider_source.json" - ] - }, - "select_items": { - "provider_status_status_items": [ - [ - "select_items.provider_status.status.waiting", - 0 - ], - [ - "select_items.provider_status.status.receiving", - 1 - ] - ], - "demander_status_status_items": [ - [ - "select_items.demander_status.status.waiting", - 0 - ], - [ - "select_items.demander_status.status.rejected", - 1 - ], - [ - "select_items.demander_status.status.requesting", - 2 - ], - [ - "select_items.demander_status.status.approved", - 3 - ] - ], - "scroll_visible_items": [ - [ - "select_items.scroll.visible.private", - 0 - ], - [ - "select_items.scroll.visible.public", - 1 - ] - ], - "comic_visible_items": [ - [ - "select_items.comic.visible.private", - 0 - ], - [ - "select_items.comic.visible.public", - 1 - ] - ], - "story_visible_items": [ - [ - "select_items.story.visible.private", - 0 - ], - [ - "select_items.story.visible.public", - 1 - ] - ], - "sheet_visible_items": [ - [ - "select_items.sheet.visible.private", - 0 - ], - [ - "select_items.sheet.visible.public", - 1 - ] - ], - "panel_visible_items": [ - [ - "select_items.panel.visible.private", - 0 - ], - [ - "select_items.panel.visible.public", - 1 - ] - ], - "ground_picture_repeat_items": [ - [ - "select_items.ground_pictures.repeat.repeat", - 0 - ], - [ - "select_items.ground_pictures.repeat.repeat-x", - 1 - ], - [ - "select_items.ground_pictures.repeat.repeat-y", - 2 - ], - [ - "select_items.ground_pictures.repeat.no-repeat", - 3 - ] - ], - "ground_color_orientation_items": [ - [ - "select_items.ground_color.orientation.horizontal", - 0 - ], - [ - "select_items.ground_color.orientation.vertical", - 1 - ] - ], - "speech_font_size_items": [ - [ - "select_items.speeches.font_size.ultra_small", - 0.2 - ], - [ - "select_items.speeches.font_size.very_small", - 0.4 - ], - [ - "select_items.speeches.font_size.small", - 0.6 - ], - [ - "select_items.speeches.font_size.semi_small", - 0.8 - ], - [ - "select_items.speeches.font_size.normal", - 1 - ], - [ - "select_items.speeches.font_size.semi_large", - 1.5 - ], - [ - "select_items.speeches.font_size.large", - 2 - ], - [ - "select_items.speeches.font_size.very_large", - 3.5 - ], - [ - "select_items.speeches.font_size.ultra_large", - 5 - ] - ], - "speech_text_align_items": [ - [ - "select_items.speeches.text_align.none", - 0 - ], - [ - "select_items.speeches.text_align.left", - 1 - ], - [ - "select_items.speeches.text_align.right", - 2 - ], - [ - "select_items.speeches.text_align.center", - 3 - ] - ] - }, - "locals": { - "profilers": { - "scroll": { - "lists": { - "scroll_panels.by_scroll": { - "model_name": "scroll_panel", - "list_name": "by_scroll" - }, - "panels.by_scroll": { - "model_name": "panel", - "list_name": "by_scroll" + "PanelPicture": "panel_picture", + "panel_picture": { + "class_name": "PanelPicture", + "table_name": "panel_pictures", + "associations": { + "belongs_to": { + "panel": { + "id_column": "panel_id" } }, - "columns": [ - "id", - "title", - "description", - "visible", - "author_id", - "created_at", - "updated_at" - ], - "associations": { - "belongs_to": [ - "author" - ], - "has_many": [ - "scroll_panels.by_scroll", - "panels.by_scroll" - ] - } - }, - "scroll_panel": { - "lists": {}, - "columns": [ - "id", - "scroll_id", - "panel_id", - "t", - "author_id", - "created_at", - "updated_at" - ], - "associations": { - "belongs_to": [ - "scroll", - "panel" - ], - "has_many": [] - } + "has_many": {} }, - "comic": { - "lists": { - "stories.by_comic": { - "model_name": "story", - "list_name": "by_comic" + "attributes": { + "id": { + "type": "number", + "primary_key": 1, + "rules": { + "number": true } }, - "columns": [ - "id", - "title", - "description", - "visible", - "author_id", - "created_at", - "updated_at" - ], - "associations": { - "belongs_to": [ - "author" - ], - "has_many": [ - "stories.by_comic" - ] + "panel_id": { + "type": "number", + "rules": { + "number": true + } + }, + "picture_id": { + "type": "number", + "rules": { + "required": true, + "number": true + } + }, + "caption": { + "type": "text", + "rules": {} + }, + "x": { + "type": "number", + "rules": { + "required": true, + "number": true + } + }, + "y": { + "type": "number", + "rules": { + "required": true, + "number": true + } + }, + "width": { + "type": "number", + "rules": { + "required": true, + "number": true + } + }, + "height": { + "type": "number", + "rules": { + "required": true, + "number": true + } + }, + "link": { + "type": "text", + "rules": { + "url": true + } + }, + "z": { + "type": "number", + "rules": { + "required": true, + "number": true, + "min": 1 + } + }, + "t": { + "type": "number", + "rules": { + "required": true, + "number": true, + "min": 0 + } + }, + "created_at": { + "type": "datetime" + }, + "updated_at": { + "type": "datetime" } - }, - "story": { - "lists": { - "story_sheets.by_story": { - "model_name": "story_sheet", - "list_name": "by_story" - }, - "sheets.by_story": { - "model_name": "sheet", - "list_name": "by_sheet" + } + }, + "SpeechBalloon": "speech_balloon", + "speech_balloon": { + "class_name": "SpeechBalloon", + "table_name": "speech_balloons", + "extend": "classname", + "associations": { + "belongs_to": { + "panel": { + "id_column": "panel_id" } }, - "columns": [ - "id", - "comic_id", - "title", - "description", - "t", - "visible", - "created_at", - "updated_at" - ], - "associations": { - "belongs_to": [ - "comic" - ], - "has_many": [ - "story_sheets.by_story", - "sheets.by_story" - ] + "has_many": {}, + "has_one": { + "balloon": { + "foreign_key": "speech_balloon_id", + "list_method": "list_by_speech_balloon" + }, + "speech": { + "foreign_key": "speech_balloon_id", + "list_method": "list_by_speech_balloon" + } } }, - "story_sheet": { - "lists": {}, - "columns": [ - "id", - "story_id", - "sheet_id", - "t", - "author_id", - "created_at", - "updated_at" - ], - "associations": { - "belongs_to": [ - "story", - "sheet" - ], - "has_many": [] - } - }, - "sheet": { - "lists": { - "story_sheets.by_sheet": { - "model_name": "story_sheet", - "list_name": "by_sheet" - }, - "stories.by_sheet": { - "model_name": "story", - "list_name": "by_sheet" - }, - "sheet_panels.by_sheet": { - "model_name": "sheet_panel", - "list_name": "by_sheet" - }, - "panels.by_sheet": { - "model_name": "panel", - "list_name": "by_sheet" + "attributes": { + "id": { + "type": "number", + "primary_key": 1, + "rules": { + "number": true } }, - "columns": [ - "id", - "caption", - "width", - "height", - "visible", - "author_id", - "created_at", - "updated_at" - ], - "associations": { - "belongs_to": [ - "author" - ], - "has_many": [ - "story_sheets.by_sheet", - "stories.by_sheet", - "sheet_panels.by_sheet", - "panels.by_sheet" - ] + "panel_id": { + "type": "number", + "rules": { + "number": true + } + }, + "speech_balloon_template_id": { + "type": "number", + "rules": { + "required": true, + "number": true + } + }, + "classname": { + "type": "text", + "rules": { + "required": true + } + }, + "z": { + "type": "number", + "rules": { + "required": true, + "number": true, + "min": 1 + } + }, + "t": { + "type": "number", + "rules": { + "required": true, + "number": true, + "min": 0 + } + }, + "settings": { + "type": "text", + "rules": {} + }, + "caption": { + "type": "text", + "rules": {} + }, + "created_at": { + "type": "datetime" + }, + "updated_at": { + "type": "datetime" } }, - "sheet_panel": { - "lists": {}, - "columns": [ - "id", - "sheet_id", - "panel_id", - "x", - "y", - "z", - "t", - "author_id", - "created_at", - "updated_at" - ], - "associations": { - "belongs_to": [ - "sheet", - "panel" - ], - "has_many": [] + "select": { + "method": "list", + "caption": { + "type": "method", + "name": "plain_scenario" } - }, - "panel": { - "lists": { - "scroll_panels.by_panel": { - "model_name": "scroll_panel", - "list_name": "by_panel" - }, - "scrolls.by_panel": { - "model_name": "scroll", - "list_name": "by_panel" - }, - "sheet_panels.by_panel": { - "model_name": "sheet_panel", - "list_name": "by_panel" - }, - "sheets.by_panel": { - "model_name": "sheet", - "list_name": "by_panel" - }, - "panel_pictures.by_panel": { - "model_name": "panel_picture", - "list_name": "by_panel" - }, - "speech_balloons.by_panel": { - "model_name": "speech_balloon", - "list_name": "by_panel" - }, - "ground_pictures.by_panel": { - "model_name": "ground_picture", - "list_name": "by_panel" + } + }, + "Balloon": "balloon", + "balloon": { + "class_name": "Balloon", + "table_name": "balloons", + "associations": { + "belongs_to": { + "speech_balloon": { + "id_column": "speech_balloon_id" }, - "ground_colors.by_panel": { - "model_name": "ground_color", - "list_name": "by_panel" + "system_picture": { + "id_column": "system_picture_id" } }, - "columns": [ - "id", - "width", - "height", - "border", - "caption", - "publish", - "author_id", - "created_at", - "updated_at" - ], - "associations": { - "belongs_to": [ - "author" - ], - "has_many": [ - "scroll_panels.by_panel", - "scrolls.by_panel", - "sheet_panels.by_panel", - "sheets.by_panel", - "panel_pictures.by_panel", - "speech_balloons.by_panel", - "ground_pictures.by_panel", - "ground_colors.by_panel" - ] - } + "has_many": {} }, - "panel_picture": { - "lists": { - "scroll_panels.by_scroll": { - "model_name": "scroll_panel", - "list_name": "by_scroll" - }, - "panels.by_scroll": { - "model_name": "panel", - "list_name": "by_scroll" + "attributes": { + "id": { + "type": "number", + "primary_key": 1, + "rules": { + "number": true } }, - "columns": [ - "id", - "panel_id", - "picture_id", - "caption", - "x", - "y", - "width", - "height", - "link", - "z", - "t", - "created_at", - "updated_at" - ], - "associations": { - "belongs_to": [ - "panel" - ], - "has_many": [] - } - }, - "speech_balloon": { - "lists": { - "scroll_panels.by_scroll": { - "model_name": "scroll_panel", - "list_name": "by_scroll" - }, - "panels.by_scroll": { - "model_name": "panel", - "list_name": "by_scroll" + "speech_balloon_id": { + "type": "number", + "rules": { + "number": true } }, - "columns": [ - "id", - "panel_id", - "speech_balloon_template_id", - "classname", - "z", - "t", - "settings", - "caption", - "created_at", - "updated_at" - ], - "associations": { - "belongs_to": [ - "panel" - ], - "has_many": [], - "has_one": [ - "balloon", - "speech" - ] - } - }, - "speech": { - "lists": { - "scroll_panels.by_scroll": { - "model_name": "scroll_panel", - "list_name": "by_scroll" - }, - "panels.by_scroll": { - "model_name": "panel", - "list_name": "by_scroll" + "system_picture_id": { + "type": "number", + "rules": { + "required": true, + "number": true } }, - "columns": [ - "id", - "speech_balloon_id", - "writing_format_id", - "content", - "font_size", - "text_align", - "fore_color", - "x", - "y", - "width", - "height", - "quotes", - "settings", - "created_at", - "updated_at" - ], - "associations": { - "belongs_to": [ - "speech_balloon", - "writing_format" - ], - "has_many": [] + "x": { + "type": "number", + "rules": { + "required": true, + "number": true + } + }, + "y": { + "type": "number", + "rules": { + "required": true, + "number": true + } + }, + "width": { + "type": "number", + "rules": { + "required": true, + "number": true, + "min": 1 + } + }, + "height": { + "type": "number", + "rules": { + "required": true, + "number": true, + "min": 1 + } + }, + "r": { + "type": "number", + "rules": { + "required": true, + "number": true + } + }, + "settings": { + "type": "text", + "rules": {} + }, + "created_at": { + "type": "datetime" + }, + "updated_at": { + "type": "datetime" } - }, - "balloon": { - "lists": { - "scroll_panels.by_scroll": { - "model_name": "scroll_panel", - "list_name": "by_scroll" + } + }, + "Speech": "speech", + "speech": { + "class_name": "Speech", + "table_name": "speeches", + "associations": { + "belongs_to": { + "speech_balloon": { + "id_column": "speech_balloon_id" }, - "panels.by_scroll": { - "model_name": "panel", - "list_name": "by_scroll" + "writing_format": { + "id_column": "writing_format_id" } }, - "columns": [ - "id", - "speech_balloon_id", - "system_picture_id", - "x", - "y", - "width", - "height", - "r", - "settings", - "created_at", - "updated_at" - ], - "associations": { - "belongs_to": [ - "speech_balloon", - "system_picture" - ], - "has_many": [] - } + "has_many": {} }, - "ground_picture": { - "lists": { - "scroll_panels.by_scroll": { - "model_name": "scroll_panel", - "list_name": "by_scroll" + "attributes": { + "id": { + "type": "number", + "primary_key": 1, + "rules": { + "number": true + } + }, + "speech_balloon_id": { + "type": "number", + "rules": { + "number": true + } + }, + "writing_format_id": { + "type": "number", + "source": { + "type": "model", + "model": "writing_format", + "method": "enable_list", + "caption": "caption" }, - "panels.by_scroll": { - "model_name": "panel", - "list_name": "by_scroll" + "rules": { + "required": true, + "number": true } }, - "columns": [ - "id", - "panel_id", - "picture_id", - "caption", - "repeat", - "x", - "y", - "z", - "t", - "created_at", - "updated_at" - ], - "associations": { - "belongs_to": [ - "panel" - ], - "has_many": [] - } - }, - "ground_color": { - "lists": { - "scroll_panels.by_scroll": { - "model_name": "scroll_panel", - "list_name": "by_scroll" + "content": { + "type": "text", + "rules": {} + }, + "font_size": { + "type": "float", + "rules": { + "required": true, + "number": true, + "min": 0 }, - "panels.by_scroll": { - "model_name": "panel", - "list_name": "by_scroll" + "source": { + "type": "magic_number", + "key": "speech_font_size_items" } }, - "columns": [ - "id", - "panel_id", - "caption", - "code", - "orientation", - "xy", - "wh", - "z", - "t", - "created_at", - "updated_at" - ], - "associations": { - "belongs_to": [ - "panel" - ], - "has_many": [] - } - }, - "original_picture": { - "lists": { - "scroll_panels.by_scroll": { - "model_name": "scroll_panel", - "list_name": "by_scroll" + "text_align": { + "type": "number", + "rules": { + "required": true, + "number": true, + "range": [ + 0, + 3 + ] }, - "panels.by_scroll": { - "model_name": "panel", - "list_name": "by_scroll" + "source": { + "type": "magic_number", + "key": "speech_text_align_items" } }, - "columns": [ - "id", - "ext", - "width", - "height", - "filesize", - "artist_id", - "md5", - "uploaded_at", - "published_at", - "stopped_at", - "created_at", - "updated_at" - ], - "associations": { - "belongs_to": [ - "artist" - ], - "has_many": [ - "pictures" - ], - "has_one": [ - "resource_picture" - ] - } - }, - "picture": { - "lists": { - "scroll_panels.by_scroll": { - "model_name": "scroll_panel", - "list_name": "by_scroll" - }, - "panels.by_scroll": { - "model_name": "panel", - "list_name": "by_scroll" + "fore_color": { + "type": "number", + "rules": { + "required": true, + "number": true, + "range": [ + 0, + 16777215 + ] } }, - "columns": [ - "id", - "original_picture_id", - "revision", - "ext", - "width", - "height", - "filesize", - "artist_id", - "license_id", - "md5", - "artist_name", - "credit", - "settings", - "classname", - "created_at", - "updated_at" - ], - "associations": { - "belongs_to": [ - "license", - "artist" - ], - "has_many": [], - "has_one": [] - } - }, - "resource_picture": { - "lists": { - "scroll_panels.by_scroll": { - "model_name": "scroll_panel", - "list_name": "by_scroll" - }, - "panels.by_scroll": { - "model_name": "panel", - "list_name": "by_scroll" + "x": { + "type": "number", + "rules": { + "required": true, + "number": true } }, - "columns": [ - "id", - "original_picture_id", - "revision", - "ext", - "width", - "height", - "filesize", - "artist_id", - "license_id", - "md5", - "artist_name", - "credit", - "settings", - "picture_id", - "classname", - "created_at", - "updated_at" - ], - "associations": { - "belongs_to": [ - "license", - "artist" - ], - "has_many": [], - "has_one": [] - } - }, - "speech_balloon_template": { - "lists": { - "scroll_panels.by_scroll": { - "model_name": "scroll_panel", - "list_name": "by_scroll" - }, - "panels.by_scroll": { - "model_name": "panel", - "list_name": "by_scroll" + "y": { + "type": "number", + "rules": { + "required": true, + "number": true } }, - "columns": [ - "id", - "name", - "classname", - "caption", - "t", - "system_picture_id", - "settings", - "created_at", - "updated_at" - ], - "associations": { - "belongs_to": [ - "system_picture" - ], - "has_many": [ - "speech_balloons", - "panels" - ], - "has_one": [] - } - }, - "writing_format": { - "lists": { - "scroll_panels.by_scroll": { - "model_name": "scroll_panel", - "list_name": "by_scroll" - }, - "panels.by_scroll": { - "model_name": "panel", - "list_name": "by_scroll" + "width": { + "type": "number", + "rules": { + "required": true, + "number": true, + "min": 1 } }, - "columns": [ - "id", - "name", - "classname", - "caption", - "system_picture_id", - "settings", - "created_at", - "updated_at" - ], - "associations": { - "belongs_to": [ - "system_picture" - ], - "has_many": [ - "speeches" - ], - "has_one": [] - } - }, - "license_group": { - "lists": { - "scroll_panels.by_scroll": { - "model_name": "scroll_panel", - "list_name": "by_scroll" - }, - "panels.by_scroll": { - "model_name": "panel", - "list_name": "by_scroll" + "height": { + "type": "number", + "rules": { + "required": true, + "number": true, + "min": 1 } }, - "columns": [ - "id", - "name", - "classname", - "caption", - "url", - "created_at", - "updated_at" - ], - "associations": { - "belongs_to": [], - "has_many": [ - "licenses" - ], - "has_one": [] + "quotes": { + "type": "text", + "rules": {} + }, + "settings": { + "type": "text", + "rules": {} + }, + "created_at": { + "type": "datetime" + }, + "updated_at": { + "type": "datetime" } + } + }, + "GroundPicture": "ground_picture", + "ground_picture": { + "class_name": "GroundPicture", + "table_name": "ground_pictures", + "associations": { + "belongs_to": { + "panel": { + "id_column": "panel_id" + } + }, + "has_many": {} }, - "license": { - "lists": { - "scroll_panels.by_scroll": { - "model_name": "scroll_panel", - "list_name": "by_scroll" - }, - "panels.by_scroll": { - "model_name": "panel", - "list_name": "by_scroll" + "attributes": { + "id": { + "type": "number", + "primary_key": 1, + "rules": { + "number": true } }, - "columns": [ - "id", - "license_group_id", - "name", - "caption", - "system_picture_id", - "url", - "settings", - "credit_pictures", - "created_at", - "updated_at" - ], - "associations": { - "belongs_to": [ - "license_group", - "system_picture" - ], - "has_many": [ - "resource_pictures" - ], - "has_one": [] - } - }, - "author": { - "lists": { - "scroll_panels.by_scroll": { - "model_name": "scroll_panel", - "list_name": "by_scroll" - }, - "panels.by_scroll": { - "model_name": "panel", - "list_name": "by_scroll" + "panel_id": { + "type": "number", + "rules": { + "number": true } }, - "columns": [ - "id", - "name", - "user_id", - "created_at", - "updated_at" - ], - "associations": { - "belongs_to": [], - "has_many": [ - "scrolls", - "comics", - "stories", - "sheets", - "panels" - ], - "has_one": [] - } - }, - "artist": { - "lists": { - "scroll_panels.by_scroll": { - "model_name": "scroll_panel", - "list_name": "by_scroll" - }, - "panels.by_scroll": { - "model_name": "panel", - "list_name": "by_scroll" + "picture_id": { + "type": "number", + "rules": { + "required": true, + "number": true } }, - "columns": [ - "id", - "name", - "author_id", - "created_at", - "updated_at" - ], - "associations": { - "belongs_to": [], - "has_many": [ - "resource_pictures" - ], - "has_one": [] - } - }, - "system_picture": { - "lists": { - "scroll_panels.by_scroll": { - "model_name": "scroll_panel", - "list_name": "by_scroll" + "caption": { + "type": "text", + "rules": {} + }, + "repeat": { + "type": "number", + "rules": { + "required": true, + "number": true, + "range": [ + 0, + 3 + ] }, - "panels.by_scroll": { - "model_name": "panel", - "list_name": "by_scroll" + "source": { + "type": "magic_number", + "key": "ground_picture_repeat_items" } }, - "columns": [ - "id", - "ext", - "width", - "height", - "filesize", - "md5", - "created_at", - "updated_at" - ], - "associations": { - "belongs_to": [], - "has_many": [], - "has_one": [] - } - } - }, - "filers": { - "scroll": { - "symbol": { - "type": "image", - "name": "/assets/item.png" - }, - "caption": { - "type": "column", - "name": "title", - "link": { - "type": "action", - "name": "play" + "x": { + "type": "number", + "rules": { + "required": true, + "number": true } }, - "summary": { - "type": "template", - "name": "summary" + "y": { + "type": "number", + "rules": { + "required": true, + "number": true + } }, - "edit": { - "type": "default" - } - }, - "scroll_panel": { - "symbol": { - "type": "image", - "name": "/assets/item.png", - "link": { - "type": "none" + "z": { + "type": "number", + "rules": { + "required": true, + "number": true, + "min": 1 } }, - "caption": { - "type": "none" + "t": { + "type": "number", + "rules": { + "required": true, + "number": true, + "min": 0 + } }, - "summary": { - "type": "template", - "name": "summary" + "created_at": { + "type": "datetime" }, - "edit": { - "type": "none" + "updated_at": { + "type": "datetime" } - }, - "comic": { - "symbol": { - "type": "image", - "name": "/assets/item.png" - }, - "caption": { - "type": "column", - "name": "title" - }, - "summary": { - "type": "template", - "name": "summary" + } + }, + "GroundColor": "ground_color", + "ground_color": { + "class_name": "GroundColor", + "table_name": "ground_colors", + "associations": { + "belongs_to": { + "panel": { + "id_column": "panel_id" + } }, - "edit": { - "type": "default" - } + "has_many": {} }, - "story": { - "symbol": { - "type": "image", - "name": "/assets/item.png" - }, - "caption": { - "type": "method", - "name": "title_with_t", - "link": { - "type": "action", - "name": "play" + "attributes": { + "id": { + "type": "number", + "primary_key": 1, + "rules": { + "number": true } }, - "summary": { - "type": "template", - "name": "summary" - }, - "edit": { - "type": "default" - } - }, - "story_sheet": { - "symbol": { - "type": "image", - "name": "/assets/item.png", - "link": { - "type": "none" + "panel_id": { + "type": "number", + "rules": { + "number": true } }, "caption": { - "type": "none" + "type": "text", + "rules": {} }, - "summary": { - "type": "template", - "name": "summary" + "code": { + "type": "number", + "rules": { + "required": true, + "number": true, + "range": [ + 0, + 16777215 + ] + } }, - "edit": { - "type": "none" - } - }, - "sheet": { - "symbol": { - "type": "image", - "name": "/assets/item.png" + "orientation": { + "type": "number", + "rules": { + "required": true, + "number": true, + "range": [ + 0, + 1 + ] + }, + "source": { + "type": "magic_number", + "key": "ground_color_orientation_items" + } }, - "caption": { - "type": "column", - "name": "caption", - "link": { - "type": "action", - "name": "play" + "xy": { + "type": "number", + "rules": { + "number": true } }, - "summary": { - "type": "template", - "name": "summary" + "wh": { + "type": "number", + "rules": { + "number": true + } }, - "edit": { - "type": "default" - } - }, - "sheet_panel": { - "symbol": { - "type": "image", - "name": "/assets/item.png", - "link": { - "type": "none" + "z": { + "type": "number", + "rules": { + "required": true, + "number": true, + "min": 1 } }, - "caption": { - "type": "none" + "t": { + "type": "number", + "rules": { + "required": true, + "number": true, + "min": 0 + } }, - "summary": { - "type": "template", - "name": "summary" + "created_at": { + "type": "datetime" }, - "edit": { - "type": "none" + "updated_at": { + "type": "datetime" } - }, - "panel": { - "symbol": { - "type": "image", - "name": "/assets/item.png" - }, - "caption": { - "type": "method", - "name": "plain_scenario", - "link": { - "type": "none" + } + }, + "OriginalPicture": "original_picture", + "original_picture": { + "class_name": "OriginalPicture", + "table_name": "original_pictures", + "associations": { + "belongs_to": { + "artist": { + "id_column": "artist_id" } }, - "summary": { - "type": "template", - "name": "summary" + "has_many": { + "pictures": { + "foreign_key": "original_picture_id", + "list_method": "list_by_original_picture" + } }, - "edit": { - "type": "default" + "has_one": { + "resource_picture": { + "foreign_key": "original_picture_id", + "list_method": "list_by_original_picture" + } } }, - "panel_picture": { - "symbol": { - "type": "picture", - "name": "symbol_option" - }, - "caption": { - "type": "column", - "name": "caption" + "attributes": { + "id": { + "type": "number", + "primary_key": 1, + "rules": { + "number": true + } }, - "summary": { - "type": "template", - "name": "summary" + "ext": { + "type": "text", + "rules": { + "required": true + } }, - "edit": { - "type": "none" - } - }, - "speech_balloon": { - "symbol": { - "type": "picture", - "name": "symbol_option" + "width": { + "type": "number", + "rules": { + "required": true, + "number": true + } }, - "caption": { - "type": "method", - "name": "plain_scenario", - "link": { - "type": "none" + "height": { + "type": "number", + "rules": { + "required": true, + "number": true } }, - "summary": { - "type": "template", - "name": "summary" + "filesize": { + "type": "number", + "rules": { + "required": true, + "number": true + } }, - "edit": { - "type": "none" - } - }, - "speech": { - "symbol": { - "type": "picture", - "name": "symbol_option" + "artist_id": { + "type": "number", + "rules": { + "required": true, + "number": true + } }, - "caption": { - "type": "column", - "name": "content", - "link": { - "type": "none" + "md5": { + "type": "text", + "rules": { + "required": true } }, - "summary": { - "type": "template", - "name": "summary" + "uploaded_at": { + "type": "datetime" }, - "edit": { - "type": "none" - } - }, - "balloon": { - "symbol": { - "type": "picture", - "name": "symbol_option" + "published_at": { + "type": "datetime" }, - "caption": { - "type": "none" + "stopped_at": { + "type": "datetime" }, - "summary": { - "type": "template", - "name": "summary" + "created_at": { + "type": "datetime" }, - "edit": { - "type": "none" + "updated_at": { + "type": "datetime" } + } + }, + "Picture": "picture", + "picture": { + "class_name": "Picture", + "table_name": "pictures", + "associations": { + "belongs_to": { + "license": { + "id_column": "license_id" + }, + "artist": { + "id_column": "artist_id" + } + }, + "has_many": {}, + "has_one": {} }, - "ground_picture": { - "symbol": { - "type": "picture", - "name": "symbol_option" + "attributes": { + "id": { + "type": "number", + "primary_key": 1, + "rules": { + "number": true + } }, - "caption": { - "type": "column", - "name": "caption" + "original_picture_id": { + "type": "number", + "rules": { + "required": true, + "number": true + } }, - "summary": { - "type": "template", - "name": "summary" + "revision": { + "type": "number", + "rules": { + "required": true, + "number": true + } }, - "edit": { - "type": "none" - } - }, - "ground_color": { - "symbol": { - "type": "template", - "name": "symbol" + "ext": { + "type": "text", + "rules": { + "required": true + } }, - "caption": { - "type": "column", - "name": "caption" + "width": { + "type": "number", + "rules": { + "required": true, + "number": true + } }, - "summary": { - "type": "template", - "name": "summary" + "height": { + "type": "number", + "rules": { + "required": true, + "number": true + } }, - "edit": { - "type": "none" - } - }, - "original_picture": { - "symbol": { - "type": "picture", - "name": "symbol_option" + "filesize": { + "type": "number", + "rules": { + "required": true, + "number": true + } }, - "caption": { - "type": "method", - "name": "revision", - "link": { - "type": "action", - "name": "history" + "artist_id": { + "type": "number", + "rules": { + "required": true, + "number": true } }, - "summary": { - "type": "template", - "name": "summary" + "license_id": { + "type": "number", + "rules": { + "required": true, + "number": true + } }, - "edit": { - "type": "template", - "name": "publish" - } - }, - "picture": { - "symbol": { - "type": "picture", - "name": "symbol_option" + "md5": { + "type": "text", + "rules": { + "required": true + } }, - "caption": { - "type": "column", - "name": "revision" + "artist_name": { + "type": "text", + "rules": { + "required": true + } }, - "summary": { - "type": "template", - "name": "summary" + "credit": { + "type": "text", + "rules": {} }, - "edit": { - "type": "none" - } - }, - "resource_picture": { - "symbol": { - "type": "picture", - "name": "symbol_option" + "settings": { + "type": "text", + "rules": {} }, - "caption": { - "type": "none" + "classname": { + "type": "text", + "rules": { + "required": true + } }, - "summary": { - "type": "template", - "name": "summary" + "created_at": { + "type": "datetime" }, - "edit": { - "type": "none" + "updated_at": { + "type": "datetime" } - }, - "speech_balloon_template": { - "symbol": { - "type": "picture", - "name": "symbol_option" + } + }, + "ResourcePicture": "resource_picture", + "resource_picture": { + "class_name": "ResourcePicture", + "table_name": "resource_pictures", + "associations": { + "belongs_to": { + "original_picture": { + "id_column": "original_picture_id" + }, + "license": { + "id_column": "license_id" + }, + "artist": { + "id_column": "artist_id" + } }, - "caption": { - "type": "column", - "name": "caption" + "has_many": {}, + "has_one": {} + }, + "attributes": { + "id": { + "type": "number", + "primary_key": 1, + "rules": { + "number": true + } }, - "summary": { - "type": "none" + "original_picture_id": { + "type": "number", + "rules": { + "required": true, + "number": true + } }, - "edit": { - "type": "none" - } - }, - "writing_format": { - "symbol": { - "type": "image", - "name": "/assets/item.png" + "revision": { + "type": "number", + "rules": { + "required": true, + "number": true + } }, - "caption": { - "type": "column", - "name": "caption" + "ext": { + "type": "text", + "rules": { + "required": true + } }, - "summary": { - "type": "none" + "width": { + "type": "number", + "rules": { + "required": true, + "number": true + } }, - "edit": { - "type": "none" - } - }, - "license_group": { - "symbol": { - "type": "image", - "name": "/assets/item.png" + "height": { + "type": "number", + "rules": { + "required": true, + "number": true + } }, - "caption": { - "type": "column", - "name": "caption", - "link": { - "type": "url_column", - "name": "url" + "filesize": { + "type": "number", + "rules": { + "required": true, + "number": true } }, - "summary": { - "type": "none" + "artist_id": { + "type": "number", + "rules": { + "required": true, + "number": true + } }, - "edit": { - "type": "none" - } - }, - "license": { - "symbol": { - "type": "image", - "name": "/assets/item.png" + "license_id": { + "type": "number", + "rules": { + "required": true, + "number": true + } }, - "caption": { - "type": "method", - "name": "caption_with_group", - "link": { - "type": "url_column", - "name": "url" + "md5": { + "type": "text", + "rules": { + "required": true } }, - "summary": { - "type": "template", - "name": "summary" + "artist_name": { + "type": "text", + "rules": { + "required": true + } }, - "edit": { - "type": "none" + "credit": { + "type": "text", + "rules": {} + }, + "settings": { + "type": "text", + "rules": {} + }, + "picture_id": { + "type": "number", + "rules": { + "required": true, + "number": true + } + }, + "classname": { + "type": "text", + "rules": { + "required": true + } + }, + "created_at": { + "type": "datetime" + }, + "updated_at": { + "type": "datetime" } + } + }, + "SpeechBalloonTemplate": "speech_balloon_template", + "speech_balloon_template": { + "class_name": "SpeechBalloonTemplate", + "table_name": "speech_balloon_templates", + "associations": { + "belongs_to": { + "system_picture": { + "id_column": "system_picture_id" + } + }, + "has_many": { + "speech_balloons": { + "foreign_key": "speech_balloon_template_id", + "list_method": "list_by_speech_balloon_template" + }, + "panels": { + "through": "speech_balloons", + "foreign_key": "speech_balloon_template_id", + "list_method": "list_by_speech_balloon_template" + } + }, + "has_one": {} }, - "author": { - "symbol": { - "type": "image", - "name": "/assets/item.png" + "attributes": { + "id": { + "type": "number", + "primary_key": 1, + "rules": { + "number": true + } + }, + "name": { + "type": "text", + "rules": { + "required": true + } + }, + "classname": { + "type": "text", + "rules": { + "required": true + } }, "caption": { - "type": "column", - "name": "name" + "type": "text", + "rules": { + "required": true + } }, - "summary": { - "type": "template", - "name": "summary" + "t": { + "type": "number", + "rules": { + "required": true, + "number": true, + "min": 0 + } }, - "edit": { - "type": "account" + "system_picture_id": { + "type": "number", + "rules": { + "required": true, + "number": true + } + }, + "settings": { + "type": "text", + "rules": { + "required": true + } + }, + "created_at": { + "type": "datetime" + }, + "updated_at": { + "type": "datetime" } }, - "artist": { - "symbol": { - "type": "image", - "name": "/assets/item.png" - }, + "select": { + "method": "enable_list", "caption": { "type": "column", - "name": "name" + "name": "caption" + } + } + }, + "WritingFormat": "writing_format", + "writing_format": { + "class_name": "WritingFormat", + "table_name": "writing_formats", + "associations": { + "belongs_to": { + "system_picture": { + "id_column": "system_picture_id" + } }, - "summary": { - "type": "template", - "name": "summary" + "has_many": { + "speeches": { + "foreign_key": "writing_format_id", + "list_method": "list_by_writing_format" + } }, - "edit": { - "type": "account" - } + "has_one": {} }, - "system_picture": { - "symbol": { - "type": "picture", - "name": "symbol_option" + "attributes": { + "id": { + "type": "number", + "primary_key": 1, + "rules": { + "number": true + } + }, + "name": { + "type": "text", + "rules": { + "required": true + } + }, + "classname": { + "type": "text", + "rules": { + "required": true + } }, "caption": { - "type": "none" + "type": "text", + "rules": { + "required": true + } }, - "summary": { - "type": "none" + "system_picture_id": { + "type": "number", + "rules": { + "required": true, + "number": true + } }, - "edit": { - "type": "none" + "settings": { + "type": "text", + "rules": { + "required": true + } + }, + "created_at": { + "type": "datetime" + }, + "updated_at": { + "type": "datetime" + } + }, + "select": { + "method": "enable_list", + "caption": { + "type": "column", + "name": "caption" } } }, - "elements": [ - { - "name": "panel_picture", - "path_name": "panel_pictures", - "parts": [] - }, - { - "name": "speech_balloon", - "path_name": "circle_speech_balloon/speech_balloons", - "parts": [ - "balloon", - "speech" - ] - }, - { - "name": "ground_picture", - "path_name": "ground_pictures", - "parts": [] + "LicenseGroup": "license_group", + "license_group": { + "class_name": "LicenseGroup", + "table_name": "license_groups", + "associations": { + "belongs_to": {}, + "has_many": { + "licenses": { + "foreign_key": "license_group_id", + "list_method": "list_by_license_group" + } + }, + "has_one": {} }, - { - "name": "ground_color", - "path_name": "ground_colors", - "parts": [] - } - ], - "forms": { - "Panel": "panel", - "panel": { - "attributes": { - "caption": { - "column": "caption", - "type": "text", - "label": {}, - "options": { - "row_break": true - } - }, - "width": { - "column": "width", - "type": "number", - "label": {}, - "options": { - "size": 5 - } - }, - "height": { - "column": "height", - "type": "number", - "label": {}, - "options": { - "size": 5, - "row_break": true - } - }, - "border": { - "column": "border", - "type": "number", - "label": {}, - "options": { - "size": 5 - } - }, - "publish": { - "column": "publish", - "type": "select", - "label": {}, - "options": { - "source": "magic_number", - "key": "comic_visible_items", - "size": 5, - "row_break": true - } - }, - "id": { - "column": "id", - "type": "hidden", - "label": { - "type": "hidden" - }, - "options": {} - }, - "author_id": { - "column": "author_id", - "type": "hidden", - "label": { - "type": "hidden" - }, - "options": {} + "attributes": { + "id": { + "type": "number", + "primary_key": 1, + "rules": { + "number": true } }, - "fields": [ - "caption", - "width", - "height", - "border", - "publish", - "id", - "author_id" - ] + "name": { + "type": "text", + "rules": { + "required": true + } + }, + "classname": { + "type": "text", + "rules": { + "required": true + } + }, + "caption": { + "type": "text", + "rules": { + "required": true + } + }, + "url": { + "type": "text", + "rules": { + "required": true + } + }, + "created_at": { + "type": "datetime" + }, + "updated_at": { + "type": "datetime" + } }, - "PanelPicture": "panel_picture", - "panel_picture": { - "attributes": { - "caption": { - "column": "caption", - "type": "text", - "label": {}, - "options": { - "row_break": true - } - }, - "x": { - "column": "x", - "type": "number", - "label": {}, - "options": { - "size": 5 - } + "select": { + "method": "list", + "caption": { + "type": "column", + "name": "caption" + } + } + }, + "License": "license", + "license": { + "class_name": "License", + "table_name": "licenses", + "associations": { + "belongs_to": { + "license_group": { + "id_column": "license_group_id" }, - "y": { - "column": "y", - "type": "number", - "label": {}, - "options": { - "size": 5, - "row_break": true - } + "system_picture": { + "id_column": "system_picture_id" + } + }, + "has_many": { + "resource_pictures": { + "foreign_key": "license_id", + "list_method": "list_by_license" + } + }, + "has_one": {} + }, + "attributes": { + "id": { + "type": "number", + "primary_key": 1, + "rules": { + "number": true + } + }, + "license_group_id": { + "type": "number", + "rules": { + "number": true + } + }, + "name": { + "type": "text", + "rules": { + "required": true + } + }, + "caption": { + "type": "text", + "rules": { + "required": true + } + }, + "system_picture_id": { + "type": "number", + "rules": { + "required": true, + "number": true + } + }, + "url": { + "type": "text", + "rules": { + "required": true + } + }, + "settings": { + "type": "text", + "rules": {} + }, + "credit_pictures": { + "type": "text", + "rules": {} + }, + "created_at": { + "type": "datetime" + }, + "updated_at": { + "type": "datetime" + } + } + }, + "Author": "author", + "author": { + "class_name": "Author", + "table_name": "authors", + "associations": { + "belongs_to": {}, + "has_many": { + "scrolls": { + "foreign_key": "author_id", + "list_method": "list_by_author" }, - "width": { - "column": "width", - "type": "number", - "label": {}, - "options": { - "size": 5, - "row_break": true - }, - "helpers": { - "size": { - "path": "panels/size_helper", - "options": { - "class": "panel_picture_width_tool" - } - } - } + "comics": { + "foreign_key": "author_id", + "list_method": "list_by_author" }, - "height": { - "column": "height", - "type": "number", - "label": {}, - "options": { - "size": 5, - "row_break": true - }, - "helpers": { - "size": { - "path": "panels/size_helper", - "options": { - "class": "panel_picture_height_tool" - } - } - } + "stories": { + "foreign_key": "author_id", + "list_method": "list_by_author" }, - "link": { - "column": "link", - "type": "text", - "label": {}, - "options": { - "row_break": true - } + "sheets": { + "foreign_key": "author_id", + "list_method": "list_by_author" }, - "id": { - "column": "id", - "type": "hidden", - "label": { - "type": "hidden" - }, - "options": {} - }, - "panel_id": { - "column": "panel_id", - "type": "hidden", - "label": { - "type": "hidden" - }, - "options": {} - }, - "picture_id": { - "column": "picture_id", - "type": "hidden", - "label": {}, - "helpers": { - "popup": { - "path": "panels/popup_helper", - "source": "pictures", - "options": {} - } - }, - "options": {} - }, - "z": { - "column": "z", - "type": "hidden", - "label": { - "type": "hidden" - }, - "options": {} - }, - "t": { - "column": "t", - "type": "hidden", - "label": { - "type": "hidden" - }, - "options": {} + "panels": { + "foreign_key": "author_id", + "list_method": "list_by_author" } }, - "fields": [ - "caption", - "x", - "y", - "width", - "height", - "link", - "id", - "panel_id", - "picture_id", - "z", - "t" - ] + "has_one": {} }, - "speech_balloon": { - "attributes": { - "speech_balloon.id": { - "column": "id", - "type": "hidden", - "label": { - "type": "hidden" - }, - "options": {} - }, - "speech_balloon.panel_id": { - "column": "panel_id", - "type": "hidden", - "label": { - "type": "hidden" - }, - "options": {} - }, - "speech_balloon.speech_balloon_template_id": { - "column": "speech_balloon_template_id", - "type": "hidden", - "label": { - "type": "hidden" - }, - "options": {} - }, - "speech_balloon.caption": { - "column": "caption", - "type": "text", - "label": {}, - "options": { - "row_break": true - } - }, - "speech_balloon.z": { - "column": "z", - "type": "hidden", - "label": { - "type": "hidden" - }, - "options": {} - }, - "speech_balloon.t": { - "column": "t", - "type": "hidden", - "label": { - "type": "hidden" - }, - "options": {} - }, - "speech_balloon.classname": { - "column": "classname", - "type": "hidden", - "label": { - "type": "hidden" - }, - "options": {} - }, - "speech_balloon.settings": { - "column": "settings", - "type": "hidden", - "label": { - "type": "hidden" - }, - "options": {} - }, - "balloon.id": { - "model": "balloon", - "part": "balloon", - "column": "id", - "type": "hidden", - "label": { - "type": "hidden" - }, - "options": {} - }, - "balloon.speech_balloon_id": { - "model": "balloon", - "part": "balloon", - "column": "speech_balloon_id", - "type": "hidden", - "label": { - "type": "hidden" - }, - "options": {} + "attributes": { + "id": { + "type": "number", + "primary_key": 1, + "rules": { + "number": true + } + }, + "name": { + "type": "text", + "rules": { + "required": true + } + }, + "user_id": { + "type": "number", + "rules": { + "required": true, + "number": true + } + }, + "created_at": { + "type": "datetime" + }, + "updated_at": { + "type": "datetime" + } + }, + "select": { + "method": "list", + "caption": { + "type": "column", + "name": "name" + } + } + }, + "Artist": "artist", + "artist": { + "class_name": "Artist", + "table_name": "artists", + "associations": { + "belongs_to": {}, + "has_many": { + "resource_pictures": { + "foreign_key": "artist_id", + "list_method": "list_by_artist" + } + }, + "has_one": {} + }, + "attributes": { + "id": { + "type": "number", + "primary_key": 1, + "rules": { + "number": true + } + }, + "name": { + "type": "text", + "rules": { + "required": true + } + }, + "author_id": { + "type": "number", + "rules": { + "required": true, + "number": true + } + }, + "created_at": { + "type": "datetime" + }, + "updated_at": { + "type": "datetime" + } + }, + "select": { + "method": "list", + "caption": { + "type": "column", + "name": "name" + } + } + }, + "SystemPicture": "system_picture", + "system_picture": { + "class_name": "SystemPicture", + "table_name": "system_pictures", + "associations": { + "belongs_to": {}, + "has_many": { + "balloons": { + "foreign_key": "system_picture_id", + "list_method": "list_by_system_picture" }, - "balloon.system_picture_id": { - "model": "balloon", - "part": "balloon", - "column": "system_picture_id", - "type": "hidden", - "label": { - "type": "hidden" - }, - "options": {} + "balloon_templates": { + "foreign_key": "system_picture_id", + "list_method": "list_by_system_picture" }, - "balloon.r": { - "model": "balloon", - "part": "balloon", - "column": "r", - "type": "number", - "label": {}, - "options": { - "size": 5, - "row_break": true - }, - "helpers": { - "tail_angle": { - "path": "panels/tail_angle_helper", - "options": {} - } - } - }, - "balloon.x": { - "model": "balloon", - "part": "balloon", - "column": "x", - "type": "number", - "label": {}, - "options": { - "size": 5 - } - }, - "balloon.y": { - "model": "balloon", - "part": "balloon", - "column": "y", - "type": "number", - "label": {}, - "options": { - "size": 5, - "row_break": true - } - }, - "balloon.width": { - "model": "balloon", - "part": "balloon", - "column": "width", - "type": "number", - "label": {}, - "options": { - "size": 5 - } - }, - "balloon.height": { - "model": "balloon", - "part": "balloon", - "column": "height", - "type": "number", - "label": {}, - "options": { - "size": 5, - "row_break": true - } - }, - "balloon.settings": { - "model": "balloon", - "part": "balloon", - "column": "settings", - "type": "hidden", - "label": { - "type": "hidden" - }, - "options": {} - }, - "speech.id": { - "model": "speech", - "part": "speech", - "column": "id", - "type": "hidden", - "label": { - "type": "hidden" - }, - "options": {} - }, - "speech.speech_balloon_id": { - "model": "speech", - "part": "speech", - "column": "speech_balloon_id", - "type": "hidden", - "label": { - "type": "hidden" - }, - "options": {} - }, - "speech.x": { - "model": "speech", - "part": "speech", - "column": "x", - "type": "hidden", - "label": { - "type": "hidden" - }, - "options": {} - }, - "speech.y": { - "model": "speech", - "part": "speech", - "column": "y", - "type": "hidden", - "label": { - "type": "hidden" - }, - "options": {} - }, - "speech.width": { - "model": "speech", - "part": "speech", - "column": "width", - "type": "hidden", - "label": { - "type": "hidden" - }, - "options": {} - }, - "speech.height": { - "model": "speech", - "part": "speech", - "column": "height", - "type": "hidden", - "label": { - "type": "hidden" - }, - "options": {} - }, - "speech.writing_format_id": { - "model": "speech", - "part": "speech", - "column": "writing_format_id", - "type": "select", - "label": {}, - "options": { - "source": "model", - "model": "writing_format", - "method": "enable_list", - "caption": "caption" - } - }, - "speech.font_size": { - "model": "speech", - "part": "speech", - "column": "font_size", - "type": "select", - "label": {}, - "options": { - "source": "magic_number", - "key": "speech_font_size_items", - "row_break": true - } - }, - "speech.text_align": { - "model": "speech", - "part": "speech", - "column": "text_align", - "type": "select", - "label": {}, - "options": { - "source": "magic_number", - "key": "speech_text_align_items" - } - }, - "speech.quotes": { - "model": "speech", - "part": "speech", - "column": "quotes", - "type": "text", - "label": {}, - "options": { - "size": 5 - } - }, - "speech.content": { - "model": "speech", - "part": "speech", - "column": "content", - "type": "text_area", - "label": { - "row_break": true - }, - "options": { - "size": "45x5" - } - }, - "speech.fore_color": { - "model": "speech", - "part": "speech", - "column": "fore_color", - "type": "hidden", - "label": { - "row_break": true - }, - "options": {}, - "helpers": { - "color": { - "path": "panels/color_helper", - "options": {}, - "wrapper": "speech-fore_color-wrap" - } - } - }, - "speech.settings": { - "model": "speech", - "part": "speech", - "column": "settings", - "type": "hidden", - "label": { - "type": "hidden" - }, - "options": {} + "licenses": { + "foreign_key": "system_picture_id", + "list_method": "list_by_system_picture" } - } - }, - "CircleSpeechBalloon": "circle_speech_balloon", - "circle_speech_balloon": { - "base": "speech_balloon", - "attributes": {}, - "fields": [ - "speech_balloon.caption", - "balloon.r", - "balloon.x", - "balloon.y", - "balloon.width", - "balloon.height", - "balloon.id", - "balloon.speech_balloon_id", - "balloon.system_picture_id", - "balloon.settings", - "speech.writing_format_id", - "speech.font_size", - "speech.text_align", - "speech.quotes", - "speech.content", - "speech.fore_color", - "speech.id", - "speech.speech_balloon_id", - "speech.x", - "speech.y", - "speech.width", - "speech.height", - "speech.settings", - "speech_balloon.id", - "speech_balloon.panel_id", - "speech_balloon.speech_balloon_template_id", - "speech_balloon.classname", - "speech_balloon.z", - "speech_balloon.t", - "speech_balloon.settings" - ] + }, + "has_one": {} }, - "PlainSpeechBalloon": "plain_speech_balloon", - "plain_speech_balloon": { - "base": "speech_balloon", - "attributes": { - "balloon.r": { - "model": "balloon", - "part": "balloon", - "column": "r", - "type": "hidden", - "label": { - "type": "hidden" - }, - "options": {} + "attributes": { + "id": { + "type": "number", + "primary_key": 1, + "rules": { + "number": true } }, - "fields": [ - "speech_balloon.caption", - "balloon.r", - "balloon.x", - "balloon.y", - "balloon.width", - "balloon.height", - "balloon.id", - "balloon.speech_balloon_id", - "balloon.system_picture_id", - "balloon.settings", - "speech.writing_format_id", - "speech.font_size", - "speech.text_align", - "speech.quotes", - "speech.content", - "speech.fore_color", - "speech.id", - "speech.speech_balloon_id", - "speech.x", - "speech.y", - "speech.width", - "speech.height", - "speech.settings", - "speech_balloon.id", - "speech_balloon.panel_id", - "speech_balloon.speech_balloon_template_id", - "speech_balloon.classname", - "speech_balloon.z", - "speech_balloon.t", - "speech_balloon.settings" - ] - }, - "SquareSpeechBalloon": "square_speech_balloon", - "square_speech_balloon": { - "base": "speech_balloon", - "attributes": { - "balloon.r": { - "model": "balloon", - "part": "balloon", - "column": "r", - "type": "hidden", - "label": { - "type": "hidden" - }, - "options": {} + "ext": { + "type": "text", + "rules": { + "required": true } }, - "fields": [ - "speech_balloon.caption", - "balloon.r", - "balloon.x", - "balloon.y", - "balloon.width", - "balloon.height", - "balloon.id", - "balloon.speech_balloon_id", - "balloon.system_picture_id", - "balloon.settings", - "speech.writing_format_id", - "speech.font_size", - "speech.text_align", - "speech.quotes", - "speech.content", - "speech.fore_color", - "speech.id", - "speech.speech_balloon_id", - "speech.x", - "speech.y", - "speech.width", - "speech.height", - "speech.settings", - "speech_balloon.id", - "speech_balloon.panel_id", - "speech_balloon.speech_balloon_template_id", - "speech_balloon.classname", - "speech_balloon.z", - "speech_balloon.t", - "speech_balloon.settings" - ] - }, - "GroundPicture": "ground_picture", - "ground_picture": { - "attributes": { - "id": { - "column": "id", - "type": "hidden", - "label": { - "type": "hidden" - }, - "options": {} - }, - "panel_id": { - "column": "panel_id", - "type": "hidden", - "label": { - "type": "hidden" - }, - "options": {} - }, - "picture_id": { - "column": "picture_id", - "type": "hidden", - "label": { - "type": "hidden" - }, - "options": {} - }, - "caption": { - "column": "caption", - "type": "text", - "label": {}, - "options": { - "row_break": true - } - }, - "repeat": { - "column": "repeat", - "type": "select", - "label": {}, - "options": { - "source": "magic_number", - "key": "ground_picture_repeat_items", - "row_break": true - } - }, - "x": { - "column": "x", - "type": "number", - "label": {}, - "options": { - "size": 5 - } - }, - "y": { - "column": "y", - "type": "number", - "label": {}, - "options": { - "size": 5, - "row_break": true - } - }, - "z": { - "column": "z", - "type": "hidden", - "label": { - "type": "hidden" - }, - "options": {} - }, - "t": { - "column": "t", - "type": "hidden", - "label": { - "type": "hidden" - }, - "options": {} + "width": { + "type": "number", + "rules": { + "required": true, + "number": true } }, - "fields": [ - "caption", - "repeat", - "x", - "y", - "z", - "t", - "id", - "panel_id", - "picture_id" - ] - }, - "GroundColor": "ground_color", - "ground_color": { - "attributes": { - "id": { - "column": "id", - "type": "hidden", - "label": { - "type": "hidden" - }, - "options": {} - }, - "panel_id": { - "column": "panel_id", - "type": "hidden", - "label": { - "type": "hidden" - }, - "options": {} - }, - "caption": { - "column": "caption", - "type": "text", - "label": {}, - "options": { - "row_break": true - } - }, - "code": { - "column": "code", - "type": "hidden", - "label": { - "row_break": true - }, - "options": { - "row_break": true - }, - "helpers": { - "color": { - "path": "panels/color_helper", - "options": {}, - "wrapper": "ground_color-code-wrap" - } - } - }, - "orientation": { - "column": "orientation", - "type": "select", - "label": {}, - "options": { - "source": "magic_number", - "key": "ground_color_orientation_items", - "row_break": true - } - }, - "xy": { - "column": "xy", - "type": "number", - "label": {}, - "options": { - "size": 5 - } - }, - "wh": { - "column": "wh", - "type": "number", - "label": {}, - "options": { - "size": 5, - "row_break": true - } - }, - "z": { - "column": "z", - "type": "hidden", - "label": { - "type": "hidden" - }, - "options": {} - }, - "t": { - "column": "t", - "type": "hidden", - "label": { - "type": "hidden" - }, - "options": {} - } - }, - "fields": [ - "id", - "panel_id", - "caption", - "code", - "orientation", - "xy", - "wh", - "z", - "t" - ] - } - } - }, - "locales": { - "ja": {} - }, - "models": { - "Scroll": "scroll", - "scroll": { - "class_name": "Scroll", - "table_name": "scrolls", - "associations": { - "belongs_to": { - "author": { - "id_column": "author_id" - } - }, - "has_many": { - "scroll_panels": { - "foreign_key": "scroll_id", - "model": "scroll_panel" - }, - "panels": { - "through": "scroll_panel", - "foreign_key": "scroll_id", - "model": "panel" - } - } - }, - "attributes": { - "id": { + "height": { "type": "number", - "primary_key": 1, "rules": { + "required": true, "number": true } }, - "title": { - "type": "text", - "rules": { - "required": true - } - }, - "description": { - "type": "text", - "rules": {} - }, - "visible": { + "filesize": { "type": "number", "rules": { "required": true, "number": true - }, - "source": { - "type": "magic_number", - "key": "scroll_visible_items" } }, - "author_id": { - "type": "number", + "md5": { + "type": "text", "rules": { - "required": true, - "number": true + "required": true } }, "created_at": { @@ -3166,1935 +2769,2761 @@ "updated_at": { "type": "datetime" } - }, - "select": { - "list": { - "name": "public" + } + } + }, + "lists": { + "scroll": { + "default_page_size": 25, + "max_page_size": 100, + "lists": { + "public_list": { + "type": "public" }, - "caption": { - "type": "column", - "name": "title" + "private_list": { + "type": "private" + }, + "scroll_panels": { + "type": "has_many", + "association_name": "scroll_panels" + }, + "panels": { + "type": "has_many", + "association_name": "panels" + }, + "by_author": { + "type": "filter", + "from": "author", + "filter_key": "author_id" + }, + "by_panel": { + "type": "through_filter", + "from": "panel", + "through": "scroll_panels", + "filter_key": "panel_id" } } }, - "ScrollPanel": "scroll_panel", "scroll_panel": { - "class_name": "ScrollPanel", - "table_name": "scroll_panels", - "associations": { - "belongs_to": { - "panel": { - "id_column": "panel_id" - }, - "scroll": { - "id_column": "scroll_id" - } - }, - "has_many": {} - }, - "attributes": { - "id": { - "type": "number", - "primary_key": 1, - "rules": { - "number": true - } + "default_page_size": 20, + "lists": { + "public_list": { + "type": "public" }, - "scroll_id": { - "type": "number", - "rules": { - "required": true, - "number": true - } + "private_list": { + "type": "private" }, - "panel_id": { - "type": "number", - "rules": { - "required": true, - "number": true - } + "by_scroll": { + "type": "filter", + "from": "scroll", + "filter_key": "scroll_id" }, - "t": { - "type": "number", - "rules": { - "required": true, - "number": true, - "min": 0 - } + "by_panel": { + "type": "filter", + "from": "panel", + "filter_key": "panel_id" + } + } + }, + "comic": { + "default_page_size": 20, + "lists": { + "public_list": { + "type": "public" }, - "author_id": { - "type": "number", - "rules": { - "required": true, - "number": true - } + "private_list": { + "type": "private" }, - "created_at": { - "type": "datetime" + "stories": { + "type": "has_many", + "association_name": "stories" }, - "updated_at": { - "type": "datetime" + "by_author": { + "type": "filter", + "from": "author", + "filter_key": "author_id" } } }, - "Comic": "comic", - "comic": { - "class_name": "Comic", - "table_name": "comics", - "associations": { - "belongs_to": { - "author": { - "id_column": "author_id" - } + "story": { + "default_page_size": 20, + "lists": { + "public_list": { + "type": "public" }, - "has_many": { - "stories": { - "foreign_key": "comic_id", - "model": "story" - } + "private_list": { + "type": "private" }, - "has_many_through": {} - }, - "attributes": { - "id": { - "type": "number", - "primary_key": 1, - "rules": { - "number": true - } + "story_sheets": { + "type": "has_many", + "association_name": "story_sheets" }, - "title": { - "type": "text", - "rules": { - "required": true - } + "sheets": { + "type": "has_many", + "association_name": "sheets" }, - "description": { - "type": "text", - "rules": {} + "by_comic": { + "type": "filter", + "from": "comic", + "filter_key": "comic_id" }, - "visible": { - "type": "number", - "rules": { - "required": true, - "number": true - }, - "source": { - "type": "magic_number", - "key": "comic_visible_items" - } + "by_sheet": { + "type": "through_filter", + "from": "sheet", + "through": "sheet_panels", + "filter_key": "sheet_id" }, - "author_id": { - "type": "number", - "rules": { - "required": true, - "number": true - } + "by_author": { + "type": "element_filter", + "from": "author", + "filter_key": "author_id" + } + } + }, + "story_sheet": { + "default_page_size": 20, + "lists": { + "public_list": { + "type": "public" }, - "created_at": { - "type": "datetime" + "private_list": { + "type": "private" }, - "updated_at": { - "type": "datetime" - } - }, - "select": { - "method": "list", - "caption": { - "type": "column", - "name": "title" + "by_story": { + "type": "filter", + "from": "story", + "filter_key": "story_id" + }, + "by_sheet": { + "type": "filter", + "from": "sheet", + "filter_key": "sheet_id" } } }, - "Story": "story", - "story": { - "class_name": "Story", - "table_name": "stories", - "associations": { - "belongs_to": { - "comic": { - "id_column": "comic_id" - } + "sheet": { + "default_page_size": 20, + "lists": { + "public_list": { + "type": "public" }, - "has_many": { - "story_sheets": { - "foreign_key": "story_id", - "list_method": "list_by_story" - }, - "sheets": { - "through": "story_sheets", - "foreign_key": "story_id", - "list_method": "list_by_story" - } - } - }, - "attributes": { - "id": { - "type": "number", - "primary_key": 1, - "rules": { - "number": true - } + "private_list": { + "type": "private" }, - "comic_id": { - "type": "number", - "rules": { - "number": true - } + "story_sheets": { + "type": "has_many", + "association_name": "story_sheets" }, - "title": { - "type": "text", - "rules": {} + "stories": { + "type": "has_many", + "association_name": "stories" }, - "description": { - "type": "text", - "rules": {} + "sheet_panels": { + "type": "has_many", + "association_name": "sheet_panels" }, - "t": { - "type": "number", - "rules": { - "required": true, - "number": true, - "min": 0 - } + "panels": { + "type": "has_many", + "association_name": "panels" }, - "visible": { - "type": "number", - "rules": { - "required": true, - "number": true - }, - "source": { - "type": "magic_number", - "key": "story_visible_items" - } + "by_story": { + "type": "through_filter", + "from": "story", + "through": "story_sheets", + "filter_key": "story_id" }, - "created_at": { - "type": "datetime" + "by_panel": { + "type": "through_filter", + "from": "panel", + "through": "sheet_panels", + "filter_key": "panel_id" }, - "updated_at": { - "type": "datetime" + "by_author": { + "type": "filter", + "from": "author", + "filter_key": "author_id" } - }, - "select": { - "method": "list", - "caption": { - "type": "method", - "name": "title_with_t" + } + }, + "sheet_panel": { + "default_page_size": 20, + "lists": { + "public_list": { + "type": "public" + }, + "private_list": { + "type": "private" + }, + "by_sheet": { + "type": "filter", + "association_name": "sheet_panels", + "from": "sheet", + "filter_key": "sheet_id" + }, + "by_panel": { + "type": "filter", + "from": "panel", + "filter_key": "panel_id" } } }, - "StorySheet": "story_sheet", - "story_sheet": { - "class_name": "StorySheet", - "table_name": "story_sheets", - "associations": { - "belongs_to": { - "story": { - "id_column": "story_id" - }, - "sheet": { - "id_column": "sheet_id" - } + "panel": { + "default_page_size": 20, + "lists": { + "public_list": { + "type": "public" }, - "has_many": {} - }, - "attributes": { - "id": { - "type": "number", - "primary_key": 1, - "rules": { - "number": true - } + "scroll_panels": { + "type": "has_many", + "association_name": "scroll_panels" }, - "story_id": { - "type": "number", - "rules": { - "number": true - } + "scrolls": { + "type": "has_many", + "association_name": "scrolls" }, - "sheet_id": { - "type": "number", - "rules": { - "number": true - } + "sheet_panels": { + "type": "has_many", + "association_name": "sheet_panels" }, - "t": { - "type": "number", - "rules": { - "required": true, - "number": true, - "min": 0 - } + "sheets": { + "type": "has_many", + "association_name": "sheets" }, - "author_id": { - "type": "number", - "rules": { - "required": true, - "number": true - } + "panel_pictures": { + "type": "has_many", + "association_name": "panel_pictures" }, - "created_at": { - "type": "datetime" + "speech_balloons": { + "type": "has_many", + "association_name": "speech_balloons" }, - "updated_at": { - "type": "datetime" - } - } - }, - "Sheet": "sheet", - "sheet": { - "class_name": "Sheet", - "table_name": "sheets", - "associations": { - "belongs_to": { - "author": { - "id_column": "author_id" - } + "ground_pictures": { + "type": "has_many", + "association_name": "ground_pictures" }, - "has_many": { - "story_sheets": { - "foreign_key": "story_id", - "list_method": "list_by_sheet" - }, - "stories": { - "through": "story_sheets", - "foreign_key": "sheet_id", - "list_method": "list_by_sheet" - }, - "sheet_panels": { - "foreign_key": "sheet_id", - "list_method": "list_by_sheet" - }, - "panels": { - "through": "sheet_panels", - "foreign_key": "sheet_id", - "list_method": "list_by_sheet" - } - } - }, - "attributes": { - "id": { - "type": "number", - "primary_key": 1, - "rules": { - "number": true - } - }, - "caption": { - "type": "text", - "rules": {} + "ground_colors": { + "type": "has_many", + "association_name": "ground_colors" }, - "width": { - "type": "number", - "rules": { - "required": true, - "number": true - } + "by_scroll": { + "type": "through_filter", + "from": "scroll", + "through": "scroll_panels", + "filter_key": "scroll_id" }, - "height": { - "type": "number", - "rules": { - "required": true, - "number": true - } + "by_sheet": { + "type": "through_filter", + "from": "sheet", + "through": "sheet_panels", + "filter_key": "sheet_id" }, - "visible": { - "type": "number", - "rules": { - "required": true, - "number": true - }, - "source": { - "type": "magic_number", - "key": "sheet_visible_items" - } + "by_author": { + "type": "filter", + "from": "author", + "filter_key": "author_id" }, - "author_id": { - "type": "number", - "rules": { - "required": true, - "number": true - } + "by_speech_balloon_template": { + "type": "through_filter", + "from": "speech_balloon_template", + "through": "speech_balloons", + "filter_key": "speech_balloon_template_id" + } + } + }, + "panel_picture": { + "default_page_size": 20, + "lists": { + "public_list": { + "type": "public" }, - "created_at": { - "type": "datetime" + "by_panel": { + "type": "filter", + "from": "panel", + "filter_key": "panel_id" }, - "updated_at": { - "type": "datetime" - } - }, - "select": { - "method": "list", - "caption": { - "type": "column", - "name": "caption" + "by_author": { + "type": "element_filter", + "from": "author", + "filter_key": "author_id" } } }, - "SheetPanel": "sheet_panel", - "sheet_panel": { - "class_name": "SheetPanel", - "table_name": "sheet_panels", - "associations": { - "belongs_to": { - "sheet": { - "id_column": "sheet_id" - }, - "panel": { - "id_column": "panel_id" - } + "speech_balloon": { + "default_page_size": 20, + "lists": { + "public_list": { + "type": "public" }, - "has_many": {} - }, - "attributes": { - "id": { - "type": "number", - "primary_key": 1, - "rules": { - "number": true - } + "by_panel": { + "type": "filter", + "from": "panel", + "filter_key": "panel_id" }, - "sheet_id": { - "type": "number", - "rules": { - "number": true - } + "by_speech_balloon_template": { + "type": "filter", + "from": "speech_balloon_template", + "filter_key": "speech_balloon_template_id" }, - "panel_id": { - "type": "number", - "rules": { - "number": true - } + "by_author": { + "type": "element_filter", + "from": "author", + "filter_key": "author_id" + } + } + }, + "speech": { + "default_page_size": 20, + "lists": { + "public_list": { + "type": "public" }, - "x": { - "type": "number", - "rules": { - "required": true, - "number": true - } + "by_writing_format": { + "type": "filter", + "from": "writing_format", + "filter_key": "writing_format_id" + } + } + }, + "balloon": { + "default_page_size": 20, + "lists": { + "public_list": { + "type": "public" + } + } + }, + "ground_picture": { + "default_page_size": 20, + "lists": { + "public_list": { + "type": "public" }, - "y": { - "type": "number", - "rules": { - "required": true, - "number": true - } + "by_panel": { + "type": "filter", + "from": "panel", + "filter_key": "panel_id" }, - "z": { - "type": "number", - "rules": { - "required": true, - "number": true, - "min": 1 - } + "by_author": { + "type": "element_filter", + "from": "author", + "filter_key": "author_id" + } + } + }, + "ground_color": { + "default_page_size": 20, + "lists": { + "public_list": { + "type": "public" }, - "t": { - "type": "number", - "rules": { - "required": true, - "number": true, - "min": 0 - } + "by_panel": { + "type": "filter", + "from": "panel", + "filter_key": "panel_id" }, - "author_id": { - "type": "number", - "rules": { - "number": true - } + "by_author": { + "type": "element_filter", + "from": "author", + "filter_key": "author_id" + } + } + }, + "original_picture": { + "default_page_size": 20, + "lists": { + "private_list": { + "type": "private" + } + } + }, + "picture": {}, + "resource_picture": { + "default_page_size": 20, + "lists": { + "public_list": { + "type": "public" }, - "created_at": { - "type": "datetime" + "by_license": { + "type": "filter", + "from": "license", + "filter_key": "license_id" }, - "updated_at": { - "type": "datetime" + "by_artist": { + "type": "filter", + "from": "artist", + "filter_key": "artist_id" } } }, - "Panel": "panel", - "panel": { - "class_name": "Panel", - "table_name": "panels", - "associations": { - "belongs_to": { - "author": { - "id_column": "author_id" - } - }, - "has_many": { - "scroll_panels": { - "foreign_key": "panel_id", - "list_method": "list_by_panel" - }, - "scrolls": { - "through": "scroll_panels", - "foreign_key": "panel_id", - "list_method": "list_by_panel" - }, - "sheet_panels": { - "foreign_key": "panel_id", - "list_method": "list_by_panel" - }, - "sheets": { - "through": "sheet_panels", - "foreign_key": "panel_id", - "list_method": "list_by_panel" - }, - "panel_pictures": { - "foreign_key": "panel_id", - "list_method": "list_by_panel" - }, - "speech_balloons": { - "foreign_key": "panel_id", - "list_method": "list_by_panel" - }, - "ground_pictures": { - "foreign_key": "panel_id", - "list_method": "list_by_panel" - }, - "ground_colors": { - "foreign_key": "panel_id", - "list_method": "list_by_panel" - } - } - }, - "attributes": { - "id": { - "type": "number", - "primary_key": 1, - "rules": { - "number": true - } - }, - "width": { - "type": "number", - "rules": { - "required": true, - "number": true, - "min": 1 - } - }, - "height": { - "type": "number", - "rules": { - "required": true, - "number": true, - "min": 1 - } - }, - "border": { - "type": "number", - "rules": { - "required": true, - "number": true, - "min": 0 - } - }, - "caption": { - "type": "text", - "rules": {} + "speech_balloon_template": { + "default_page_size": 20, + "lists": { + "public_list": { + "type": "public" }, - "publish": { - "type": "number", - "rules": { - "required": true, - "number": true - }, - "source": { - "type": "magic_number", - "key": "panel_visible_items" - } + "speech_balloons": { + "type": "has_many", + "association_name": "speech_balloons" }, - "author_id": { - "type": "number", - "rules": { - "required": true, - "number": true - } + "panels": { + "type": "has_many", + "association_name": "panels" + } + } + }, + "writing_format": { + "default_page_size": 20, + "lists": { + "public_list": { + "type": "public" }, - "created_at": { - "type": "datetime" + "speeches": { + "type": "has_many", + "association_name": "speeches" }, - "updated_at": { - "type": "datetime" - } - }, - "select": { - "method": "list", - "caption": { - "type": "method", - "name": "plain_scenario" + "by_system_picture": { + "type": "filter", + "from": "system_picture", + "filter_key": "system_picture_id" } } }, - "PanelPicture": "panel_picture", - "panel_picture": { - "class_name": "PanelPicture", - "table_name": "panel_pictures", - "associations": { - "belongs_to": { - "panel": { - "id_column": "panel_id" - } + "license_group": { + "default_page_size": 20, + "lists": { + "public_list": { + "type": "public" }, - "has_many": {} - }, - "attributes": { - "id": { - "type": "number", - "primary_key": 1, - "rules": { - "number": true - } + "licenses": { + "type": "has_many", + "association_name": "licenses" + } + } + }, + "license": { + "default_page_size": 20, + "lists": { + "public_list": { + "type": "public" }, - "panel_id": { - "type": "number", - "rules": { - "number": true - } + "resource_pictures": { + "type": "has_many", + "association_name": "resource_pictures" }, - "picture_id": { - "type": "number", - "rules": { - "required": true, - "number": true - } + "by_license_group": { + "type": "filter", + "from": "license_group", + "filter_key": "license_group_id" }, - "caption": { - "type": "text", - "rules": {} + "by_system_picture": { + "type": "filter", + "from": "system_picture", + "filter_key": "system_picture_id" + } + } + }, + "author": { + "default_page_size": 20, + "lists": { + "public_list": { + "type": "public" }, - "x": { - "type": "number", - "rules": { - "required": true, - "number": true - } + "scrolls": { + "type": "has_many", + "association_name": "scrolls" }, - "y": { - "type": "number", - "rules": { - "required": true, - "number": true - } + "comics": { + "type": "has_many", + "association_name": "comics" }, - "width": { - "type": "number", - "rules": { - "required": true, - "number": true - } + "stories": { + "type": "has_many", + "association_name": "stories" }, - "height": { - "type": "number", - "rules": { - "required": true, - "number": true - } + "sheets": { + "type": "has_many", + "association_name": "sheets" }, - "link": { - "type": "text", - "rules": { - "url": true - } + "panels": { + "type": "has_many", + "association_name": "panels" }, - "z": { - "type": "number", - "rules": { - "required": true, - "number": true, - "min": 1 - } + "panel_pictures": { + "type": "has_many", + "association_name": "panel_pictures" }, - "t": { - "type": "number", - "rules": { - "required": true, - "number": true, - "min": 0 - } + "speech_balloons": { + "type": "has_many", + "association_name": "speech_balloons" }, - "created_at": { - "type": "datetime" + "ground_pictures": { + "type": "has_many", + "association_name": "ground_pictures" }, - "updated_at": { - "type": "datetime" + "ground_colors": { + "type": "has_many", + "association_name": "ground_colors" } } }, - "SpeechBalloon": "speech_balloon", - "speech_balloon": { - "class_name": "SpeechBalloon", - "table_name": "speech_balloons", - "extend": "classname", - "associations": { - "belongs_to": { - "panel": { - "id_column": "panel_id" - } + "artist": { + "default_page_size": 20, + "lists": { + "public_list": { + "type": "public" }, - "has_many": {}, - "has_one": { - "balloon": { - "foreign_key": "speech_balloon_id", - "list_method": "list_by_speech_balloon" - }, - "speech": { - "foreign_key": "speech_balloon_id", - "list_method": "list_by_speech_balloon" - } + "resource_pictures": { + "type": "has_many", + "association_name": "resource_pictures" } - }, - "attributes": { - "id": { - "type": "number", - "primary_key": 1, - "rules": { - "number": true - } - }, - "panel_id": { - "type": "number", - "rules": { - "number": true - } - }, - "speech_balloon_template_id": { - "type": "number", - "rules": { - "required": true, - "number": true - } - }, - "classname": { - "type": "text", - "rules": { - "required": true - } - }, - "z": { - "type": "number", - "rules": { - "required": true, - "number": true, - "min": 1 - } - }, - "t": { - "type": "number", - "rules": { - "required": true, - "number": true, - "min": 0 - } - }, - "settings": { - "type": "text", - "rules": {} - }, - "caption": { - "type": "text", - "rules": {} - }, - "created_at": { - "type": "datetime" - }, - "updated_at": { - "type": "datetime" + } + }, + "system_picture": { + "default_page_size": 20, + "lists": { + "public_list": { + "type": "public" } + } + } + }, + "system_resources": { + "engine_resources": { + "license_groups": { + "PettanrCreativeCommonsV30Licenses": "pettanr_creative_commons_v30_licenses", + "PettanrPettanCommonsV01Licenses": "pettanr_pettan_commons_v01_licenses", + "PettanrPettanProtectedV01Licenses": "pettanr_pettan_protected_v01_licenses", + "PettanrPettanPublicV01Licenses": "pettanr_pettan_public_v01_licenses", + "PettanrPublicDomainV01Licenses": "pettanr_public_domain_v01_licenses", + "PettanrUnknownV01Licenses": "pettanr_unknown_v01_licenses" }, - "select": { - "method": "list", - "caption": { - "type": "method", - "name": "plain_scenario" - } + "speech_balloon_templates": { + "CircleSpeechBalloon": "circle_speech_balloon", + "PlainSpeechBalloon": "plain_speech_balloon", + "SquareSpeechBalloon": "square_speech_balloon" + }, + "writing_formats": { + "SimpleFormat": "pettanr_simple_format" } }, - "Balloon": "balloon", - "balloon": { - "class_name": "Balloon", - "table_name": "balloons", - "associations": { - "belongs_to": { - "speech_balloon": { - "id_column": "speech_balloon_id" - }, - "system_picture": { - "id_column": "system_picture_id" - } - }, - "has_many": {} + "elements": { + "PanelPicture": "panel_pictures", + "SpeechBalloon": "speech_balloons", + "GroundPicture": "ground_pictures", + "GroundColor": "ground_colors" + } + }, + "magic_numbers": { + "run_mode": 1, + "thumbnail_width": 64, + "thumbnail_height": 64, + "profile": { + "users": { + "caption": "ペンギン王国", + "url": "http://localhost:3001/", + "description": "ペンギン王国はペンギン素材を豊富に用意したペンギンマニアのサイトです。" }, - "attributes": { - "id": { - "type": "number", - "primary_key": 1, - "rules": { - "number": true - } - }, - "speech_balloon_id": { - "type": "number", - "rules": { - "number": true - } - }, - "system_picture_id": { - "type": "number", - "rules": { - "required": true, - "number": true - } - }, - "x": { - "type": "number", - "rules": { - "required": true, - "number": true - } - }, - "y": { - "type": "number", - "rules": { - "required": true, - "number": true - } - }, - "width": { - "type": "number", - "rules": { - "required": true, - "number": true, - "min": 1 - } - }, - "height": { - "type": "number", - "rules": { - "required": true, - "number": true, - "min": 1 - } - }, - "r": { - "type": "number", - "rules": { - "required": true, - "number": true - } - }, - "settings": { - "type": "text", - "rules": {} - }, - "created_at": { - "type": "datetime" - }, - "updated_at": { - "type": "datetime" - } + "admins": { + "caption": "site name for admin", + "url": "http://your.site.url/admins/", + "description": "admin register" + }, + "demand_users": { + "caption": "provider name", + "url": "http://your.site.url/demanders/", + "description": "provider description" } }, - "Speech": "speech", - "speech": { - "class_name": "Speech", - "table_name": "speeches", - "associations": { - "belongs_to": { - "speech_balloon": { - "id_column": "speech_balloon_id" - }, - "writing_format": { - "id_column": "writing_format_id" - } - }, - "has_many": {} - }, - "attributes": { - "id": { - "type": "number", - "primary_key": 1, - "rules": { - "number": true - } - }, - "speech_balloon_id": { - "type": "number", - "rules": { - "number": true - } - }, - "writing_format_id": { - "type": "number", - "source": { - "type": "model", - "model": "writing_format", - "method": "enable_list", - "caption": "caption" - }, - "rules": { - "required": true, - "number": true - } - }, - "content": { - "type": "text", - "rules": {} - }, - "font_size": { - "type": "float", - "rules": { - "required": true, - "number": true, - "min": 0 - }, - "source": { - "type": "magic_number", - "key": "speech_font_size_items" - } - }, - "text_align": { - "type": "number", - "rules": { - "required": true, - "number": true, - "range": [ - 0, - 3 - ] + "provider_sources": [ + "http://sourceforge.jp/projects/pettanr/wiki/ProviderSource/attach/provider_source.json" + ] + }, + "select_items": { + "provider_status_status_items": [ + [ + "select_items.provider_status.status.waiting", + 0 + ], + [ + "select_items.provider_status.status.receiving", + 1 + ] + ], + "demander_status_status_items": [ + [ + "select_items.demander_status.status.waiting", + 0 + ], + [ + "select_items.demander_status.status.rejected", + 1 + ], + [ + "select_items.demander_status.status.requesting", + 2 + ], + [ + "select_items.demander_status.status.approved", + 3 + ] + ], + "scroll_visible_items": [ + [ + "select_items.scroll.visible.private", + 0 + ], + [ + "select_items.scroll.visible.public", + 1 + ] + ], + "comic_visible_items": [ + [ + "select_items.comic.visible.private", + 0 + ], + [ + "select_items.comic.visible.public", + 1 + ] + ], + "story_visible_items": [ + [ + "select_items.story.visible.private", + 0 + ], + [ + "select_items.story.visible.public", + 1 + ] + ], + "sheet_visible_items": [ + [ + "select_items.sheet.visible.private", + 0 + ], + [ + "select_items.sheet.visible.public", + 1 + ] + ], + "panel_visible_items": [ + [ + "select_items.panel.visible.private", + 0 + ], + [ + "select_items.panel.visible.public", + 1 + ] + ], + "ground_picture_repeat_items": [ + [ + "select_items.ground_pictures.repeat.repeat", + 0 + ], + [ + "select_items.ground_pictures.repeat.repeat-x", + 1 + ], + [ + "select_items.ground_pictures.repeat.repeat-y", + 2 + ], + [ + "select_items.ground_pictures.repeat.no-repeat", + 3 + ] + ], + "ground_color_orientation_items": [ + [ + "select_items.ground_color.orientation.horizontal", + 0 + ], + [ + "select_items.ground_color.orientation.vertical", + 1 + ] + ], + "speech_font_size_items": [ + [ + "select_items.speeches.font_size.ultra_small", + 0.2 + ], + [ + "select_items.speeches.font_size.very_small", + 0.4 + ], + [ + "select_items.speeches.font_size.small", + 0.6 + ], + [ + "select_items.speeches.font_size.semi_small", + 0.8 + ], + [ + "select_items.speeches.font_size.normal", + 1 + ], + [ + "select_items.speeches.font_size.semi_large", + 1.5 + ], + [ + "select_items.speeches.font_size.large", + 2 + ], + [ + "select_items.speeches.font_size.very_large", + 3.5 + ], + [ + "select_items.speeches.font_size.ultra_large", + 5 + ] + ], + "speech_text_align_items": [ + [ + "select_items.speeches.text_align.none", + 0 + ], + [ + "select_items.speeches.text_align.left", + 1 + ], + [ + "select_items.speeches.text_align.right", + 2 + ], + [ + "select_items.speeches.text_align.center", + 3 + ] + ] + }, + "locals": { + "profilers": { + "scroll": { + "lists": { + "scroll_panels.by_scroll": { + "model_name": "scroll_panel", + "list_name": "by_scroll" }, - "source": { - "type": "magic_number", - "key": "speech_text_align_items" - } - }, - "fore_color": { - "type": "number", - "rules": { - "required": true, - "number": true, - "range": [ - 0, - 16777215 - ] - } - }, - "x": { - "type": "number", - "rules": { - "required": true, - "number": true - } - }, - "y": { - "type": "number", - "rules": { - "required": true, - "number": true + "panels.by_scroll": { + "model_name": "panel", + "list_name": "by_scroll" } }, - "width": { - "type": "number", - "rules": { - "required": true, - "number": true, - "min": 1 + "columns": [ + "id", + "title", + "description", + "visible", + "author_id", + "created_at", + "updated_at" + ], + "associations": { + "belongs_to": [ + "author" + ], + "has_many": [ + "scroll_panels.by_scroll", + "panels.by_scroll" + ] + } + }, + "scroll_panel": { + "lists": {}, + "columns": [ + "id", + "scroll_id", + "panel_id", + "t", + "author_id", + "created_at", + "updated_at" + ], + "associations": { + "belongs_to": [ + "scroll", + "panel" + ], + "has_many": [] + } + }, + "comic": { + "lists": { + "stories.by_comic": { + "model_name": "story", + "list_name": "by_comic" } }, - "height": { - "type": "number", - "rules": { - "required": true, - "number": true, - "min": 1 - } - }, - "quotes": { - "type": "text", - "rules": {} - }, - "settings": { - "type": "text", - "rules": {} - }, - "created_at": { - "type": "datetime" - }, - "updated_at": { - "type": "datetime" + "columns": [ + "id", + "title", + "description", + "visible", + "author_id", + "created_at", + "updated_at" + ], + "associations": { + "belongs_to": [ + "author" + ], + "has_many": [ + "stories.by_comic" + ] } - } - }, - "GroundPicture": "ground_picture", - "ground_picture": { - "class_name": "GroundPicture", - "table_name": "ground_pictures", - "associations": { - "belongs_to": { - "panel": { - "id_column": "panel_id" - } - }, - "has_many": {} }, - "attributes": { - "id": { - "type": "number", - "primary_key": 1, - "rules": { - "number": true - } - }, - "panel_id": { - "type": "number", - "rules": { - "number": true - } - }, - "picture_id": { - "type": "number", - "rules": { - "required": true, - "number": true - } - }, - "caption": { - "type": "text", - "rules": {} - }, - "repeat": { - "type": "number", - "rules": { - "required": true, - "number": true, - "range": [ - 0, - 3 - ] + "story": { + "lists": { + "story_sheets.by_story": { + "model_name": "story_sheet", + "list_name": "by_story" }, - "source": { - "type": "magic_number", - "key": "ground_picture_repeat_items" - } - }, - "x": { - "type": "number", - "rules": { - "required": true, - "number": true - } - }, - "y": { - "type": "number", - "rules": { - "required": true, - "number": true - } - }, - "z": { - "type": "number", - "rules": { - "required": true, - "number": true, - "min": 1 - } - }, - "t": { - "type": "number", - "rules": { - "required": true, - "number": true, - "min": 0 + "sheets.by_story": { + "model_name": "sheet", + "list_name": "by_sheet" } }, - "created_at": { - "type": "datetime" - }, - "updated_at": { - "type": "datetime" + "columns": [ + "id", + "comic_id", + "title", + "description", + "t", + "visible", + "created_at", + "updated_at" + ], + "associations": { + "belongs_to": [ + "comic" + ], + "has_many": [ + "story_sheets.by_story", + "sheets.by_story" + ] } - } - }, - "GroundColor": "ground_color", - "ground_color": { - "class_name": "GroundColor", - "table_name": "ground_colors", - "associations": { - "belongs_to": { - "panel": { - "id_column": "panel_id" - } - }, - "has_many": {} }, - "attributes": { - "id": { - "type": "number", - "primary_key": 1, - "rules": { - "number": true - } - }, - "panel_id": { - "type": "number", - "rules": { - "number": true - } - }, - "caption": { - "type": "text", - "rules": {} - }, - "code": { - "type": "number", - "rules": { - "required": true, - "number": true, - "range": [ - 0, - 16777215 - ] - } - }, - "orientation": { - "type": "number", - "rules": { - "required": true, - "number": true, - "range": [ - 0, - 1 - ] + "story_sheet": { + "lists": {}, + "columns": [ + "id", + "story_id", + "sheet_id", + "t", + "author_id", + "created_at", + "updated_at" + ], + "associations": { + "belongs_to": [ + "story", + "sheet" + ], + "has_many": [] + } + }, + "sheet": { + "lists": { + "story_sheets.by_sheet": { + "model_name": "story_sheet", + "list_name": "by_sheet" }, - "source": { - "type": "magic_number", - "key": "ground_color_orientation_items" - } - }, - "xy": { - "type": "number", - "rules": { - "number": true - } - }, - "wh": { - "type": "number", - "rules": { - "number": true + "stories.by_sheet": { + "model_name": "story", + "list_name": "by_sheet" + }, + "sheet_panels.by_sheet": { + "model_name": "sheet_panel", + "list_name": "by_sheet" + }, + "panels.by_sheet": { + "model_name": "panel", + "list_name": "by_sheet" } }, - "z": { - "type": "number", - "rules": { - "required": true, - "number": true, - "min": 1 - } - }, - "t": { - "type": "number", - "rules": { - "required": true, - "number": true, - "min": 0 - } - }, - "created_at": { - "type": "datetime" - }, - "updated_at": { - "type": "datetime" - } - } - }, - "OriginalPicture": "original_picture", - "original_picture": { - "class_name": "OriginalPicture", - "table_name": "original_pictures", - "associations": { - "belongs_to": { - "artist": { - "id_column": "artist_id" - } - }, - "has_many": { - "pictures": { - "foreign_key": "original_picture_id", - "list_method": "list_by_original_picture" - } - }, - "has_one": { - "resource_picture": { - "foreign_key": "original_picture_id", - "list_method": "list_by_original_picture" - } + "columns": [ + "id", + "caption", + "width", + "height", + "visible", + "author_id", + "created_at", + "updated_at" + ], + "associations": { + "belongs_to": [ + "author" + ], + "has_many": [ + "story_sheets.by_sheet", + "stories.by_sheet", + "sheet_panels.by_sheet", + "panels.by_sheet" + ] } }, - "attributes": { - "id": { - "type": "number", - "primary_key": 1, - "rules": { - "number": true - } - }, - "ext": { - "type": "text", - "rules": { - "required": true - } - }, - "width": { - "type": "number", - "rules": { - "required": true, - "number": true - } - }, - "height": { - "type": "number", - "rules": { - "required": true, - "number": true - } - }, - "filesize": { - "type": "number", - "rules": { - "required": true, - "number": true - } - }, - "artist_id": { - "type": "number", - "rules": { - "required": true, - "number": true - } - }, - "md5": { - "type": "text", - "rules": { - "required": true - } - }, - "uploaded_at": { - "type": "datetime" - }, - "published_at": { - "type": "datetime" - }, - "stopped_at": { - "type": "datetime" - }, - "created_at": { - "type": "datetime" - }, - "updated_at": { - "type": "datetime" + "sheet_panel": { + "lists": {}, + "columns": [ + "id", + "sheet_id", + "panel_id", + "x", + "y", + "z", + "t", + "author_id", + "created_at", + "updated_at" + ], + "associations": { + "belongs_to": [ + "sheet", + "panel" + ], + "has_many": [] } - } - }, - "Picture": "picture", - "picture": { - "class_name": "Picture", - "table_name": "pictures", - "associations": { - "belongs_to": { - "license": { - "id_column": "license_id" + }, + "panel": { + "lists": { + "scroll_panels.by_panel": { + "model_name": "scroll_panel", + "list_name": "by_panel" }, - "artist": { - "id_column": "artist_id" + "scrolls.by_panel": { + "model_name": "scroll", + "list_name": "by_panel" + }, + "sheet_panels.by_panel": { + "model_name": "sheet_panel", + "list_name": "by_panel" + }, + "sheets.by_panel": { + "model_name": "sheet", + "list_name": "by_panel" + }, + "panel_pictures.by_panel": { + "model_name": "panel_picture", + "list_name": "by_panel" + }, + "speech_balloons.by_panel": { + "model_name": "speech_balloon", + "list_name": "by_panel" + }, + "ground_pictures.by_panel": { + "model_name": "ground_picture", + "list_name": "by_panel" + }, + "ground_colors.by_panel": { + "model_name": "ground_color", + "list_name": "by_panel" } }, - "has_many": {}, - "has_one": {} + "columns": [ + "id", + "width", + "height", + "border", + "caption", + "publish", + "author_id", + "created_at", + "updated_at" + ], + "associations": { + "belongs_to": [ + "author" + ], + "has_many": [ + "scroll_panels.by_panel", + "scrolls.by_panel", + "sheet_panels.by_panel", + "sheets.by_panel", + "panel_pictures.by_panel", + "speech_balloons.by_panel", + "ground_pictures.by_panel", + "ground_colors.by_panel" + ] + } }, - "attributes": { - "id": { - "type": "number", - "primary_key": 1, - "rules": { - "number": true - } - }, - "original_picture_id": { - "type": "number", - "rules": { - "required": true, - "number": true + "panel_picture": { + "lists": {}, + "columns": [ + "id", + "panel_id", + "picture_id", + "caption", + "x", + "y", + "width", + "height", + "link", + "z", + "t", + "created_at", + "updated_at" + ], + "associations": { + "belongs_to": [ + "panel" + ], + "has_many": [] + } + }, + "speech_balloon": { + "lists": { + "balloon.by_speech_balloon": { + "model_name": "balloon", + "list_name": "by_speech_balloon" + }, + "speech.by_speech_balloon": { + "model_name": "panel", + "list_name": "by_speech_balloon" } }, - "revision": { - "type": "number", - "rules": { - "required": true, - "number": true - } - }, - "ext": { - "type": "text", - "rules": { - "required": true - } - }, - "width": { - "type": "number", - "rules": { - "required": true, - "number": true - } - }, - "height": { - "type": "number", - "rules": { - "required": true, - "number": true + "columns": [ + "id", + "panel_id", + "speech_balloon_template_id", + "classname", + "z", + "t", + "settings", + "caption", + "created_at", + "updated_at" + ], + "associations": { + "belongs_to": [ + "panel" + ], + "has_many": [], + "has_one": [ + "balloon.by_speech_balloon", + "speech.by_speech_balloon" + ] + } + }, + "speech": { + "lists": {}, + "columns": [ + "id", + "speech_balloon_id", + "writing_format_id", + "content", + "font_size", + "text_align", + "fore_color", + "x", + "y", + "width", + "height", + "quotes", + "settings", + "created_at", + "updated_at" + ], + "associations": { + "belongs_to": [ + "speech_balloon", + "writing_format" + ], + "has_many": [] + } + }, + "balloon": { + "lists": {}, + "columns": [ + "id", + "speech_balloon_id", + "system_picture_id", + "x", + "y", + "width", + "height", + "r", + "settings", + "created_at", + "updated_at" + ], + "associations": { + "belongs_to": [ + "speech_balloon", + "system_picture" + ], + "has_many": [] + } + }, + "ground_picture": { + "lists": {}, + "columns": [ + "id", + "panel_id", + "picture_id", + "caption", + "repeat", + "x", + "y", + "z", + "t", + "created_at", + "updated_at" + ], + "associations": { + "belongs_to": [ + "panel" + ], + "has_many": [] + } + }, + "ground_color": { + "lists": {}, + "columns": [ + "id", + "panel_id", + "caption", + "code", + "orientation", + "xy", + "wh", + "z", + "t", + "created_at", + "updated_at" + ], + "associations": { + "belongs_to": [ + "panel" + ], + "has_many": [] + } + }, + "original_picture": { + "lists": {}, + "columns": [ + "id", + "ext", + "width", + "height", + "filesize", + "artist_id", + "md5", + "uploaded_at", + "published_at", + "stopped_at", + "created_at", + "updated_at" + ], + "associations": { + "belongs_to": [ + "artist" + ], + "has_many": [], + "has_one": [ + "resource_picture" + ] + } + }, + "picture": { + "lists": {}, + "columns": [ + "id", + "original_picture_id", + "revision", + "ext", + "width", + "height", + "filesize", + "artist_id", + "license_id", + "md5", + "artist_name", + "credit", + "settings", + "classname", + "created_at", + "updated_at" + ], + "associations": { + "belongs_to": [ + "license", + "artist" + ], + "has_many": [], + "has_one": [] + } + }, + "resource_picture": { + "lists": {}, + "columns": [ + "id", + "original_picture_id", + "revision", + "ext", + "width", + "height", + "filesize", + "artist_id", + "license_id", + "md5", + "artist_name", + "credit", + "settings", + "picture_id", + "classname", + "created_at", + "updated_at" + ], + "associations": { + "belongs_to": [ + "original_picture", + "license", + "artist" + ], + "has_many": [], + "has_one": [] + } + }, + "speech_balloon_template": { + "lists": { + "speech_balloons.by_speech_balloon_template": { + "model_name": "speech_balloon", + "list_name": "by_speech_balloon_template" + }, + "panels.by_speech_balloon_template": { + "model_name": "panel", + "list_name": "by_speech_balloon_template" } }, - "filesize": { - "type": "number", - "rules": { - "required": true, - "number": true + "columns": [ + "id", + "name", + "classname", + "caption", + "t", + "system_picture_id", + "settings", + "created_at", + "updated_at" + ], + "associations": { + "belongs_to": [ + "system_picture" + ], + "has_many": [ + "speech_balloons.by_speech_balloon_template", + "panels.by_speech_balloon_template" + ], + "has_one": [] + } + }, + "writing_format": { + "lists": { + "speeches.by_writing_format": { + "model_name": "speech", + "list_name": "by_writing_format" } }, - "artist_id": { - "type": "number", - "rules": { - "required": true, - "number": true + "columns": [ + "id", + "name", + "classname", + "caption", + "system_picture_id", + "settings", + "created_at", + "updated_at" + ], + "associations": { + "belongs_to": [ + "system_picture" + ], + "has_many": [ + "speeches.by_writing_format" + ], + "has_one": [] + } + }, + "license_group": { + "lists": { + "licenses.by_license_group": { + "model_name": "license", + "list_name": "by_license_group" } }, - "license_id": { - "type": "number", - "rules": { - "required": true, - "number": true + "columns": [ + "id", + "name", + "classname", + "caption", + "url", + "created_at", + "updated_at" + ], + "associations": { + "belongs_to": [], + "has_many": [ + "licenses.by_license_group" + ], + "has_one": [] + } + }, + "license": { + "lists": { + "resource_pictures.by_license": { + "model_name": "resource_picture", + "list_name": "by_license" } }, - "md5": { - "type": "text", - "rules": { - "required": true + "columns": [ + "id", + "license_group_id", + "name", + "caption", + "system_picture_id", + "url", + "settings", + "credit_pictures", + "created_at", + "updated_at" + ], + "associations": { + "belongs_to": [ + "license_group", + "system_picture" + ], + "has_many": [ + "resource_pictures.by_license" + ], + "has_one": [] + } + }, + "author": { + "lists": { + "scrolls.by_author": { + "model_name": "scroll", + "list_name": "by_author" + }, + "comics.by_author": { + "model_name": "comic", + "list_name": "by_author" + }, + "stories.by_author": { + "model_name": "story", + "list_name": "by_author" + }, + "panels.by_author": { + "model_name": "panel", + "list_name": "by_author" + }, + "panel_pictures.by_author": { + "model_name": "panel_picture", + "list_name": "by_author" + }, + "speech_balloons.by_author": { + "model_name": "speech_balloon", + "list_name": "by_author" + }, + "ground_pictures.by_author": { + "model_name": "ground_picture", + "list_name": "by_author" + }, + "ground_colors.by_author": { + "model_name": "ground_color", + "list_name": "by_author" } }, - "artist_name": { - "type": "text", - "rules": { - "required": true + "columns": [ + "id", + "name", + "user_id", + "created_at", + "updated_at" + ], + "associations": { + "belongs_to": [], + "has_many": [ + "scrolls.by_author", + "comics.by_author", + "scrolls.by_author", + "stories.by_author", + "panels.by_author", + "panel_pictures.by_author", + "speech_balloons.by_author", + "ground_pictures.by_author", + "ground_colors.by_author" + ], + "has_one": [] + } + }, + "artist": { + "lists": { + "resource_pictures.by_artist": { + "model_name": "resource_picture", + "list_name": "by_artist" } }, - "credit": { - "type": "text", - "rules": {} - }, - "settings": { - "type": "text", - "rules": {} - }, - "classname": { - "type": "text", - "rules": { - "required": true + "columns": [ + "id", + "name", + "author_id", + "created_at", + "updated_at" + ], + "associations": { + "belongs_to": [], + "has_many": [ + "resource_pictures.by_artist" + ], + "has_one": [] + } + }, + "system_picture": { + "lists": { + "speech_balloon_templates.by_system_picture": { + "model_name": "speech_balloon_template", + "list_name": "by_system_picture" + }, + "licenses.by_system_picture": { + "model_name": "license", + "list_name": "by_system_picture" } }, - "created_at": { - "type": "datetime" - }, - "updated_at": { - "type": "datetime" + "columns": [ + "id", + "ext", + "width", + "height", + "filesize", + "md5", + "created_at", + "updated_at" + ], + "associations": { + "belongs_to": [], + "has_many": [ + "speech_balloon_templates.by_system_picture", + "licenses.by_system_picture" + ], + "has_one": [] } } }, - "ResourcePicture": "resource_picture", - "resource_picture": { - "class_name": "ResourcePicture", - "table_name": "resource_pictures", - "associations": { - "belongs_to": { - "license": { - "id_column": "license_id" - }, - "artist": { - "id_column": "artist_id" - } + "filers": { + "scroll": { + "symbol": { + "type": "image", + "name": "/assets/item.png" }, - "has_many": {}, - "has_one": {} - }, - "attributes": { - "id": { - "type": "number", - "primary_key": 1, - "rules": { - "number": true + "caption": { + "type": "column", + "name": "title", + "link": { + "type": "action", + "name": "play" } }, - "original_picture_id": { - "type": "number", - "rules": { - "required": true, - "number": true - } + "summary": { + "type": "template", + "name": "summary" }, - "revision": { - "type": "number", - "rules": { - "required": true, - "number": true + "edit": { + "type": "default" + } + }, + "scroll_panel": { + "symbol": { + "type": "image", + "name": "/assets/item.png", + "link": { + "type": "none" } }, - "ext": { - "type": "text", - "rules": { - "required": true - } + "caption": { + "type": "none" }, - "width": { - "type": "number", - "rules": { - "required": true, - "number": true - } + "summary": { + "type": "template", + "name": "summary" }, - "height": { - "type": "number", - "rules": { - "required": true, - "number": true - } + "edit": { + "type": "none" + } + }, + "comic": { + "symbol": { + "type": "image", + "name": "/assets/item.png" }, - "filesize": { - "type": "number", - "rules": { - "required": true, - "number": true - } + "caption": { + "type": "column", + "name": "title" }, - "artist_id": { - "type": "number", - "rules": { - "required": true, - "number": true - } + "summary": { + "type": "template", + "name": "summary" }, - "license_id": { - "type": "number", - "rules": { - "required": true, - "number": true - } + "edit": { + "type": "default" + } + }, + "story": { + "symbol": { + "type": "image", + "name": "/assets/item.png" }, - "md5": { - "type": "text", - "rules": { - "required": true + "caption": { + "type": "method", + "name": "title_with_t", + "link": { + "type": "action", + "name": "play" } }, - "artist_name": { - "type": "text", - "rules": { - "required": true + "summary": { + "type": "template", + "name": "summary" + }, + "edit": { + "type": "default" + } + }, + "story_sheet": { + "symbol": { + "type": "image", + "name": "/assets/item.png", + "link": { + "type": "none" } }, - "credit": { - "type": "text", - "rules": {} + "caption": { + "type": "none" }, - "settings": { - "type": "text", - "rules": {} + "summary": { + "type": "template", + "name": "summary" }, - "picture_id": { - "type": "number", - "rules": { - "required": true, - "number": true - } + "edit": { + "type": "none" + } + }, + "sheet": { + "symbol": { + "type": "image", + "name": "/assets/item.png" }, - "classname": { - "type": "text", - "rules": { - "required": true + "caption": { + "type": "column", + "name": "caption", + "link": { + "type": "action", + "name": "play" } }, - "created_at": { - "type": "datetime" + "summary": { + "type": "template", + "name": "summary" }, - "updated_at": { - "type": "datetime" + "edit": { + "type": "default" } - } - }, - "SpeechBalloonTemplate": "speech_balloon_template", - "speech_balloon_template": { - "class_name": "SpeechBalloonTemplate", - "table_name": "speech_balloon_templates", - "associations": { - "belongs_to": { - "system_picture": { - "id_column": "system_picture_id" + }, + "sheet_panel": { + "symbol": { + "type": "image", + "name": "/assets/item.png", + "link": { + "type": "none" } }, - "has_many": { - "speech_balloons": { - "foreign_key": "speech_balloon_template_id", - "list_method": "list_by_speech_balloon_template" - }, - "panels": { - "through": "speech_balloons", - "foreign_key": "speech_balloon_template_id", - "list_method": "list_by_speech_balloon_template" - } + "caption": { + "type": "none" }, - "has_one": {} + "summary": { + "type": "template", + "name": "summary" + }, + "edit": { + "type": "none" + } }, - "attributes": { - "id": { - "type": "number", - "primary_key": 1, - "rules": { - "number": true - } + "panel": { + "symbol": { + "type": "image", + "name": "/assets/item.png" }, - "name": { - "type": "text", - "rules": { - "required": true + "caption": { + "type": "method", + "name": "plain_scenario", + "link": { + "type": "none" } }, - "classname": { - "type": "text", - "rules": { - "required": true - } + "summary": { + "type": "template", + "name": "summary" + }, + "edit": { + "type": "default" + } + }, + "panel_picture": { + "symbol": { + "type": "picture", + "name": "symbol_option" }, "caption": { - "type": "text", - "rules": { - "required": true - } + "type": "column", + "name": "caption" }, - "t": { - "type": "number", - "rules": { - "required": true, - "number": true, - "min": 0 - } + "summary": { + "type": "template", + "name": "summary" }, - "system_picture_id": { - "type": "number", - "rules": { - "required": true, - "number": true - } + "edit": { + "type": "none" + } + }, + "speech_balloon": { + "symbol": { + "type": "picture", + "name": "symbol_option" }, - "settings": { - "type": "text", - "rules": { - "required": true + "caption": { + "type": "method", + "name": "plain_scenario", + "link": { + "type": "none" } }, - "created_at": { - "type": "datetime" + "summary": { + "type": "template", + "name": "summary" }, - "updated_at": { - "type": "datetime" + "edit": { + "type": "none" } }, - "select": { - "method": "enable_list", + "speech": { + "symbol": { + "type": "picture", + "name": "symbol_option" + }, "caption": { "type": "column", - "name": "caption" - } - } - }, - "WritingFormat": "writing_format", - "writing_format": { - "class_name": "WritingFormat", - "table_name": "writing_formats", - "associations": { - "belongs_to": { - "system_picture": { - "id_column": "system_picture_id" + "name": "content", + "link": { + "type": "none" } }, - "has_many": { - "speeches": { - "foreign_key": "writing_format_id", - "list_method": "list_by_writing_format" - } + "summary": { + "type": "template", + "name": "summary" }, - "has_one": {} + "edit": { + "type": "none" + } }, - "attributes": { - "id": { - "type": "number", - "primary_key": 1, - "rules": { - "number": true - } - }, - "name": { - "type": "text", - "rules": { - "required": true - } - }, - "classname": { - "type": "text", - "rules": { - "required": true - } + "balloon": { + "symbol": { + "type": "picture", + "name": "symbol_option" }, "caption": { - "type": "text", - "rules": { - "required": true - } + "type": "none" }, - "system_picture_id": { - "type": "number", - "rules": { - "required": true, - "number": true - } + "summary": { + "type": "template", + "name": "summary" }, - "settings": { - "type": "text", - "rules": { - "required": true - } + "edit": { + "type": "none" + } + }, + "ground_picture": { + "symbol": { + "type": "picture", + "name": "symbol_option" }, - "created_at": { - "type": "datetime" + "caption": { + "type": "column", + "name": "caption" }, - "updated_at": { - "type": "datetime" + "summary": { + "type": "template", + "name": "summary" + }, + "edit": { + "type": "none" } }, - "select": { - "method": "enable_list", + "ground_color": { + "symbol": { + "type": "template", + "name": "symbol" + }, "caption": { "type": "column", "name": "caption" - } - } - }, - "LicenseGroup": "license_group", - "license_group": { - "class_name": "LicenseGroup", - "table_name": "license_groups", - "associations": { - "belongs_to": {}, - "has_many": { - "licenses": { - "foreign_key": "license_group_id", - "list_method": "list_by_license_group" - } }, - "has_one": {} + "summary": { + "type": "template", + "name": "summary" + }, + "edit": { + "type": "none" + } }, - "attributes": { - "id": { - "type": "number", - "primary_key": 1, - "rules": { - "number": true - } + "original_picture": { + "symbol": { + "type": "picture", + "name": "symbol_option" }, - "name": { - "type": "text", - "rules": { - "required": true + "caption": { + "type": "method", + "name": "revision", + "link": { + "type": "action", + "name": "history" } }, - "classname": { - "type": "text", - "rules": { - "required": true - } + "summary": { + "type": "template", + "name": "summary" + }, + "edit": { + "type": "template", + "name": "publish" + } + }, + "picture": { + "symbol": { + "type": "picture", + "name": "symbol_option" }, "caption": { - "type": "text", - "rules": { - "required": true - } + "type": "column", + "name": "revision" }, - "url": { - "type": "text", - "rules": { - "required": true - } + "summary": { + "type": "template", + "name": "summary" }, - "created_at": { - "type": "datetime" + "edit": { + "type": "none" + } + }, + "resource_picture": { + "symbol": { + "type": "picture", + "name": "symbol_option" }, - "updated_at": { - "type": "datetime" + "caption": { + "type": "none" + }, + "summary": { + "type": "template", + "name": "summary" + }, + "edit": { + "type": "none" } }, - "select": { - "method": "list", + "speech_balloon_template": { + "symbol": { + "type": "picture", + "name": "symbol_option" + }, "caption": { "type": "column", "name": "caption" - } - } - }, - "License": "license", - "license": { - "class_name": "License", - "table_name": "licenses", - "associations": { - "belongs_to": { - "license_group": { - "id_column": "license_group_id" - }, - "system_picture": { - "id_column": "system_picture_id" - } }, - "has_many": { - "resource_pictures": { - "foreign_key": "license_id", - "list_method": "list_by_license" - } + "summary": { + "type": "none" }, - "has_one": {} + "edit": { + "type": "none" + } }, - "attributes": { - "id": { - "type": "number", - "primary_key": 1, - "rules": { - "number": true - } + "writing_format": { + "symbol": { + "type": "image", + "name": "/assets/item.png" }, - "license_group_id": { - "type": "number", - "rules": { - "number": true - } + "caption": { + "type": "column", + "name": "caption" }, - "name": { - "type": "text", - "rules": { - "required": true - } + "summary": { + "type": "none" + }, + "edit": { + "type": "none" + } + }, + "license_group": { + "symbol": { + "type": "image", + "name": "/assets/item.png" }, "caption": { - "type": "text", - "rules": { - "required": true + "type": "column", + "name": "caption", + "link": { + "type": "url_column", + "name": "url" } }, - "system_picture_id": { - "type": "number", - "rules": { - "required": true, - "number": true - } + "summary": { + "type": "none" }, - "url": { - "type": "text", - "rules": { - "required": true + "edit": { + "type": "none" + } + }, + "license": { + "symbol": { + "type": "image", + "name": "/assets/item.png" + }, + "caption": { + "type": "method", + "name": "caption_with_group", + "link": { + "type": "url_column", + "name": "url" } }, - "settings": { - "type": "text", - "rules": {} + "summary": { + "type": "template", + "name": "summary" }, - "credit_pictures": { - "type": "text", - "rules": {} + "edit": { + "type": "none" + } + }, + "author": { + "symbol": { + "type": "image", + "name": "/assets/item.png" }, - "created_at": { - "type": "datetime" + "caption": { + "type": "column", + "name": "name" }, - "updated_at": { - "type": "datetime" + "summary": { + "type": "template", + "name": "summary" + }, + "edit": { + "type": "account" + } + }, + "artist": { + "symbol": { + "type": "image", + "name": "/assets/item.png" + }, + "caption": { + "type": "column", + "name": "name" + }, + "summary": { + "type": "template", + "name": "summary" + }, + "edit": { + "type": "account" + } + }, + "system_picture": { + "symbol": { + "type": "picture", + "name": "symbol_option" + }, + "caption": { + "type": "none" + }, + "summary": { + "type": "none" + }, + "edit": { + "type": "none" } } }, - "Author": "author", - "author": { - "class_name": "Author", - "table_name": "authors", - "associations": { - "belongs_to": {}, - "has_many": { - "scrolls": { - "foreign_key": "author_id", - "list_method": "list_by_author" + "elements": [ + { + "name": "panel_picture", + "path_name": "panel_pictures", + "parts": [] + }, + { + "name": "speech_balloon", + "path_name": "circle_speech_balloon/speech_balloons", + "parts": [ + "balloon", + "speech" + ] + }, + { + "name": "ground_picture", + "path_name": "ground_pictures", + "parts": [] + }, + { + "name": "ground_color", + "path_name": "ground_colors", + "parts": [] + } + ], + "forms": { + "Panel": "panel", + "panel": { + "attributes": { + "caption": { + "column": "caption", + "type": "text", + "label": {}, + "options": { + "row_break": true + } + }, + "width": { + "column": "width", + "type": "number", + "label": {}, + "options": { + "size": 5 + } + }, + "height": { + "column": "height", + "type": "number", + "label": {}, + "options": { + "size": 5, + "row_break": true + } + }, + "border": { + "column": "border", + "type": "number", + "label": {}, + "options": { + "size": 5 + } + }, + "publish": { + "column": "publish", + "type": "select", + "label": {}, + "options": { + "source": "magic_number", + "key": "comic_visible_items", + "size": 5, + "row_break": true + } + }, + "id": { + "column": "id", + "type": "hidden", + "label": { + "type": "hidden" + }, + "options": {} + }, + "author_id": { + "column": "author_id", + "type": "hidden", + "label": { + "type": "hidden" + }, + "options": {} + } + }, + "fields": [ + "caption", + "width", + "height", + "border", + "publish", + "id", + "author_id" + ] + }, + "PanelPicture": "panel_picture", + "panel_picture": { + "attributes": { + "caption": { + "column": "caption", + "type": "text", + "label": {}, + "options": { + "row_break": true + } + }, + "x": { + "column": "x", + "type": "number", + "label": {}, + "options": { + "size": 5 + } + }, + "y": { + "column": "y", + "type": "number", + "label": {}, + "options": { + "size": 5, + "row_break": true + } + }, + "width": { + "column": "width", + "type": "number", + "label": {}, + "options": { + "size": 5, + "row_break": true + }, + "helpers": { + "size": { + "path": "panels/size_helper", + "options": { + "class": "panel_picture_width_tool" + } + } + } + }, + "height": { + "column": "height", + "type": "number", + "label": {}, + "options": { + "size": 5, + "row_break": true + }, + "helpers": { + "size": { + "path": "panels/size_helper", + "options": { + "class": "panel_picture_height_tool" + } + } + } + }, + "link": { + "column": "link", + "type": "text", + "label": {}, + "options": { + "row_break": true + } + }, + "id": { + "column": "id", + "type": "hidden", + "label": { + "type": "hidden" + }, + "options": {} + }, + "panel_id": { + "column": "panel_id", + "type": "hidden", + "label": { + "type": "hidden" + }, + "options": {} + }, + "picture_id": { + "column": "picture_id", + "type": "hidden", + "label": {}, + "helpers": { + "popup": { + "path": "panels/popup_helper", + "source": "pictures", + "options": {} + } + }, + "options": {} + }, + "z": { + "column": "z", + "type": "hidden", + "label": { + "type": "hidden" + }, + "options": {} + }, + "t": { + "column": "t", + "type": "hidden", + "label": { + "type": "hidden" + }, + "options": {} + } + }, + "fields": [ + "caption", + "x", + "y", + "width", + "height", + "link", + "id", + "panel_id", + "picture_id", + "z", + "t" + ] + }, + "speech_balloon": { + "attributes": { + "speech_balloon.id": { + "column": "id", + "type": "hidden", + "label": { + "type": "hidden" + }, + "options": {} + }, + "speech_balloon.panel_id": { + "column": "panel_id", + "type": "hidden", + "label": { + "type": "hidden" + }, + "options": {} + }, + "speech_balloon.speech_balloon_template_id": { + "column": "speech_balloon_template_id", + "type": "hidden", + "label": { + "type": "hidden" + }, + "options": {} + }, + "speech_balloon.caption": { + "column": "caption", + "type": "text", + "label": {}, + "options": { + "row_break": true + } + }, + "speech_balloon.z": { + "column": "z", + "type": "hidden", + "label": { + "type": "hidden" + }, + "options": {} + }, + "speech_balloon.t": { + "column": "t", + "type": "hidden", + "label": { + "type": "hidden" + }, + "options": {} + }, + "speech_balloon.classname": { + "column": "classname", + "type": "hidden", + "label": { + "type": "hidden" + }, + "options": {} + }, + "speech_balloon.settings": { + "column": "settings", + "type": "hidden", + "label": { + "type": "hidden" + }, + "options": {} + }, + "balloon.id": { + "model": "balloon", + "part": "balloon", + "column": "id", + "type": "hidden", + "label": { + "type": "hidden" + }, + "options": {} + }, + "balloon.speech_balloon_id": { + "model": "balloon", + "part": "balloon", + "column": "speech_balloon_id", + "type": "hidden", + "label": { + "type": "hidden" + }, + "options": {} + }, + "balloon.system_picture_id": { + "model": "balloon", + "part": "balloon", + "column": "system_picture_id", + "type": "hidden", + "label": { + "type": "hidden" + }, + "options": {} + }, + "balloon.r": { + "model": "balloon", + "part": "balloon", + "column": "r", + "type": "number", + "label": {}, + "options": { + "size": 5, + "row_break": true + }, + "helpers": { + "tail_angle": { + "path": "panels/tail_angle_helper", + "options": {} + } + } + }, + "balloon.x": { + "model": "balloon", + "part": "balloon", + "column": "x", + "type": "number", + "label": {}, + "options": { + "size": 5 + } + }, + "balloon.y": { + "model": "balloon", + "part": "balloon", + "column": "y", + "type": "number", + "label": {}, + "options": { + "size": 5, + "row_break": true + } + }, + "balloon.width": { + "model": "balloon", + "part": "balloon", + "column": "width", + "type": "number", + "label": {}, + "options": { + "size": 5 + } + }, + "balloon.height": { + "model": "balloon", + "part": "balloon", + "column": "height", + "type": "number", + "label": {}, + "options": { + "size": 5, + "row_break": true + } + }, + "balloon.settings": { + "model": "balloon", + "part": "balloon", + "column": "settings", + "type": "hidden", + "label": { + "type": "hidden" + }, + "options": {} + }, + "speech.id": { + "model": "speech", + "part": "speech", + "column": "id", + "type": "hidden", + "label": { + "type": "hidden" + }, + "options": {} + }, + "speech.speech_balloon_id": { + "model": "speech", + "part": "speech", + "column": "speech_balloon_id", + "type": "hidden", + "label": { + "type": "hidden" + }, + "options": {} + }, + "speech.x": { + "model": "speech", + "part": "speech", + "column": "x", + "type": "hidden", + "label": { + "type": "hidden" + }, + "options": {} + }, + "speech.y": { + "model": "speech", + "part": "speech", + "column": "y", + "type": "hidden", + "label": { + "type": "hidden" + }, + "options": {} + }, + "speech.width": { + "model": "speech", + "part": "speech", + "column": "width", + "type": "hidden", + "label": { + "type": "hidden" + }, + "options": {} + }, + "speech.height": { + "model": "speech", + "part": "speech", + "column": "height", + "type": "hidden", + "label": { + "type": "hidden" + }, + "options": {} + }, + "speech.writing_format_id": { + "model": "speech", + "part": "speech", + "column": "writing_format_id", + "type": "select", + "label": {}, + "options": { + "source": "model", + "model": "writing_format", + "method": "enable_list", + "caption": "caption" + } + }, + "speech.font_size": { + "model": "speech", + "part": "speech", + "column": "font_size", + "type": "select", + "label": {}, + "options": { + "source": "magic_number", + "key": "speech_font_size_items", + "row_break": true + } + }, + "speech.text_align": { + "model": "speech", + "part": "speech", + "column": "text_align", + "type": "select", + "label": {}, + "options": { + "source": "magic_number", + "key": "speech_text_align_items" + } }, - "comics": { - "foreign_key": "author_id", - "list_method": "list_by_author" + "speech.quotes": { + "model": "speech", + "part": "speech", + "column": "quotes", + "type": "text", + "label": {}, + "options": { + "size": 5 + } }, - "stories": { - "foreign_key": "author_id", - "list_method": "list_by_author" + "speech.content": { + "model": "speech", + "part": "speech", + "column": "content", + "type": "text_area", + "label": { + "row_break": true + }, + "options": { + "size": "45x5" + } }, - "sheets": { - "foreign_key": "author_id", - "list_method": "list_by_author" + "speech.fore_color": { + "model": "speech", + "part": "speech", + "column": "fore_color", + "type": "hidden", + "label": { + "row_break": true + }, + "options": {}, + "helpers": { + "color": { + "path": "panels/color_helper", + "options": {}, + "wrapper": "speech-fore_color-wrap" + } + } }, - "panels": { - "foreign_key": "author_id", - "list_method": "list_by_author" - } - }, - "has_one": {} - }, - "attributes": { - "id": { - "type": "number", - "primary_key": 1, - "rules": { - "number": true - } - }, - "name": { - "type": "text", - "rules": { - "required": true - } - }, - "user_id": { - "type": "number", - "rules": { - "required": true, - "number": true - } - }, - "created_at": { - "type": "datetime" - }, - "updated_at": { - "type": "datetime" - } - }, - "select": { - "method": "list", - "caption": { - "type": "column", - "name": "name" - } - } - }, - "Artist": "artist", - "artist": { - "class_name": "Artist", - "table_name": "artists", - "associations": { - "belongs_to": {}, - "has_many": { - "resource_pictures": { - "foreign_key": "artist_id", - "list_method": "list_by_artist" - } - }, - "has_one": {} - }, - "attributes": { - "id": { - "type": "number", - "primary_key": 1, - "rules": { - "number": true - } - }, - "name": { - "type": "text", - "rules": { - "required": true - } - }, - "author_id": { - "type": "number", - "rules": { - "required": true, - "number": true + "speech.settings": { + "model": "speech", + "part": "speech", + "column": "settings", + "type": "hidden", + "label": { + "type": "hidden" + }, + "options": {} } - }, - "created_at": { - "type": "datetime" - }, - "updated_at": { - "type": "datetime" } }, - "select": { - "method": "list", - "caption": { - "type": "column", - "name": "name" - } - } - }, - "SystemPicture": "system_picture", - "system_picture": { - "class_name": "SystemPicture", - "table_name": "system_pictures", - "associations": { - "belongs_to": {}, - "has_many": {}, - "has_one": {} + "CircleSpeechBalloon": "circle_speech_balloon", + "circle_speech_balloon": { + "base": "speech_balloon", + "attributes": {}, + "fields": [ + "speech_balloon.caption", + "balloon.r", + "balloon.x", + "balloon.y", + "balloon.width", + "balloon.height", + "balloon.id", + "balloon.speech_balloon_id", + "balloon.system_picture_id", + "balloon.settings", + "speech.writing_format_id", + "speech.font_size", + "speech.text_align", + "speech.quotes", + "speech.content", + "speech.fore_color", + "speech.id", + "speech.speech_balloon_id", + "speech.x", + "speech.y", + "speech.width", + "speech.height", + "speech.settings", + "speech_balloon.id", + "speech_balloon.panel_id", + "speech_balloon.speech_balloon_template_id", + "speech_balloon.classname", + "speech_balloon.z", + "speech_balloon.t", + "speech_balloon.settings" + ] }, - "attributes": { - "id": { - "type": "number", - "primary_key": 1, - "rules": { - "number": true - } - }, - "ext": { - "type": "text", - "rules": { - "required": true - } - }, - "width": { - "type": "number", - "rules": { - "required": true, - "number": true + "PlainSpeechBalloon": "plain_speech_balloon", + "plain_speech_balloon": { + "base": "speech_balloon", + "attributes": { + "balloon.r": { + "model": "balloon", + "part": "balloon", + "column": "r", + "type": "hidden", + "label": { + "type": "hidden" + }, + "options": {} } }, - "height": { - "type": "number", - "rules": { - "required": true, - "number": true + "fields": [ + "speech_balloon.caption", + "balloon.r", + "balloon.x", + "balloon.y", + "balloon.width", + "balloon.height", + "balloon.id", + "balloon.speech_balloon_id", + "balloon.system_picture_id", + "balloon.settings", + "speech.writing_format_id", + "speech.font_size", + "speech.text_align", + "speech.quotes", + "speech.content", + "speech.fore_color", + "speech.id", + "speech.speech_balloon_id", + "speech.x", + "speech.y", + "speech.width", + "speech.height", + "speech.settings", + "speech_balloon.id", + "speech_balloon.panel_id", + "speech_balloon.speech_balloon_template_id", + "speech_balloon.classname", + "speech_balloon.z", + "speech_balloon.t", + "speech_balloon.settings" + ] + }, + "SquareSpeechBalloon": "square_speech_balloon", + "square_speech_balloon": { + "base": "speech_balloon", + "attributes": { + "balloon.r": { + "model": "balloon", + "part": "balloon", + "column": "r", + "type": "hidden", + "label": { + "type": "hidden" + }, + "options": {} } }, - "filesize": { - "type": "number", - "rules": { - "required": true, - "number": true + "fields": [ + "speech_balloon.caption", + "balloon.r", + "balloon.x", + "balloon.y", + "balloon.width", + "balloon.height", + "balloon.id", + "balloon.speech_balloon_id", + "balloon.system_picture_id", + "balloon.settings", + "speech.writing_format_id", + "speech.font_size", + "speech.text_align", + "speech.quotes", + "speech.content", + "speech.fore_color", + "speech.id", + "speech.speech_balloon_id", + "speech.x", + "speech.y", + "speech.width", + "speech.height", + "speech.settings", + "speech_balloon.id", + "speech_balloon.panel_id", + "speech_balloon.speech_balloon_template_id", + "speech_balloon.classname", + "speech_balloon.z", + "speech_balloon.t", + "speech_balloon.settings" + ] + }, + "GroundPicture": "ground_picture", + "ground_picture": { + "attributes": { + "id": { + "column": "id", + "type": "hidden", + "label": { + "type": "hidden" + }, + "options": {} + }, + "panel_id": { + "column": "panel_id", + "type": "hidden", + "label": { + "type": "hidden" + }, + "options": {} + }, + "picture_id": { + "column": "picture_id", + "type": "hidden", + "label": { + "type": "hidden" + }, + "options": {} + }, + "caption": { + "column": "caption", + "type": "text", + "label": {}, + "options": { + "row_break": true + } + }, + "repeat": { + "column": "repeat", + "type": "select", + "label": {}, + "options": { + "source": "magic_number", + "key": "ground_picture_repeat_items", + "row_break": true + } + }, + "x": { + "column": "x", + "type": "number", + "label": {}, + "options": { + "size": 5 + } + }, + "y": { + "column": "y", + "type": "number", + "label": {}, + "options": { + "size": 5, + "row_break": true + } + }, + "z": { + "column": "z", + "type": "hidden", + "label": { + "type": "hidden" + }, + "options": {} + }, + "t": { + "column": "t", + "type": "hidden", + "label": { + "type": "hidden" + }, + "options": {} } }, - "md5": { - "type": "text", - "rules": { - "required": true + "fields": [ + "caption", + "repeat", + "x", + "y", + "z", + "t", + "id", + "panel_id", + "picture_id" + ] + }, + "GroundColor": "ground_color", + "ground_color": { + "attributes": { + "id": { + "column": "id", + "type": "hidden", + "label": { + "type": "hidden" + }, + "options": {} + }, + "panel_id": { + "column": "panel_id", + "type": "hidden", + "label": { + "type": "hidden" + }, + "options": {} + }, + "caption": { + "column": "caption", + "type": "text", + "label": {}, + "options": { + "row_break": true + } + }, + "code": { + "column": "code", + "type": "hidden", + "label": { + "row_break": true + }, + "options": { + "row_break": true + }, + "helpers": { + "color": { + "path": "panels/color_helper", + "options": {}, + "wrapper": "ground_color-code-wrap" + } + } + }, + "orientation": { + "column": "orientation", + "type": "select", + "label": {}, + "options": { + "source": "magic_number", + "key": "ground_color_orientation_items", + "row_break": true + } + }, + "xy": { + "column": "xy", + "type": "number", + "label": {}, + "options": { + "size": 5 + } + }, + "wh": { + "column": "wh", + "type": "number", + "label": {}, + "options": { + "size": 5, + "row_break": true + } + }, + "z": { + "column": "z", + "type": "hidden", + "label": { + "type": "hidden" + }, + "options": {} + }, + "t": { + "column": "t", + "type": "hidden", + "label": { + "type": "hidden" + }, + "options": {} } }, - "created_at": { - "type": "datetime" - }, - "updated_at": { - "type": "datetime" - } + "fields": [ + "id", + "panel_id", + "caption", + "code", + "orientation", + "xy", + "wh", + "z", + "t" + ] } } } -- 2.11.0