From 560060866d96d7253a57f75055a583f2d9fb8d19 Mon Sep 17 00:00:00 2001 From: yasushiito Date: Fri, 21 Mar 2014 11:00:38 +0900 Subject: [PATCH] separate manifest --- .../manifest/work/list_groups.js.coffee.erb | 7 +- app/assets/javascripts/panels.js.coffee | 20 +- app/assets/javascripts/system.js.coffee | 20 +- app/controllers/application_controller.rb | 10 +- app/controllers/system_controller.rb | 2 + app/views/system/index.html.erb | 3 +- config/environment.rb | 4 + lib/editor/panel_dock/bay/root.rb | 2 +- lib/editor/panel_dock/board/element.rb | 2 +- lib/local_manifest.rb | 10 + lib/{manifest => local_manifest}/filer.rb | 14 +- lib/{manifest => local_manifest}/filer/caption.rb | 10 +- .../filer/caption/base.rb | 2 +- .../filer/caption/default.rb | 6 +- .../filer/caption/default/face.rb | 4 +- .../filer/caption/default/face/face.rb | 2 +- .../filer/caption/default/link.rb | 4 +- .../filer/caption/default/link/link.rb | 2 +- .../filer/caption/none.rb | 2 +- .../filer/caption/template.rb | 2 +- lib/{manifest => local_manifest}/filer/date.rb | 4 +- .../filer/date/date.rb | 2 +- lib/{manifest => local_manifest}/filer/edit.rb | 4 +- .../filer/edit/edit.rb | 2 +- lib/{manifest => local_manifest}/filer/icon.rb | 4 +- .../filer/icon/icon.rb | 2 +- lib/{manifest => local_manifest}/filer/summary.rb | 4 +- .../filer/summary/summary.rb | 2 +- lib/{manifest => local_manifest}/filer/symbol.rb | 8 +- .../filer/symbol/base.rb | 2 +- .../filer/symbol/default.rb | 6 +- .../filer/symbol/default/face.rb | 4 +- .../filer/symbol/default/face/face.rb | 2 +- .../filer/symbol/default/link.rb | 4 +- .../filer/symbol/default/link/link.rb | 2 +- .../filer/symbol/template.rb | 2 +- lib/{manifest => local_manifest}/form.rb | 4 +- lib/{manifest => local_manifest}/form/field.rb | 4 +- .../form/field/field.rb | 8 +- .../form/field/helper.rb | 12 +- .../form/field/helper/base.rb | 2 +- .../form/field/helper/color.rb | 2 +- .../form/field/helper/popup.rb | 2 +- .../form/field/helper/size.rb | 2 +- .../form/field/helper/tail_angle.rb | 2 +- .../form/field/label.rb | 4 +- .../form/field/label/label.rb | 2 +- lib/{manifest => local_manifest}/form/field/tag.rb | 14 +- .../form/field/tag/base.rb | 2 +- .../form/field/tag/hidden.rb | 2 +- .../form/field/tag/number.rb | 2 +- .../form/field/tag/select.rb | 2 +- .../form/field/tag/text.rb | 2 +- .../form/field/tag/text_area.rb | 2 +- lib/{manifest => local_manifest}/list_group.rb | 4 +- .../list_group/list.rb | 18 +- .../list_group/list/base.rb | 6 +- .../list_group/list/filter.rb | 2 +- .../list_group/list/foreign_filter.rb | 6 +- .../list_group/list/includes.rb | 10 +- .../list_group/list/includes/auto.rb | 2 +- .../list_group/list/includes/base.rb | 2 +- .../list_group/list/includes/method.rb | 2 +- .../list_group/list/includes/none.rb | 2 +- .../list_group/list/play.rb | 2 +- .../list_group/list/private.rb | 2 +- .../list_group/list/public.rb | 2 +- .../list_group/list/system_resource.rb | 2 +- .../list_group/list/through_filter.rb | 2 +- .../list_group/list/where.rb | 8 +- .../list_group/list/where/auto.rb | 2 +- .../list_group/list/where/base.rb | 2 +- .../list_group/list/where/method.rb | 2 +- lib/local_manifest/local_manifest.rb | 37 + lib/{manifest => local_manifest}/profiler.rb | 8 +- .../profiler/association.rb | 8 +- .../profiler/association/belongs_to.rb | 2 +- .../profiler/association/has_many.rb | 4 +- .../profiler/association/has_one.rb | 4 +- .../profiler/column.rb | 2 +- lib/{manifest => local_manifest}/profiler/list.rb | 2 +- lib/locmare.rb | 1 + lib/locmare/filer.rb | 39 + lib/locmare/filer/body.rb | 45 + .../body.rb => locmare/filer/body/file_body.rb} | 35 +- lib/locmare/filer/body/file_body/file_item.rb | 63 + .../filer/body/file_body/file_item/caption.rb | 28 + .../filer/body/file_body/file_item/caption/base.rb | 60 + .../body/file_body/file_item/caption/default.rb | 37 + .../file_body/file_item/caption/default/face.rb | 29 + .../file_item/caption/default/face/face.rb | 87 + .../file_body/file_item/caption/default/link.rb | 29 + .../file_item/caption/default/link/link.rb | 54 + .../filer/body/file_body/file_item/caption/none.rb | 19 + .../body/file_body/file_item/caption/template.rb | 18 + lib/locmare/filer/body/file_body/file_item/date.rb | 25 + .../filer/body/file_body/file_item/date/date.rb | 78 + lib/locmare/filer/body/file_body/file_item/edit.rb | 25 + .../filer/body/file_body/file_item/edit/edit.rb | 158 ++ lib/locmare/filer/body/file_body/file_item/icon.rb | 25 + .../filer/body/file_body/file_item/icon/icon.rb | 86 + .../filer/body/file_body/file_item/summary.rb | 25 + .../body/file_body/file_item/summary/summary.rb | 89 + .../filer/body/file_body/file_item/symbol.rb | 27 + .../filer/body/file_body/file_item/symbol/base.rb | 60 + .../body/file_body/file_item/symbol/default.rb | 37 + .../file_body/file_item/symbol/default/face.rb | 29 + .../file_item/symbol/default/face/face.rb | 84 + .../file_body/file_item/symbol/default/link.rb | 29 + .../file_item/symbol/default/link/link.rb | 53 + .../body/file_body/file_item/symbol/template.rb | 34 + lib/locmare/filer/body/file_header.rb | 63 + .../filer/body/file_header/base.rb} | 28 +- lib/locmare/filer/body/file_header/none.rb | 13 + lib/locmare/filer/body/file_header/show.rb | 13 + lib/locmare/filer/footer.rb | 24 + lib/locmare/filer/header.rb | 39 + lib/locmare/form.rb | 65 + lib/locmare/form/field.rb | 81 + lib/locmare/form/field/helper.rb | 26 + lib/locmare/form/field/helper/base.rb | 50 + lib/locmare/form/field/helper/color.rb | 15 + lib/locmare/form/field/helper/popup.rb | 13 + lib/locmare/form/field/helper/size.rb | 16 + lib/locmare/form/field/helper/tail_angle.rb | 12 + lib/locmare/form/field/label.rb | 21 + lib/locmare/form/field/label/label.rb | 92 + lib/locmare/form/field/tag.rb | 27 + lib/locmare/form/field/tag/base.rb | 70 + lib/locmare/form/field/tag/hidden.rb | 15 + lib/locmare/form/field/tag/number.rb | 15 + lib/locmare/form/field/tag/select.rb | 25 + lib/locmare/form/field/tag/text.rb | 15 + lib/locmare/form/field/tag/text_area.rb | 15 + lib/locmare/list_group.rb | 29 + lib/locmare/list_group/list/base.rb | 107 + lib/locmare/list_group/list/filter.rb | 37 + lib/locmare/list_group/list/foreign_filter.rb | 24 + lib/locmare/list_group/list/play.rb | 41 + lib/locmare/list_group/list/private.rb | 42 + lib/locmare/list_group/list/public.rb | 16 + lib/locmare/list_group/list/system_resource.rb | 19 + lib/locmare/list_group/list/through_filter.rb | 25 + lib/locmare/locmare.rb | 4 + lib/locmare/profiler.rb | 64 + lib/locmare/profiler/association.rb | 68 + lib/locmare/profiler/association/belongs_to.rb | 48 + lib/locmare/profiler/association/has_many.rb | 32 + lib/locmare/profiler/association/has_one.rb | 32 + lib/locmare/profiler/column.rb | 116 + lib/locmare/profiler/header.rb | 17 + lib/manifest.rb | 5 - lib/manifest/local/view.rb | 10 - lib/manifest/local/view/filer.rb | 40 - .../local/view/filer/body/file_body/file_item.rb | 65 - .../view/filer/body/file_body/file_item/caption.rb | 30 - .../filer/body/file_body/file_item/caption/base.rb | 62 - .../body/file_body/file_item/caption/default.rb | 39 - .../file_body/file_item/caption/default/face.rb | 31 - .../file_item/caption/default/face/face.rb | 89 - .../file_body/file_item/caption/default/link.rb | 31 - .../file_item/caption/default/link/link.rb | 56 - .../filer/body/file_body/file_item/caption/none.rb | 21 - .../body/file_body/file_item/caption/template.rb | 20 - .../view/filer/body/file_body/file_item/date.rb | 27 - .../filer/body/file_body/file_item/date/date.rb | 80 - .../view/filer/body/file_body/file_item/edit.rb | 27 - .../filer/body/file_body/file_item/edit/edit.rb | 160 -- .../view/filer/body/file_body/file_item/icon.rb | 27 - .../filer/body/file_body/file_item/icon/icon.rb | 88 - .../view/filer/body/file_body/file_item/summary.rb | 27 - .../body/file_body/file_item/summary/summary.rb | 91 - .../view/filer/body/file_body/file_item/symbol.rb | 29 - .../filer/body/file_body/file_item/symbol/base.rb | 62 - .../body/file_body/file_item/symbol/default.rb | 39 - .../file_body/file_item/symbol/default/face.rb | 31 - .../file_item/symbol/default/face/face.rb | 86 - .../file_body/file_item/symbol/default/link.rb | 31 - .../file_item/symbol/default/link/link.rb | 55 - .../body/file_body/file_item/symbol/template.rb | 36 - lib/manifest/local/view/filer/body/file_header.rb | 65 - .../local/view/filer/body/file_header/base.rb | 50 - .../local/view/filer/body/file_header/none.rb | 15 - .../local/view/filer/body/file_header/show.rb | 15 - lib/manifest/local/view/filer/footer.rb | 26 - lib/manifest/local/view/filer/header.rb | 41 - lib/manifest/local/view/form.rb | 67 - lib/manifest/local/view/form/field.rb | 83 - lib/manifest/local/view/form/field/helper.rb | 28 - lib/manifest/local/view/form/field/helper/base.rb | 52 - lib/manifest/local/view/form/field/helper/color.rb | 17 - lib/manifest/local/view/form/field/helper/popup.rb | 15 - lib/manifest/local/view/form/field/helper/size.rb | 18 - .../local/view/form/field/helper/tail_angle.rb | 14 - lib/manifest/local/view/form/field/label.rb | 23 - lib/manifest/local/view/form/field/label/label.rb | 94 - lib/manifest/local/view/form/field/tag.rb | 29 - lib/manifest/local/view/form/field/tag/base.rb | 72 - lib/manifest/local/view/form/field/tag/hidden.rb | 17 - lib/manifest/local/view/form/field/tag/number.rb | 17 - lib/manifest/local/view/form/field/tag/select.rb | 27 - lib/manifest/local/view/form/field/tag/text.rb | 17 - .../local/view/form/field/tag/text_area.rb | 17 - lib/manifest/local/view/list_group.rb | 30 - lib/manifest/local/view/list_group/list/base.rb | 109 - lib/manifest/local/view/list_group/list/filter.rb | 39 - .../local/view/list_group/list/foreign_filter.rb | 24 - lib/manifest/local/view/list_group/list/play.rb | 43 - lib/manifest/local/view/list_group/list/private.rb | 44 - lib/manifest/local/view/list_group/list/public.rb | 18 - .../local/view/list_group/list/system_resource.rb | 21 - .../local/view/list_group/list/through_filter.rb | 27 - lib/manifest/local/view/profiler.rb | 65 - lib/manifest/local/view/profiler/association.rb | 70 - .../local/view/profiler/association/belongs_to.rb | 52 - .../local/view/profiler/association/has_many.rb | 34 - .../local/view/profiler/association/has_one.rb | 34 - lib/manifest/local/view/profiler/column.rb | 118 - lib/manifest/local/view/profiler/header.rb | 19 - lib/manifest/manifest.rb | 28 +- lib/manifest/system_resource.rb | 2 +- public/local_manifest.json | 2712 ++++++++++++++++++++ 222 files changed, 5802 insertions(+), 3180 deletions(-) create mode 100644 lib/local_manifest.rb rename lib/{manifest => local_manifest}/filer.rb (82%) rename lib/{manifest => local_manifest}/filer/caption.rb (70%) rename lib/{manifest => local_manifest}/filer/caption/base.rb (97%) rename lib/{manifest => local_manifest}/filer/caption/default.rb (79%) rename lib/{manifest => local_manifest}/filer/caption/default/face.rb (89%) rename lib/{manifest => local_manifest}/filer/caption/default/face/face.rb (98%) rename lib/{manifest => local_manifest}/filer/caption/default/link.rb (90%) rename lib/{manifest => local_manifest}/filer/caption/default/link/link.rb (98%) rename lib/{manifest => local_manifest}/filer/caption/none.rb (93%) rename lib/{manifest => local_manifest}/filer/caption/template.rb (95%) rename lib/{manifest => local_manifest}/filer/date.rb (88%) rename lib/{manifest => local_manifest}/filer/date/date.rb (96%) rename lib/{manifest => local_manifest}/filer/edit.rb (89%) rename lib/{manifest => local_manifest}/filer/edit/edit.rb (98%) rename lib/{manifest => local_manifest}/filer/icon.rb (88%) rename lib/{manifest => local_manifest}/filer/icon/icon.rb (96%) rename lib/{manifest => local_manifest}/filer/summary.rb (88%) rename lib/{manifest => local_manifest}/filer/summary/summary.rb (97%) rename lib/{manifest => local_manifest}/filer/symbol.rb (75%) rename lib/{manifest => local_manifest}/filer/symbol/base.rb (97%) rename lib/{manifest => local_manifest}/filer/symbol/default.rb (79%) rename lib/{manifest => local_manifest}/filer/symbol/default/face.rb (89%) rename lib/{manifest => local_manifest}/filer/symbol/default/face/face.rb (98%) rename lib/{manifest => local_manifest}/filer/symbol/default/link.rb (90%) rename lib/{manifest => local_manifest}/filer/symbol/default/link/link.rb (98%) rename lib/{manifest => local_manifest}/filer/symbol/template.rb (95%) rename lib/{manifest => local_manifest}/form.rb (96%) rename lib/{manifest => local_manifest}/form/field.rb (89%) rename lib/{manifest => local_manifest}/form/field/field.rb (92%) rename lib/{manifest => local_manifest}/form/field/helper.rb (70%) rename lib/{manifest => local_manifest}/form/field/helper/base.rb (97%) rename lib/{manifest => local_manifest}/form/field/helper/color.rb (94%) rename lib/{manifest => local_manifest}/form/field/helper/popup.rb (93%) rename lib/{manifest => local_manifest}/form/field/helper/size.rb (94%) rename lib/{manifest => local_manifest}/form/field/helper/tail_angle.rb (93%) rename lib/{manifest => local_manifest}/form/field/label.rb (87%) rename lib/{manifest => local_manifest}/form/field/label/label.rb (98%) rename lib/{manifest => local_manifest}/form/field/tag.rb (66%) rename lib/{manifest => local_manifest}/form/field/tag/base.rb (97%) rename lib/{manifest => local_manifest}/form/field/tag/hidden.rb (87%) rename lib/{manifest => local_manifest}/form/field/tag/number.rb (95%) rename lib/{manifest => local_manifest}/form/field/tag/select.rb (87%) rename lib/{manifest => local_manifest}/form/field/tag/text.rb (95%) rename lib/{manifest => local_manifest}/form/field/tag/text_area.rb (95%) rename lib/{manifest => local_manifest}/list_group.rb (93%) rename lib/{manifest => local_manifest}/list_group/list.rb (62%) rename lib/{manifest => local_manifest}/list_group/list/base.rb (90%) rename lib/{manifest => local_manifest}/list_group/list/filter.rb (96%) rename lib/{manifest => local_manifest}/list_group/list/foreign_filter.rb (63%) rename lib/{manifest => local_manifest}/list_group/list/includes.rb (71%) rename lib/{manifest => local_manifest}/list_group/list/includes/auto.rb (97%) rename lib/{manifest => local_manifest}/list_group/list/includes/base.rb (97%) rename lib/{manifest => local_manifest}/list_group/list/includes/method.rb (96%) rename lib/{manifest => local_manifest}/list_group/list/includes/none.rb (94%) rename lib/{manifest => local_manifest}/list_group/list/play.rb (99%) rename lib/{manifest => local_manifest}/list_group/list/private.rb (84%) rename lib/{manifest => local_manifest}/list_group/list/public.rb (91%) rename lib/{manifest => local_manifest}/list_group/list/system_resource.rb (92%) rename lib/{manifest => local_manifest}/list_group/list/through_filter.rb (93%) rename lib/{manifest => local_manifest}/list_group/list/where.rb (75%) rename lib/{manifest => local_manifest}/list_group/list/where/auto.rb (96%) rename lib/{manifest => local_manifest}/list_group/list/where/base.rb (97%) rename lib/{manifest => local_manifest}/list_group/list/where/method.rb (96%) create mode 100644 lib/local_manifest/local_manifest.rb rename lib/{manifest => local_manifest}/profiler.rb (86%) rename lib/{manifest => local_manifest}/profiler/association.rb (84%) rename lib/{manifest => local_manifest}/profiler/association/belongs_to.rb (96%) rename lib/{manifest => local_manifest}/profiler/association/has_many.rb (93%) rename lib/{manifest => local_manifest}/profiler/association/has_one.rb (93%) rename lib/{manifest => local_manifest}/profiler/column.rb (98%) rename lib/{manifest => local_manifest}/profiler/list.rb (97%) create mode 100644 lib/locmare.rb create mode 100644 lib/locmare/filer.rb create mode 100644 lib/locmare/filer/body.rb rename lib/{manifest/local/view/filer/body.rb => locmare/filer/body/file_body.rb} (50%) create mode 100644 lib/locmare/filer/body/file_body/file_item.rb create mode 100644 lib/locmare/filer/body/file_body/file_item/caption.rb create mode 100644 lib/locmare/filer/body/file_body/file_item/caption/base.rb create mode 100644 lib/locmare/filer/body/file_body/file_item/caption/default.rb create mode 100644 lib/locmare/filer/body/file_body/file_item/caption/default/face.rb create mode 100644 lib/locmare/filer/body/file_body/file_item/caption/default/face/face.rb create mode 100644 lib/locmare/filer/body/file_body/file_item/caption/default/link.rb create mode 100644 lib/locmare/filer/body/file_body/file_item/caption/default/link/link.rb create mode 100644 lib/locmare/filer/body/file_body/file_item/caption/none.rb create mode 100644 lib/locmare/filer/body/file_body/file_item/caption/template.rb create mode 100644 lib/locmare/filer/body/file_body/file_item/date.rb create mode 100644 lib/locmare/filer/body/file_body/file_item/date/date.rb create mode 100644 lib/locmare/filer/body/file_body/file_item/edit.rb create mode 100644 lib/locmare/filer/body/file_body/file_item/edit/edit.rb create mode 100644 lib/locmare/filer/body/file_body/file_item/icon.rb create mode 100644 lib/locmare/filer/body/file_body/file_item/icon/icon.rb create mode 100644 lib/locmare/filer/body/file_body/file_item/summary.rb create mode 100644 lib/locmare/filer/body/file_body/file_item/summary/summary.rb create mode 100644 lib/locmare/filer/body/file_body/file_item/symbol.rb create mode 100644 lib/locmare/filer/body/file_body/file_item/symbol/base.rb create mode 100644 lib/locmare/filer/body/file_body/file_item/symbol/default.rb create mode 100644 lib/locmare/filer/body/file_body/file_item/symbol/default/face.rb create mode 100644 lib/locmare/filer/body/file_body/file_item/symbol/default/face/face.rb create mode 100644 lib/locmare/filer/body/file_body/file_item/symbol/default/link.rb create mode 100644 lib/locmare/filer/body/file_body/file_item/symbol/default/link/link.rb create mode 100644 lib/locmare/filer/body/file_body/file_item/symbol/template.rb create mode 100644 lib/locmare/filer/body/file_header.rb rename lib/{manifest/local/view/filer/body/file_body.rb => locmare/filer/body/file_header/base.rb} (57%) create mode 100644 lib/locmare/filer/body/file_header/none.rb create mode 100644 lib/locmare/filer/body/file_header/show.rb create mode 100644 lib/locmare/filer/footer.rb create mode 100644 lib/locmare/filer/header.rb create mode 100644 lib/locmare/form.rb create mode 100644 lib/locmare/form/field.rb create mode 100644 lib/locmare/form/field/helper.rb create mode 100644 lib/locmare/form/field/helper/base.rb create mode 100644 lib/locmare/form/field/helper/color.rb create mode 100644 lib/locmare/form/field/helper/popup.rb create mode 100644 lib/locmare/form/field/helper/size.rb create mode 100644 lib/locmare/form/field/helper/tail_angle.rb create mode 100644 lib/locmare/form/field/label.rb create mode 100644 lib/locmare/form/field/label/label.rb create mode 100644 lib/locmare/form/field/tag.rb create mode 100644 lib/locmare/form/field/tag/base.rb create mode 100644 lib/locmare/form/field/tag/hidden.rb create mode 100644 lib/locmare/form/field/tag/number.rb create mode 100644 lib/locmare/form/field/tag/select.rb create mode 100644 lib/locmare/form/field/tag/text.rb create mode 100644 lib/locmare/form/field/tag/text_area.rb create mode 100644 lib/locmare/list_group.rb create mode 100644 lib/locmare/list_group/list/base.rb create mode 100644 lib/locmare/list_group/list/filter.rb create mode 100644 lib/locmare/list_group/list/foreign_filter.rb create mode 100644 lib/locmare/list_group/list/play.rb create mode 100644 lib/locmare/list_group/list/private.rb create mode 100644 lib/locmare/list_group/list/public.rb create mode 100644 lib/locmare/list_group/list/system_resource.rb create mode 100644 lib/locmare/list_group/list/through_filter.rb create mode 100644 lib/locmare/locmare.rb create mode 100644 lib/locmare/profiler.rb create mode 100644 lib/locmare/profiler/association.rb create mode 100644 lib/locmare/profiler/association/belongs_to.rb create mode 100644 lib/locmare/profiler/association/has_many.rb create mode 100644 lib/locmare/profiler/association/has_one.rb create mode 100644 lib/locmare/profiler/column.rb create mode 100644 lib/locmare/profiler/header.rb delete mode 100644 lib/manifest/local/view.rb delete mode 100644 lib/manifest/local/view/filer.rb delete mode 100644 lib/manifest/local/view/filer/body/file_body/file_item.rb delete mode 100644 lib/manifest/local/view/filer/body/file_body/file_item/caption.rb delete mode 100644 lib/manifest/local/view/filer/body/file_body/file_item/caption/base.rb delete mode 100644 lib/manifest/local/view/filer/body/file_body/file_item/caption/default.rb delete mode 100644 lib/manifest/local/view/filer/body/file_body/file_item/caption/default/face.rb delete mode 100644 lib/manifest/local/view/filer/body/file_body/file_item/caption/default/face/face.rb delete mode 100644 lib/manifest/local/view/filer/body/file_body/file_item/caption/default/link.rb delete mode 100644 lib/manifest/local/view/filer/body/file_body/file_item/caption/default/link/link.rb delete mode 100644 lib/manifest/local/view/filer/body/file_body/file_item/caption/none.rb delete mode 100644 lib/manifest/local/view/filer/body/file_body/file_item/caption/template.rb delete mode 100644 lib/manifest/local/view/filer/body/file_body/file_item/date.rb delete mode 100644 lib/manifest/local/view/filer/body/file_body/file_item/date/date.rb delete mode 100644 lib/manifest/local/view/filer/body/file_body/file_item/edit.rb delete mode 100644 lib/manifest/local/view/filer/body/file_body/file_item/edit/edit.rb delete mode 100644 lib/manifest/local/view/filer/body/file_body/file_item/icon.rb delete mode 100644 lib/manifest/local/view/filer/body/file_body/file_item/icon/icon.rb delete mode 100644 lib/manifest/local/view/filer/body/file_body/file_item/summary.rb delete mode 100644 lib/manifest/local/view/filer/body/file_body/file_item/summary/summary.rb delete mode 100644 lib/manifest/local/view/filer/body/file_body/file_item/symbol.rb delete mode 100644 lib/manifest/local/view/filer/body/file_body/file_item/symbol/base.rb delete mode 100644 lib/manifest/local/view/filer/body/file_body/file_item/symbol/default.rb delete mode 100644 lib/manifest/local/view/filer/body/file_body/file_item/symbol/default/face.rb delete mode 100644 lib/manifest/local/view/filer/body/file_body/file_item/symbol/default/face/face.rb delete mode 100644 lib/manifest/local/view/filer/body/file_body/file_item/symbol/default/link.rb delete mode 100644 lib/manifest/local/view/filer/body/file_body/file_item/symbol/default/link/link.rb delete mode 100644 lib/manifest/local/view/filer/body/file_body/file_item/symbol/template.rb delete mode 100644 lib/manifest/local/view/filer/body/file_header.rb delete mode 100644 lib/manifest/local/view/filer/body/file_header/base.rb delete mode 100644 lib/manifest/local/view/filer/body/file_header/none.rb delete mode 100644 lib/manifest/local/view/filer/body/file_header/show.rb delete mode 100644 lib/manifest/local/view/filer/footer.rb delete mode 100644 lib/manifest/local/view/filer/header.rb delete mode 100644 lib/manifest/local/view/form.rb delete mode 100644 lib/manifest/local/view/form/field.rb delete mode 100644 lib/manifest/local/view/form/field/helper.rb delete mode 100644 lib/manifest/local/view/form/field/helper/base.rb delete mode 100644 lib/manifest/local/view/form/field/helper/color.rb delete mode 100644 lib/manifest/local/view/form/field/helper/popup.rb delete mode 100644 lib/manifest/local/view/form/field/helper/size.rb delete mode 100644 lib/manifest/local/view/form/field/helper/tail_angle.rb delete mode 100644 lib/manifest/local/view/form/field/label.rb delete mode 100644 lib/manifest/local/view/form/field/label/label.rb delete mode 100644 lib/manifest/local/view/form/field/tag.rb delete mode 100644 lib/manifest/local/view/form/field/tag/base.rb delete mode 100644 lib/manifest/local/view/form/field/tag/hidden.rb delete mode 100644 lib/manifest/local/view/form/field/tag/number.rb delete mode 100644 lib/manifest/local/view/form/field/tag/select.rb delete mode 100644 lib/manifest/local/view/form/field/tag/text.rb delete mode 100644 lib/manifest/local/view/form/field/tag/text_area.rb delete mode 100644 lib/manifest/local/view/list_group.rb delete mode 100644 lib/manifest/local/view/list_group/list/base.rb delete mode 100644 lib/manifest/local/view/list_group/list/filter.rb delete mode 100644 lib/manifest/local/view/list_group/list/foreign_filter.rb delete mode 100644 lib/manifest/local/view/list_group/list/play.rb delete mode 100644 lib/manifest/local/view/list_group/list/private.rb delete mode 100644 lib/manifest/local/view/list_group/list/public.rb delete mode 100644 lib/manifest/local/view/list_group/list/system_resource.rb delete mode 100644 lib/manifest/local/view/list_group/list/through_filter.rb delete mode 100644 lib/manifest/local/view/profiler.rb delete mode 100644 lib/manifest/local/view/profiler/association.rb delete mode 100644 lib/manifest/local/view/profiler/association/belongs_to.rb delete mode 100644 lib/manifest/local/view/profiler/association/has_many.rb delete mode 100644 lib/manifest/local/view/profiler/association/has_one.rb delete mode 100644 lib/manifest/local/view/profiler/column.rb delete mode 100644 lib/manifest/local/view/profiler/header.rb create mode 100644 public/local_manifest.json diff --git a/app/assets/javascripts/manifest/work/list_groups.js.coffee.erb b/app/assets/javascripts/manifest/work/list_groups.js.coffee.erb index 3c71f6fa..14f21931 100644 --- a/app/assets/javascripts/manifest/work/list_groups.js.coffee.erb +++ b/app/assets/javascripts/manifest/work/list_groups.js.coffee.erb @@ -43,7 +43,7 @@ type: 'filter', }, by_author: { - type: 'filter', + type: 'foreign_filter', args: { tree_name: 'scroll_owner', }, @@ -59,10 +59,7 @@ type: 'private', }, by_author: { - type: 'foreign_filter', - args: { - tree_name: 'comic_owner', - }, + type: 'filter', }, }, }, diff --git a/app/assets/javascripts/panels.js.coffee b/app/assets/javascripts/panels.js.coffee index 9033f617..c8462002 100644 --- a/app/assets/javascripts/panels.js.coffee +++ b/app/assets/javascripts/panels.js.coffee @@ -8,20 +8,22 @@ $ -> confirm_confirm_confirm = () -> confirm( ) editor = window.PettanrEditor - configurations = { + manifest = { controllers: window.controllers, models: window.models, system_resources: window.system_resources, magic_numbers: window.magic_numbers, - locals: { - profilers: window.profilers, - filers: window.filers, - list_groups: window.list_groups, - forms: window.forms, - } } - j = JSON.stringify(configurations, undefined, 2) - $('#pettanr-configurations').val(j) + local_manifest = { + list_groups: window.list_groups, + profilers: window.profilers, + filers: window.filers, + forms: window.forms, + } + j = JSON.stringify(manifest, undefined, 2) + $('#pettanr-manifest').val(j) + j = JSON.stringify(local_manifest, undefined, 2) + $('#pettanr-local_manifest').val(j) WritingFormat = window.PettanrWritingFormat WritingFormat.load($('#writing_formats')) SpeechBalloonTemplate = window.PettanrSpeechBalloonTemplate diff --git a/app/assets/javascripts/system.js.coffee b/app/assets/javascripts/system.js.coffee index 94e77c02..e51224a8 100644 --- a/app/assets/javascripts/system.js.coffee +++ b/app/assets/javascripts/system.js.coffee @@ -1,15 +1,17 @@ $ -> - configurations = { + manifest = { controllers: window.controllers, models: window.models, system_resources: window.system_resources, magic_numbers: window.magic_numbers, - locals: { - list_groups: window.list_groups, - profilers: window.profilers, - filers: window.filers, - forms: window.forms, - } } - j = JSON.stringify(configurations, undefined, 2) - $('#pettanr-configurations').val(j) + local_manifest = { + list_groups: window.list_groups, + profilers: window.profilers, + filers: window.filers, + forms: window.forms, + } + j = JSON.stringify(manifest, undefined, 2) + $('#pettanr-manifest').val(j) + j = JSON.stringify(local_manifest, undefined, 2) + $('#pettanr-local_manifest').val(j) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 620649cf..2b1f42c7 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -117,7 +117,7 @@ class ApplicationController < ActionController::Base def set_list set_model - @list = Manifest::View::ListGroup.list @my_action.item_name, @my_action.list_name + @list = Locmare::ListGroup.list @my_action.item_name, @my_action.list_name end def filer_list @@ -126,7 +126,7 @@ class ApplicationController < ActionController::Base @items = list_result.items respond_to do |format| format.html { - @filer = Manifest::View::Filer.new @list.item_name, list_result.items, list_result.paginate, @operators + @filer = Locmare::Filer.new @list.item_name, list_result.items, list_result.paginate, @operators render @filer.template_name, :locals => { :filer => @filer } @@ -145,7 +145,7 @@ class ApplicationController < ActionController::Base def show_prof_format format format.prof { self.formats = [:html] - @profiler = Manifest::View::Profiler.new @my_model.model_name, @item, @operators + @profiler = Locmare::Profiler.new @my_model.model_name, @item, @operators render @profiler.template_name, :locals => { :profiler => @profiler } @@ -170,7 +170,7 @@ class ApplicationController < ActionController::Base def render_form respond_to do |format| format.html { - @form = Manifest::View::Form.new @item.item_name, @item, true, true, @operators + @form = Locmare::Form.new @item.item_name, @item, true, true, @operators render @form.template_name, :locals => { :form => @form } @@ -217,7 +217,7 @@ class ApplicationController < ActionController::Base end def assist_items item_name, list_name - list = Manifest::View::ListGroup.list item_name, list_name + list = Locmare::ListGroup.list item_name, list_name list_result = list.open(@operators, {:id => @item.id, :page => 1, :page_size => 5}) list_result.items end diff --git a/app/controllers/system_controller.rb b/app/controllers/system_controller.rb index 03d35951..e2fe608a 100644 --- a/app/controllers/system_controller.rb +++ b/app/controllers/system_controller.rb @@ -15,6 +15,8 @@ class SystemController < ApplicationController def reload_manifest Manifest::load JSON.parse(open(Rails.root + 'public/manifest.json').read) Manifest.manifest.init + LocalManifest::load JSON.parse(open(Rails.root + 'public/local_manifest.json').read) + LocalManifest.manifest.init respond_to do |format| format.html { redirect_to({:action => :index}) } end diff --git a/app/views/system/index.html.erb b/app/views/system/index.html.erb index 6be92245..a773e660 100644 --- a/app/views/system/index.html.erb +++ b/app/views/system/index.html.erb @@ -23,4 +23,5 @@
<%= link_to 'reload_manifest', :action => :reload_manifest %>
- <%= text_area_tag "json", '', :id => 'pettanr-configurations' %> + <%= text_area_tag "json", '', :id => 'pettanr-manifest' %> + <%= text_area_tag "json", '', :id => 'pettanr-local_manifest' %> diff --git a/config/environment.rb b/config/environment.rb index 81c96d01..461bca1f 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -13,6 +13,10 @@ require 'peta' # Initialize the rails application Pettanr::Application.initialize! require_dependency 'manifest' +require_dependency 'local_manifest' +require_dependency 'locmare' require_dependency 'editor' Manifest.manifest.init +LocalManifest.manifest.init +Manifest.manifest.system_resources_init Manifest.manifest.load_models_manifest diff --git a/lib/editor/panel_dock/bay/root.rb b/lib/editor/panel_dock/bay/root.rb index 3027b36e..e32ed26f 100644 --- a/lib/editor/panel_dock/bay/root.rb +++ b/lib/editor/panel_dock/bay/root.rb @@ -13,7 +13,7 @@ module Editor def initialize parent super - @form = ::Manifest::View::Form.new self.root_item.item_name, self.root_item, self.mounted, true, @operators + @form = Locmare::Form.new self.root_item.item_name, self.root_item, self.mounted, true, @operators @bucket = FormBucket.new self, @form end diff --git a/lib/editor/panel_dock/board/element.rb b/lib/editor/panel_dock/board/element.rb index 9e13a2c4..a525ad0b 100644 --- a/lib/editor/panel_dock/board/element.rb +++ b/lib/editor/panel_dock/board/element.rb @@ -36,7 +36,7 @@ module Editor def initialize parent super - @form = ::Manifest::View::Form.new self.element.item_name, self.element, self.mounted, false, @operators + @form = Locmare::Form.new self.element.item_name, self.element, self.mounted, false, @operators @bucket = FormBucket.new self, @form end diff --git a/lib/local_manifest.rb b/lib/local_manifest.rb new file mode 100644 index 00000000..bc8a1482 --- /dev/null +++ b/lib/local_manifest.rb @@ -0,0 +1,10 @@ +module LocalManifest +end +require_dependency "local_manifest/local_manifest" +require_dependency "local_manifest/profiler" +require_dependency "local_manifest/filer" +require_dependency "local_manifest/form" +require_dependency "local_manifest/list_group" +LocalManifest::load JSON.parse(open(File.expand_path('../../public/local_manifest.json', __FILE__)).read) + +LocalManifest.manifest.init diff --git a/lib/manifest/filer.rb b/lib/local_manifest/filer.rb similarity index 82% rename from lib/manifest/filer.rb rename to lib/local_manifest/filer.rb index 4d6b93c2..6f1c3e3d 100644 --- a/lib/manifest/filer.rb +++ b/lib/local_manifest/filer.rb @@ -1,10 +1,10 @@ -require_dependency "manifest/filer/symbol" -require_dependency "manifest/filer/caption" -require_dependency "manifest/filer/summary" -require_dependency "manifest/filer/icon" -require_dependency "manifest/filer/date" -require_dependency "manifest/filer/edit" -module Manifest +require_dependency "local_manifest/filer/symbol" +require_dependency "local_manifest/filer/caption" +require_dependency "local_manifest/filer/summary" +require_dependency "local_manifest/filer/icon" +require_dependency "local_manifest/filer/date" +require_dependency "local_manifest/filer/edit" +module LocalManifest class Filer def self.manager manifest, my_manifests diff --git a/lib/manifest/filer/caption.rb b/lib/local_manifest/filer/caption.rb similarity index 70% rename from lib/manifest/filer/caption.rb rename to lib/local_manifest/filer/caption.rb index d57a0cf8..3289dbe7 100644 --- a/lib/manifest/filer/caption.rb +++ b/lib/local_manifest/filer/caption.rb @@ -1,8 +1,8 @@ -require_dependency "manifest/filer/caption/base" -require_dependency "manifest/filer/caption/default" -require_dependency "manifest/filer/caption/template" -require_dependency "manifest/filer/caption/none" -module Manifest +require_dependency "local_manifest/filer/caption/base" +require_dependency "local_manifest/filer/caption/default" +require_dependency "local_manifest/filer/caption/template" +require_dependency "local_manifest/filer/caption/none" +module LocalManifest module FilerModule class CaptionFactory include CaptionModule diff --git a/lib/manifest/filer/caption/base.rb b/lib/local_manifest/filer/caption/base.rb similarity index 97% rename from lib/manifest/filer/caption/base.rb rename to lib/local_manifest/filer/caption/base.rb index 81bdab9e..7ed16a40 100644 --- a/lib/manifest/filer/caption/base.rb +++ b/lib/local_manifest/filer/caption/base.rb @@ -1,4 +1,4 @@ -module Manifest +module LocalManifest module FilerModule module CaptionModule class Base diff --git a/lib/manifest/filer/caption/default.rb b/lib/local_manifest/filer/caption/default.rb similarity index 79% rename from lib/manifest/filer/caption/default.rb rename to lib/local_manifest/filer/caption/default.rb index 1d98019d..a35b9d7b 100644 --- a/lib/manifest/filer/caption/default.rb +++ b/lib/local_manifest/filer/caption/default.rb @@ -1,6 +1,6 @@ -require_dependency "manifest/filer/caption/default/face" -require_dependency "manifest/filer/caption/default/link" -module Manifest +require_dependency "local_manifest/filer/caption/default/face" +require_dependency "local_manifest/filer/caption/default/link" +module LocalManifest module FilerModule module CaptionModule class Default < Base diff --git a/lib/manifest/filer/caption/default/face.rb b/lib/local_manifest/filer/caption/default/face.rb similarity index 89% rename from lib/manifest/filer/caption/default/face.rb rename to lib/local_manifest/filer/caption/default/face.rb index fb4faeb9..73d95ca7 100644 --- a/lib/manifest/filer/caption/default/face.rb +++ b/lib/local_manifest/filer/caption/default/face.rb @@ -1,5 +1,5 @@ -require_dependency "manifest/filer/caption/default/face/face" -module Manifest +require_dependency "local_manifest/filer/caption/default/face/face" +module LocalManifest module FilerModule module CaptionModule module DefaultModule diff --git a/lib/manifest/filer/caption/default/face/face.rb b/lib/local_manifest/filer/caption/default/face/face.rb similarity index 98% rename from lib/manifest/filer/caption/default/face/face.rb rename to lib/local_manifest/filer/caption/default/face/face.rb index 87849915..0b591b2d 100644 --- a/lib/manifest/filer/caption/default/face/face.rb +++ b/lib/local_manifest/filer/caption/default/face/face.rb @@ -1,4 +1,4 @@ -module Manifest +module LocalManifest module FilerModule module CaptionModule module DefaultModule diff --git a/lib/manifest/filer/caption/default/link.rb b/lib/local_manifest/filer/caption/default/link.rb similarity index 90% rename from lib/manifest/filer/caption/default/link.rb rename to lib/local_manifest/filer/caption/default/link.rb index b287a6af..fe06e7f3 100644 --- a/lib/manifest/filer/caption/default/link.rb +++ b/lib/local_manifest/filer/caption/default/link.rb @@ -1,5 +1,5 @@ -require_dependency "manifest/filer/caption/default/link/link" -module Manifest +require_dependency "local_manifest/filer/caption/default/link/link" +module LocalManifest module FilerModule module CaptionModule module DefaultModule diff --git a/lib/manifest/filer/caption/default/link/link.rb b/lib/local_manifest/filer/caption/default/link/link.rb similarity index 98% rename from lib/manifest/filer/caption/default/link/link.rb rename to lib/local_manifest/filer/caption/default/link/link.rb index 62bb5984..1cc07dd8 100644 --- a/lib/manifest/filer/caption/default/link/link.rb +++ b/lib/local_manifest/filer/caption/default/link/link.rb @@ -1,4 +1,4 @@ -module Manifest +module LocalManifest module FilerModule module CaptionModule module DefaultModule diff --git a/lib/manifest/filer/caption/none.rb b/lib/local_manifest/filer/caption/none.rb similarity index 93% rename from lib/manifest/filer/caption/none.rb rename to lib/local_manifest/filer/caption/none.rb index 363ea95c..6fa26949 100644 --- a/lib/manifest/filer/caption/none.rb +++ b/lib/local_manifest/filer/caption/none.rb @@ -1,4 +1,4 @@ -module Manifest +module LocalManifest module FilerModule module CaptionModule class None < Base diff --git a/lib/manifest/filer/caption/template.rb b/lib/local_manifest/filer/caption/template.rb similarity index 95% rename from lib/manifest/filer/caption/template.rb rename to lib/local_manifest/filer/caption/template.rb index 56bcf7ad..c7267e4f 100644 --- a/lib/manifest/filer/caption/template.rb +++ b/lib/local_manifest/filer/caption/template.rb @@ -1,4 +1,4 @@ -module Manifest +module LocalManifest module FilerModule module CaptionModule class Template < Base diff --git a/lib/manifest/filer/date.rb b/lib/local_manifest/filer/date.rb similarity index 88% rename from lib/manifest/filer/date.rb rename to lib/local_manifest/filer/date.rb index 039fc26f..c9d6038f 100644 --- a/lib/manifest/filer/date.rb +++ b/lib/local_manifest/filer/date.rb @@ -1,5 +1,5 @@ -require_dependency "manifest/filer/date/date" -module Manifest +require_dependency "local_manifest/filer/date/date" +module LocalManifest module FilerModule class DateFactory include DateModule diff --git a/lib/manifest/filer/date/date.rb b/lib/local_manifest/filer/date/date.rb similarity index 96% rename from lib/manifest/filer/date/date.rb rename to lib/local_manifest/filer/date/date.rb index 7682bf95..d5e9e2a0 100644 --- a/lib/manifest/filer/date/date.rb +++ b/lib/local_manifest/filer/date/date.rb @@ -1,4 +1,4 @@ -module Manifest +module LocalManifest module FilerModule module DateModule class Base diff --git a/lib/manifest/filer/edit.rb b/lib/local_manifest/filer/edit.rb similarity index 89% rename from lib/manifest/filer/edit.rb rename to lib/local_manifest/filer/edit.rb index a9be4a23..7f9d5276 100644 --- a/lib/manifest/filer/edit.rb +++ b/lib/local_manifest/filer/edit.rb @@ -1,5 +1,5 @@ -require_dependency "manifest/filer/edit/edit" -module Manifest +require_dependency "local_manifest/filer/edit/edit" +module LocalManifest module FilerModule class EditFactory include EditModule diff --git a/lib/manifest/filer/edit/edit.rb b/lib/local_manifest/filer/edit/edit.rb similarity index 98% rename from lib/manifest/filer/edit/edit.rb rename to lib/local_manifest/filer/edit/edit.rb index 030e21c2..1468ad74 100644 --- a/lib/manifest/filer/edit/edit.rb +++ b/lib/local_manifest/filer/edit/edit.rb @@ -1,4 +1,4 @@ -module Manifest +module LocalManifest module FilerModule module EditModule class Base diff --git a/lib/manifest/filer/icon.rb b/lib/local_manifest/filer/icon.rb similarity index 88% rename from lib/manifest/filer/icon.rb rename to lib/local_manifest/filer/icon.rb index e14fecc3..7b28d18a 100644 --- a/lib/manifest/filer/icon.rb +++ b/lib/local_manifest/filer/icon.rb @@ -1,5 +1,5 @@ -require_dependency "manifest/filer/icon/icon" -module Manifest +require_dependency "local_manifest/filer/icon/icon" +module LocalManifest module FilerModule class IconFactory include IconModule diff --git a/lib/manifest/filer/icon/icon.rb b/lib/local_manifest/filer/icon/icon.rb similarity index 96% rename from lib/manifest/filer/icon/icon.rb rename to lib/local_manifest/filer/icon/icon.rb index af85c32b..88fb879f 100644 --- a/lib/manifest/filer/icon/icon.rb +++ b/lib/local_manifest/filer/icon/icon.rb @@ -1,4 +1,4 @@ -module Manifest +module LocalManifest module FilerModule module IconModule class Base diff --git a/lib/manifest/filer/summary.rb b/lib/local_manifest/filer/summary.rb similarity index 88% rename from lib/manifest/filer/summary.rb rename to lib/local_manifest/filer/summary.rb index e756a8c4..c7fd5473 100644 --- a/lib/manifest/filer/summary.rb +++ b/lib/local_manifest/filer/summary.rb @@ -1,5 +1,5 @@ -require_dependency "manifest/filer/summary/summary" -module Manifest +require_dependency "local_manifest/filer/summary/summary" +module LocalManifest module FilerModule class SummaryFactory include SummaryModule diff --git a/lib/manifest/filer/summary/summary.rb b/lib/local_manifest/filer/summary/summary.rb similarity index 97% rename from lib/manifest/filer/summary/summary.rb rename to lib/local_manifest/filer/summary/summary.rb index 69b18a31..d1b29af1 100644 --- a/lib/manifest/filer/summary/summary.rb +++ b/lib/local_manifest/filer/summary/summary.rb @@ -1,4 +1,4 @@ -module Manifest +module LocalManifest module FilerModule module SummaryModule class Base diff --git a/lib/manifest/filer/symbol.rb b/lib/local_manifest/filer/symbol.rb similarity index 75% rename from lib/manifest/filer/symbol.rb rename to lib/local_manifest/filer/symbol.rb index 2b37d3d0..312ca373 100644 --- a/lib/manifest/filer/symbol.rb +++ b/lib/local_manifest/filer/symbol.rb @@ -1,7 +1,7 @@ -require_dependency "manifest/filer/symbol/base" -require_dependency "manifest/filer/symbol/default" -require_dependency "manifest/filer/symbol/template" -module Manifest +require_dependency "local_manifest/filer/symbol/base" +require_dependency "local_manifest/filer/symbol/default" +require_dependency "local_manifest/filer/symbol/template" +module LocalManifest module FilerModule class SymbolFactory include SymbolModule diff --git a/lib/manifest/filer/symbol/base.rb b/lib/local_manifest/filer/symbol/base.rb similarity index 97% rename from lib/manifest/filer/symbol/base.rb rename to lib/local_manifest/filer/symbol/base.rb index 8d1965ad..4dd5cb2b 100644 --- a/lib/manifest/filer/symbol/base.rb +++ b/lib/local_manifest/filer/symbol/base.rb @@ -1,4 +1,4 @@ -module Manifest +module LocalManifest module FilerModule module SymbolModule class Base diff --git a/lib/manifest/filer/symbol/default.rb b/lib/local_manifest/filer/symbol/default.rb similarity index 79% rename from lib/manifest/filer/symbol/default.rb rename to lib/local_manifest/filer/symbol/default.rb index be17974e..fdfd993b 100644 --- a/lib/manifest/filer/symbol/default.rb +++ b/lib/local_manifest/filer/symbol/default.rb @@ -1,6 +1,6 @@ -require_dependency "manifest/filer/symbol/default/face" -require_dependency "manifest/filer/symbol/default/link" -module Manifest +require_dependency "local_manifest/filer/symbol/default/face" +require_dependency "local_manifest/filer/symbol/default/link" +module LocalManifest module FilerModule module SymbolModule class Default < Base diff --git a/lib/manifest/filer/symbol/default/face.rb b/lib/local_manifest/filer/symbol/default/face.rb similarity index 89% rename from lib/manifest/filer/symbol/default/face.rb rename to lib/local_manifest/filer/symbol/default/face.rb index 1f4f582d..42e16d35 100644 --- a/lib/manifest/filer/symbol/default/face.rb +++ b/lib/local_manifest/filer/symbol/default/face.rb @@ -1,5 +1,5 @@ -require_dependency "manifest/filer/symbol/default/face/face" -module Manifest +require_dependency "local_manifest/filer/symbol/default/face/face" +module LocalManifest module FilerModule module SymbolModule module DefaultModule diff --git a/lib/manifest/filer/symbol/default/face/face.rb b/lib/local_manifest/filer/symbol/default/face/face.rb similarity index 98% rename from lib/manifest/filer/symbol/default/face/face.rb rename to lib/local_manifest/filer/symbol/default/face/face.rb index 702ba7a3..1050f248 100644 --- a/lib/manifest/filer/symbol/default/face/face.rb +++ b/lib/local_manifest/filer/symbol/default/face/face.rb @@ -1,4 +1,4 @@ -module Manifest +module LocalManifest module FilerModule module SymbolModule module DefaultModule diff --git a/lib/manifest/filer/symbol/default/link.rb b/lib/local_manifest/filer/symbol/default/link.rb similarity index 90% rename from lib/manifest/filer/symbol/default/link.rb rename to lib/local_manifest/filer/symbol/default/link.rb index b75a2fea..f1a56c6e 100644 --- a/lib/manifest/filer/symbol/default/link.rb +++ b/lib/local_manifest/filer/symbol/default/link.rb @@ -1,5 +1,5 @@ -require_dependency "manifest/filer/symbol/default/link/link" -module Manifest +require_dependency "local_manifest/filer/symbol/default/link/link" +module LocalManifest module FilerModule module SymbolModule module DefaultModule diff --git a/lib/manifest/filer/symbol/default/link/link.rb b/lib/local_manifest/filer/symbol/default/link/link.rb similarity index 98% rename from lib/manifest/filer/symbol/default/link/link.rb rename to lib/local_manifest/filer/symbol/default/link/link.rb index d7b83dc8..b69c3cb7 100644 --- a/lib/manifest/filer/symbol/default/link/link.rb +++ b/lib/local_manifest/filer/symbol/default/link/link.rb @@ -1,4 +1,4 @@ -module Manifest +module LocalManifest module FilerModule module SymbolModule module DefaultModule diff --git a/lib/manifest/filer/symbol/template.rb b/lib/local_manifest/filer/symbol/template.rb similarity index 95% rename from lib/manifest/filer/symbol/template.rb rename to lib/local_manifest/filer/symbol/template.rb index 956ad8e6..5b1409c7 100644 --- a/lib/manifest/filer/symbol/template.rb +++ b/lib/local_manifest/filer/symbol/template.rb @@ -1,4 +1,4 @@ -module Manifest +module LocalManifest module FilerModule module SymbolModule class Template < Base diff --git a/lib/manifest/form.rb b/lib/local_manifest/form.rb similarity index 96% rename from lib/manifest/form.rb rename to lib/local_manifest/form.rb index 48d40d0e..b049cc83 100644 --- a/lib/manifest/form.rb +++ b/lib/local_manifest/form.rb @@ -1,5 +1,5 @@ -require_dependency "manifest/form/field" -module Manifest +require_dependency "local_manifest/form/field" +module LocalManifest class Form include FormModule diff --git a/lib/manifest/form/field.rb b/lib/local_manifest/form/field.rb similarity index 89% rename from lib/manifest/form/field.rb rename to lib/local_manifest/form/field.rb index 591493b0..beb720b0 100644 --- a/lib/manifest/form/field.rb +++ b/lib/local_manifest/form/field.rb @@ -1,5 +1,5 @@ -require_dependency "manifest/form/field/field" -module Manifest +require_dependency "local_manifest/form/field/field" +module LocalManifest module FormModule class FieldFactory include FieldModule diff --git a/lib/manifest/form/field/field.rb b/lib/local_manifest/form/field/field.rb similarity index 92% rename from lib/manifest/form/field/field.rb rename to lib/local_manifest/form/field/field.rb index b81614c3..84c3d632 100644 --- a/lib/manifest/form/field/field.rb +++ b/lib/local_manifest/form/field/field.rb @@ -1,7 +1,7 @@ -require_dependency "manifest/form/field/tag" -require_dependency "manifest/form/field/label" -require_dependency "manifest/form/field/helper" -module Manifest +require_dependency "local_manifest/form/field/tag" +require_dependency "local_manifest/form/field/label" +require_dependency "local_manifest/form/field/helper" +module LocalManifest module FormModule class Field include FieldModule diff --git a/lib/manifest/form/field/helper.rb b/lib/local_manifest/form/field/helper.rb similarity index 70% rename from lib/manifest/form/field/helper.rb rename to lib/local_manifest/form/field/helper.rb index cf2f91f6..e1bd2c9a 100644 --- a/lib/manifest/form/field/helper.rb +++ b/lib/local_manifest/form/field/helper.rb @@ -1,9 +1,9 @@ -require_dependency "manifest/form/field/helper/base" -require_dependency "manifest/form/field/helper/size" -require_dependency "manifest/form/field/helper/tail_angle" -require_dependency "manifest/form/field/helper/color" -require_dependency "manifest/form/field/helper/popup" -module Manifest +require_dependency "local_manifest/form/field/helper/base" +require_dependency "local_manifest/form/field/helper/size" +require_dependency "local_manifest/form/field/helper/tail_angle" +require_dependency "local_manifest/form/field/helper/color" +require_dependency "local_manifest/form/field/helper/popup" +module LocalManifest module FormModule module FieldModule class HelperFactory diff --git a/lib/manifest/form/field/helper/base.rb b/lib/local_manifest/form/field/helper/base.rb similarity index 97% rename from lib/manifest/form/field/helper/base.rb rename to lib/local_manifest/form/field/helper/base.rb index 8b1eab47..878c326b 100644 --- a/lib/manifest/form/field/helper/base.rb +++ b/lib/local_manifest/form/field/helper/base.rb @@ -1,4 +1,4 @@ -module Manifest +module LocalManifest module FormModule module FieldModule module HelperModule diff --git a/lib/manifest/form/field/helper/color.rb b/lib/local_manifest/form/field/helper/color.rb similarity index 94% rename from lib/manifest/form/field/helper/color.rb rename to lib/local_manifest/form/field/helper/color.rb index dbcc1983..38d08fa9 100644 --- a/lib/manifest/form/field/helper/color.rb +++ b/lib/local_manifest/form/field/helper/color.rb @@ -1,4 +1,4 @@ -module Manifest +module LocalManifest module FormModule module FieldModule module HelperModule diff --git a/lib/manifest/form/field/helper/popup.rb b/lib/local_manifest/form/field/helper/popup.rb similarity index 93% rename from lib/manifest/form/field/helper/popup.rb rename to lib/local_manifest/form/field/helper/popup.rb index c51b0fd9..7bad7ffe 100644 --- a/lib/manifest/form/field/helper/popup.rb +++ b/lib/local_manifest/form/field/helper/popup.rb @@ -1,4 +1,4 @@ -module Manifest +module LocalManifest module FormModule module FieldModule module HelperModule diff --git a/lib/manifest/form/field/helper/size.rb b/lib/local_manifest/form/field/helper/size.rb similarity index 94% rename from lib/manifest/form/field/helper/size.rb rename to lib/local_manifest/form/field/helper/size.rb index 494ee71d..e6f32d53 100644 --- a/lib/manifest/form/field/helper/size.rb +++ b/lib/local_manifest/form/field/helper/size.rb @@ -1,4 +1,4 @@ -module Manifest +module LocalManifest module FormModule module FieldModule module HelperModule diff --git a/lib/manifest/form/field/helper/tail_angle.rb b/lib/local_manifest/form/field/helper/tail_angle.rb similarity index 93% rename from lib/manifest/form/field/helper/tail_angle.rb rename to lib/local_manifest/form/field/helper/tail_angle.rb index 9e3ed155..64873a5c 100644 --- a/lib/manifest/form/field/helper/tail_angle.rb +++ b/lib/local_manifest/form/field/helper/tail_angle.rb @@ -1,4 +1,4 @@ -module Manifest +module LocalManifest module FormModule module FieldModule module HelperModule diff --git a/lib/manifest/form/field/label.rb b/lib/local_manifest/form/field/label.rb similarity index 87% rename from lib/manifest/form/field/label.rb rename to lib/local_manifest/form/field/label.rb index 6295ed9a..2aaa7a97 100644 --- a/lib/manifest/form/field/label.rb +++ b/lib/local_manifest/form/field/label.rb @@ -1,5 +1,5 @@ -require_dependency "manifest/form/field/label/label" -module Manifest +require_dependency "local_manifest/form/field/label/label" +module LocalManifest module FormModule module FieldModule class LabelFactory diff --git a/lib/manifest/form/field/label/label.rb b/lib/local_manifest/form/field/label/label.rb similarity index 98% rename from lib/manifest/form/field/label/label.rb rename to lib/local_manifest/form/field/label/label.rb index ed5298d3..ed53f3b9 100644 --- a/lib/manifest/form/field/label/label.rb +++ b/lib/local_manifest/form/field/label/label.rb @@ -1,4 +1,4 @@ -module Manifest +module LocalManifest module FormModule module FieldModule module LabelModule diff --git a/lib/manifest/form/field/tag.rb b/lib/local_manifest/form/field/tag.rb similarity index 66% rename from lib/manifest/form/field/tag.rb rename to lib/local_manifest/form/field/tag.rb index 847a02d6..9d3951a4 100644 --- a/lib/manifest/form/field/tag.rb +++ b/lib/local_manifest/form/field/tag.rb @@ -1,10 +1,10 @@ -require_dependency "manifest/form/field/tag/base" -require_dependency "manifest/form/field/tag/text" -require_dependency "manifest/form/field/tag/number" -require_dependency "manifest/form/field/tag/text_area" -require_dependency "manifest/form/field/tag/select" -require_dependency "manifest/form/field/tag/hidden" -module Manifest +require_dependency "local_manifest/form/field/tag/base" +require_dependency "local_manifest/form/field/tag/text" +require_dependency "local_manifest/form/field/tag/number" +require_dependency "local_manifest/form/field/tag/text_area" +require_dependency "local_manifest/form/field/tag/select" +require_dependency "local_manifest/form/field/tag/hidden" +module LocalManifest module FormModule module FieldModule class TagFactory diff --git a/lib/manifest/form/field/tag/base.rb b/lib/local_manifest/form/field/tag/base.rb similarity index 97% rename from lib/manifest/form/field/tag/base.rb rename to lib/local_manifest/form/field/tag/base.rb index 6c7ca5d7..76944231 100644 --- a/lib/manifest/form/field/tag/base.rb +++ b/lib/local_manifest/form/field/tag/base.rb @@ -1,4 +1,4 @@ -module Manifest +module LocalManifest module FormModule module FieldModule module TagModule diff --git a/lib/manifest/form/field/tag/hidden.rb b/lib/local_manifest/form/field/tag/hidden.rb similarity index 87% rename from lib/manifest/form/field/tag/hidden.rb rename to lib/local_manifest/form/field/tag/hidden.rb index 087c5946..2bbb52d0 100644 --- a/lib/manifest/form/field/tag/hidden.rb +++ b/lib/local_manifest/form/field/tag/hidden.rb @@ -1,4 +1,4 @@ -module Manifest +module LocalManifest module FormModule module FieldModule module TagModule diff --git a/lib/manifest/form/field/tag/number.rb b/lib/local_manifest/form/field/tag/number.rb similarity index 95% rename from lib/manifest/form/field/tag/number.rb rename to lib/local_manifest/form/field/tag/number.rb index 83c17d90..9794151f 100644 --- a/lib/manifest/form/field/tag/number.rb +++ b/lib/local_manifest/form/field/tag/number.rb @@ -1,4 +1,4 @@ -module Manifest +module LocalManifest module FormModule module FieldModule module TagModule diff --git a/lib/manifest/form/field/tag/select.rb b/lib/local_manifest/form/field/tag/select.rb similarity index 87% rename from lib/manifest/form/field/tag/select.rb rename to lib/local_manifest/form/field/tag/select.rb index 0a20eec0..c6609ce1 100644 --- a/lib/manifest/form/field/tag/select.rb +++ b/lib/local_manifest/form/field/tag/select.rb @@ -1,4 +1,4 @@ -module Manifest +module LocalManifest module FormModule module FieldModule module TagModule diff --git a/lib/manifest/form/field/tag/text.rb b/lib/local_manifest/form/field/tag/text.rb similarity index 95% rename from lib/manifest/form/field/tag/text.rb rename to lib/local_manifest/form/field/tag/text.rb index deb9776a..15c92afd 100644 --- a/lib/manifest/form/field/tag/text.rb +++ b/lib/local_manifest/form/field/tag/text.rb @@ -1,4 +1,4 @@ -module Manifest +module LocalManifest module FormModule module FieldModule module TagModule diff --git a/lib/manifest/form/field/tag/text_area.rb b/lib/local_manifest/form/field/tag/text_area.rb similarity index 95% rename from lib/manifest/form/field/tag/text_area.rb rename to lib/local_manifest/form/field/tag/text_area.rb index 602dfaa5..023d9a4a 100644 --- a/lib/manifest/form/field/tag/text_area.rb +++ b/lib/local_manifest/form/field/tag/text_area.rb @@ -1,4 +1,4 @@ -module Manifest +module LocalManifest module FormModule module FieldModule module TagModule diff --git a/lib/manifest/list_group.rb b/lib/local_manifest/list_group.rb similarity index 93% rename from lib/manifest/list_group.rb rename to lib/local_manifest/list_group.rb index e5f808a7..5d98144c 100644 --- a/lib/manifest/list_group.rb +++ b/lib/local_manifest/list_group.rb @@ -1,5 +1,5 @@ -require_dependency "manifest/list_group/list" -module Manifest +require_dependency "local_manifest/list_group/list" +module LocalManifest class ListGroup include ListGroupModule def self.manager manifest, my_manifests diff --git a/lib/manifest/list_group/list.rb b/lib/local_manifest/list_group/list.rb similarity index 62% rename from lib/manifest/list_group/list.rb rename to lib/local_manifest/list_group/list.rb index fba57eb7..4976af94 100644 --- a/lib/manifest/list_group/list.rb +++ b/lib/local_manifest/list_group/list.rb @@ -1,12 +1,12 @@ -require_dependency "manifest/list_group/list/base" -require_dependency "manifest/list_group/list/public" -require_dependency "manifest/list_group/list/private" -require_dependency "manifest/list_group/list/system_resource" -require_dependency "manifest/list_group/list/filter" -require_dependency "manifest/list_group/list/through_filter" -require_dependency "manifest/list_group/list/foreign_filter" -require_dependency "manifest/list_group/list/play" -module Manifest +require_dependency "local_manifest/list_group/list/base" +require_dependency "local_manifest/list_group/list/public" +require_dependency "local_manifest/list_group/list/private" +require_dependency "local_manifest/list_group/list/system_resource" +require_dependency "local_manifest/list_group/list/filter" +require_dependency "local_manifest/list_group/list/through_filter" +require_dependency "local_manifest/list_group/list/foreign_filter" +require_dependency "local_manifest/list_group/list/play" +module LocalManifest module ListGroupModule class ListFactory include ListModule diff --git a/lib/manifest/list_group/list/base.rb b/lib/local_manifest/list_group/list/base.rb similarity index 90% rename from lib/manifest/list_group/list/base.rb rename to lib/local_manifest/list_group/list/base.rb index 314ebabc..b78118c7 100644 --- a/lib/manifest/list_group/list/base.rb +++ b/lib/local_manifest/list_group/list/base.rb @@ -1,6 +1,6 @@ -require_dependency "manifest/list_group/list/where" -require_dependency "manifest/list_group/list/includes" -module Manifest +require_dependency "local_manifest/list_group/list/where" +require_dependency "local_manifest/list_group/list/includes" +module LocalManifest module ListGroupModule module ListModule class Base diff --git a/lib/manifest/list_group/list/filter.rb b/lib/local_manifest/list_group/list/filter.rb similarity index 96% rename from lib/manifest/list_group/list/filter.rb rename to lib/local_manifest/list_group/list/filter.rb index 567330e2..46962260 100644 --- a/lib/manifest/list_group/list/filter.rb +++ b/lib/local_manifest/list_group/list/filter.rb @@ -1,4 +1,4 @@ -module Manifest +module LocalManifest module ListGroupModule module ListModule class FilterList < Base diff --git a/lib/manifest/list_group/list/foreign_filter.rb b/lib/local_manifest/list_group/list/foreign_filter.rb similarity index 63% rename from lib/manifest/list_group/list/foreign_filter.rb rename to lib/local_manifest/list_group/list/foreign_filter.rb index 84c7fcdc..69c5e68f 100644 --- a/lib/manifest/list_group/list/foreign_filter.rb +++ b/lib/local_manifest/list_group/list/foreign_filter.rb @@ -1,15 +1,17 @@ -module Manifest +module LocalManifest module ListGroupModule module ListModule class ForeignFilterList < FilterList + attr :tree_name def set_default super + @list_manifest['args']['tree_name'] ||= 'owner' end def init super - @filter_table_name = ::Manifest.manifest.models[@filter_item_name].classify.table_name + @tree_name = @args['tree_name'] end end diff --git a/lib/manifest/list_group/list/includes.rb b/lib/local_manifest/list_group/list/includes.rb similarity index 71% rename from lib/manifest/list_group/list/includes.rb rename to lib/local_manifest/list_group/list/includes.rb index 9264d046..411b67a5 100644 --- a/lib/manifest/list_group/list/includes.rb +++ b/lib/local_manifest/list_group/list/includes.rb @@ -1,8 +1,8 @@ -require_dependency "manifest/list_group/list/includes/base" -require_dependency "manifest/list_group/list/includes/method" -require_dependency "manifest/list_group/list/includes/auto" -require_dependency "manifest/list_group/list/includes/none" -module Manifest +require_dependency "local_manifest/list_group/list/includes/base" +require_dependency "local_manifest/list_group/list/includes/method" +require_dependency "local_manifest/list_group/list/includes/auto" +require_dependency "local_manifest/list_group/list/includes/none" +module LocalManifest module ListGroupModule module ListModule class IncludeFactory diff --git a/lib/manifest/list_group/list/includes/auto.rb b/lib/local_manifest/list_group/list/includes/auto.rb similarity index 97% rename from lib/manifest/list_group/list/includes/auto.rb rename to lib/local_manifest/list_group/list/includes/auto.rb index 2ef9105c..c62589b5 100644 --- a/lib/manifest/list_group/list/includes/auto.rb +++ b/lib/local_manifest/list_group/list/includes/auto.rb @@ -1,4 +1,4 @@ -module Manifest +module LocalManifest module ListGroupModule module ListModule module IncludeModule diff --git a/lib/manifest/list_group/list/includes/base.rb b/lib/local_manifest/list_group/list/includes/base.rb similarity index 97% rename from lib/manifest/list_group/list/includes/base.rb rename to lib/local_manifest/list_group/list/includes/base.rb index b90942f5..70fb673d 100644 --- a/lib/manifest/list_group/list/includes/base.rb +++ b/lib/local_manifest/list_group/list/includes/base.rb @@ -1,4 +1,4 @@ -module Manifest +module LocalManifest module ListGroupModule module ListModule module IncludeModule diff --git a/lib/manifest/list_group/list/includes/method.rb b/lib/local_manifest/list_group/list/includes/method.rb similarity index 96% rename from lib/manifest/list_group/list/includes/method.rb rename to lib/local_manifest/list_group/list/includes/method.rb index 3cbf7e58..3f3f32d5 100644 --- a/lib/manifest/list_group/list/includes/method.rb +++ b/lib/local_manifest/list_group/list/includes/method.rb @@ -1,4 +1,4 @@ -module Manifest +module LocalManifest module ListGroupModule module ListModule module IncludeModule diff --git a/lib/manifest/list_group/list/includes/none.rb b/lib/local_manifest/list_group/list/includes/none.rb similarity index 94% rename from lib/manifest/list_group/list/includes/none.rb rename to lib/local_manifest/list_group/list/includes/none.rb index dbb60fb3..930bd9f9 100644 --- a/lib/manifest/list_group/list/includes/none.rb +++ b/lib/local_manifest/list_group/list/includes/none.rb @@ -1,4 +1,4 @@ -module Manifest +module LocalManifest module ListGroupModule module ListModule module IncludeModule diff --git a/lib/manifest/list_group/list/play.rb b/lib/local_manifest/list_group/list/play.rb similarity index 99% rename from lib/manifest/list_group/list/play.rb rename to lib/local_manifest/list_group/list/play.rb index 09f55105..7351abd9 100644 --- a/lib/manifest/list_group/list/play.rb +++ b/lib/local_manifest/list_group/list/play.rb @@ -1,4 +1,4 @@ -module Manifest +module LocalManifest module ListGroupModule module ListModule class PlayList diff --git a/lib/manifest/list_group/list/private.rb b/lib/local_manifest/list_group/list/private.rb similarity index 84% rename from lib/manifest/list_group/list/private.rb rename to lib/local_manifest/list_group/list/private.rb index 13e8aba8..580ceeea 100644 --- a/lib/manifest/list_group/list/private.rb +++ b/lib/local_manifest/list_group/list/private.rb @@ -1,4 +1,4 @@ -module Manifest +module LocalManifest module ListGroupModule module ListModule class PrivateList < Base diff --git a/lib/manifest/list_group/list/public.rb b/lib/local_manifest/list_group/list/public.rb similarity index 91% rename from lib/manifest/list_group/list/public.rb rename to lib/local_manifest/list_group/list/public.rb index 2baed0cb..b59674e0 100644 --- a/lib/manifest/list_group/list/public.rb +++ b/lib/local_manifest/list_group/list/public.rb @@ -1,4 +1,4 @@ -module Manifest +module LocalManifest module ListGroupModule module ListModule class PublicList < Base diff --git a/lib/manifest/list_group/list/system_resource.rb b/lib/local_manifest/list_group/list/system_resource.rb similarity index 92% rename from lib/manifest/list_group/list/system_resource.rb rename to lib/local_manifest/list_group/list/system_resource.rb index 7e2bd8a7..dc7c4717 100644 --- a/lib/manifest/list_group/list/system_resource.rb +++ b/lib/local_manifest/list_group/list/system_resource.rb @@ -1,4 +1,4 @@ -module Manifest +module LocalManifest module ListGroupModule module ListModule class SystemResourceList < Base diff --git a/lib/manifest/list_group/list/through_filter.rb b/lib/local_manifest/list_group/list/through_filter.rb similarity index 93% rename from lib/manifest/list_group/list/through_filter.rb rename to lib/local_manifest/list_group/list/through_filter.rb index 2a08ad0a..9fa83e45 100644 --- a/lib/manifest/list_group/list/through_filter.rb +++ b/lib/local_manifest/list_group/list/through_filter.rb @@ -1,4 +1,4 @@ -module Manifest +module LocalManifest module ListGroupModule module ListModule class ThroughFilterList < FilterList diff --git a/lib/manifest/list_group/list/where.rb b/lib/local_manifest/list_group/list/where.rb similarity index 75% rename from lib/manifest/list_group/list/where.rb rename to lib/local_manifest/list_group/list/where.rb index 88ea3ef5..799407dc 100644 --- a/lib/manifest/list_group/list/where.rb +++ b/lib/local_manifest/list_group/list/where.rb @@ -1,7 +1,7 @@ -require_dependency "manifest/list_group/list/where/base" -require_dependency "manifest/list_group/list/where/method" -require_dependency "manifest/list_group/list/where/auto" -module Manifest +require_dependency "local_manifest/list_group/list/where/base" +require_dependency "local_manifest/list_group/list/where/method" +require_dependency "local_manifest/list_group/list/where/auto" +module LocalManifest module ListGroupModule module ListModule class WhereFactory diff --git a/lib/manifest/list_group/list/where/auto.rb b/lib/local_manifest/list_group/list/where/auto.rb similarity index 96% rename from lib/manifest/list_group/list/where/auto.rb rename to lib/local_manifest/list_group/list/where/auto.rb index e8305a7b..ae975582 100644 --- a/lib/manifest/list_group/list/where/auto.rb +++ b/lib/local_manifest/list_group/list/where/auto.rb @@ -1,4 +1,4 @@ -module Manifest +module LocalManifest module ListGroupModule module ListModule module WhereModule diff --git a/lib/manifest/list_group/list/where/base.rb b/lib/local_manifest/list_group/list/where/base.rb similarity index 97% rename from lib/manifest/list_group/list/where/base.rb rename to lib/local_manifest/list_group/list/where/base.rb index 7010ea17..10d3f6f1 100644 --- a/lib/manifest/list_group/list/where/base.rb +++ b/lib/local_manifest/list_group/list/where/base.rb @@ -1,4 +1,4 @@ -module Manifest +module LocalManifest module ListGroupModule module ListModule module WhereModule diff --git a/lib/manifest/list_group/list/where/method.rb b/lib/local_manifest/list_group/list/where/method.rb similarity index 96% rename from lib/manifest/list_group/list/where/method.rb rename to lib/local_manifest/list_group/list/where/method.rb index 2ac8e21f..3f4aeda0 100644 --- a/lib/manifest/list_group/list/where/method.rb +++ b/lib/local_manifest/list_group/list/where/method.rb @@ -1,4 +1,4 @@ -module Manifest +module LocalManifest module ListGroupModule module ListModule module WhereModule diff --git a/lib/local_manifest/local_manifest.rb b/lib/local_manifest/local_manifest.rb new file mode 100644 index 00000000..65534dd3 --- /dev/null +++ b/lib/local_manifest/local_manifest.rb @@ -0,0 +1,37 @@ +module LocalManifest + class LocalManifest + cattr_accessor :manifest + attr :list_groups, :profilers, :filers, :forms + # call me before load routes.rb + # routes.rb needs engine_resources manifest in system_resources + # ex. it's adding license_groups routes + def initialize local_json + @local_json = local_json || {} + end + + def init + # managers can't initialize before load application.rb + return unless defined? ::Pettanr + @list_groups = ListGroup.manager(self, @local_json['list_groups'] || {}) + @filers = Filer.manager(self, @local_json['filers'] || {}) + @profilers = Profiler.manager(self, @local_json['profilers'] || {}) + @forms = Form.base_manager(self, @local_json['forms'] || {}) + @forms.merge(Form.extend_manager(self, @local_json['forms'] || {})) + end + + end + + module ModuleMethods + def manifest + LocalManifest.manifest + end + + def load local_json + LocalManifest.manifest = LocalManifest.new local_json + end + + end + + extend ModuleMethods +end + diff --git a/lib/manifest/profiler.rb b/lib/local_manifest/profiler.rb similarity index 86% rename from lib/manifest/profiler.rb rename to lib/local_manifest/profiler.rb index d58dab3b..56f4ab2a 100644 --- a/lib/manifest/profiler.rb +++ b/lib/local_manifest/profiler.rb @@ -1,7 +1,7 @@ -require_dependency "manifest/profiler/column" -require_dependency "manifest/profiler/list" -require_dependency "manifest/profiler/association" -module Manifest +require_dependency "local_manifest/profiler/column" +require_dependency "local_manifest/profiler/list" +require_dependency "local_manifest/profiler/association" +module LocalManifest class Profiler def self.manager manifest, my_manifests diff --git a/lib/manifest/profiler/association.rb b/lib/local_manifest/profiler/association.rb similarity index 84% rename from lib/manifest/profiler/association.rb rename to lib/local_manifest/profiler/association.rb index 3dc1cf07..db7365bf 100644 --- a/lib/manifest/profiler/association.rb +++ b/lib/local_manifest/profiler/association.rb @@ -1,7 +1,7 @@ -require_dependency "manifest/profiler/association/belongs_to" -require_dependency "manifest/profiler/association/has_many" -require_dependency "manifest/profiler/association/has_one" -module Manifest +require_dependency "local_manifest/profiler/association/belongs_to" +require_dependency "local_manifest/profiler/association/has_many" +require_dependency "local_manifest/profiler/association/has_one" +module LocalManifest module ProfilerModule class Association include AssociationModule diff --git a/lib/manifest/profiler/association/belongs_to.rb b/lib/local_manifest/profiler/association/belongs_to.rb similarity index 96% rename from lib/manifest/profiler/association/belongs_to.rb rename to lib/local_manifest/profiler/association/belongs_to.rb index a76c3a5c..8ce06973 100644 --- a/lib/manifest/profiler/association/belongs_to.rb +++ b/lib/local_manifest/profiler/association/belongs_to.rb @@ -1,4 +1,4 @@ -module Manifest +module LocalManifest module ProfilerModule module AssociationModule class BelongsTo diff --git a/lib/manifest/profiler/association/has_many.rb b/lib/local_manifest/profiler/association/has_many.rb similarity index 93% rename from lib/manifest/profiler/association/has_many.rb rename to lib/local_manifest/profiler/association/has_many.rb index c51afb55..f3308264 100644 --- a/lib/manifest/profiler/association/has_many.rb +++ b/lib/local_manifest/profiler/association/has_many.rb @@ -1,4 +1,4 @@ -module Manifest +module LocalManifest module ProfilerModule module AssociationModule class HasMany @@ -28,7 +28,7 @@ module Manifest raise "undefined list for profilers > #{self.profiler.item_name} > has_many > #{@profiler_list_name}\n" end end - @list = ::Manifest::View::ListGroup.list @model_name, @list_name + @list = Locmare::ListGroup.list @model_name, @list_name end def model diff --git a/lib/manifest/profiler/association/has_one.rb b/lib/local_manifest/profiler/association/has_one.rb similarity index 93% rename from lib/manifest/profiler/association/has_one.rb rename to lib/local_manifest/profiler/association/has_one.rb index 8b4c0c08..5d30cd17 100644 --- a/lib/manifest/profiler/association/has_one.rb +++ b/lib/local_manifest/profiler/association/has_one.rb @@ -1,4 +1,4 @@ -module Manifest +module LocalManifest module ProfilerModule module AssociationModule class HasOne @@ -27,7 +27,7 @@ module Manifest raise "undefined list for profilers > #{self.profiler.item_name} > has_one > #{@profiler_list_name}\n" end end - @list = ::Manifest::View::ListGroup.list @model_name, @list_name + @list = Locmare::ListGroup.list @model_name, @list_name end def model diff --git a/lib/manifest/profiler/column.rb b/lib/local_manifest/profiler/column.rb similarity index 98% rename from lib/manifest/profiler/column.rb rename to lib/local_manifest/profiler/column.rb index 4ea7b919..843abff1 100644 --- a/lib/manifest/profiler/column.rb +++ b/lib/local_manifest/profiler/column.rb @@ -1,4 +1,4 @@ -module Manifest +module LocalManifest module ProfilerModule class Column def initialize item_name, column_name, item, operators, manifest diff --git a/lib/manifest/profiler/list.rb b/lib/local_manifest/profiler/list.rb similarity index 97% rename from lib/manifest/profiler/list.rb rename to lib/local_manifest/profiler/list.rb index f9adef7b..8fc8fcce 100644 --- a/lib/manifest/profiler/list.rb +++ b/lib/local_manifest/profiler/list.rb @@ -1,4 +1,4 @@ -module Manifest +module LocalManifest module ProfilerModule class List attr :profiler, :my_name, :list_manifest, diff --git a/lib/locmare.rb b/lib/locmare.rb new file mode 100644 index 00000000..a45d3fd9 --- /dev/null +++ b/lib/locmare.rb @@ -0,0 +1 @@ +require_dependency "locmare/locmare" diff --git a/lib/locmare/filer.rb b/lib/locmare/filer.rb new file mode 100644 index 00000000..3ce3b88e --- /dev/null +++ b/lib/locmare/filer.rb @@ -0,0 +1,39 @@ +require_dependency "locmare/filer/header" +require_dependency "locmare/filer/body" +require_dependency "locmare/filer/footer" +module Locmare + class Filer + include FilerModule + attr :manifest, :item_name, :items, :paginate, :operators, :template_dir, + :header, :body, :footer + def initialize item_name, items, paginate, operators + @item_name = item_name + @items = items + @paginate = paginate + @operators = operators + @manifest = LocalManifest.manifest.filers[@item_name] + @template_dir = 'templates/r/filer/' + @header = Header.new self + @body = Body.new self + @footer = Footer.new self, paginate + end + + def model + ::Manifest::item_name_to_model @item_name + end + + def template_file_name + "filer" + end + + def template_name + self.template_dir + self.template_file_name + end + + def image_dir + '/images/' + end + + end +end + diff --git a/lib/locmare/filer/body.rb b/lib/locmare/filer/body.rb new file mode 100644 index 00000000..017e8245 --- /dev/null +++ b/lib/locmare/filer/body.rb @@ -0,0 +1,45 @@ +require_dependency "locmare/filer/body/file_header" +require_dependency "locmare/filer/body/file_body" +module Locmare + module FilerModule + class Body + include BodyModule + attr :filer, + :file_header, :file_body + def initialize filer + @filer = filer + @file_header = FileHeader.new self + @file_body = FileBody.new self + end + + def manifest + @filer.manifest + end + + def item_name + self.filer.item_name + end + + def model + self.filer.model + end + + def items + self.filer.items + end + + def template_dir + @filer.template_dir + end + + def template_file_name + "body" + end + + def template_name + self.template_dir + self.template_file_name + end + + end + end +end diff --git a/lib/manifest/local/view/filer/body.rb b/lib/locmare/filer/body/file_body.rb similarity index 50% rename from lib/manifest/local/view/filer/body.rb rename to lib/locmare/filer/body/file_body.rb index a475ad56..850c32b5 100644 --- a/lib/manifest/local/view/filer/body.rb +++ b/lib/locmare/filer/body/file_body.rb @@ -1,20 +1,23 @@ -require_dependency "manifest/local/view/filer/body/file_header" -require_dependency "manifest/local/view/filer/body/file_body" -module Manifest - module View - module FilerModule - class Body - include BodyModule - attr :filer, - :file_header, :file_body - def initialize filer - @filer = filer - @file_header = FileHeader.new self - @file_body = FileBody.new self +require_dependency "locmare/filer/body/file_body/file_item" +module Locmare + module FilerModule + module BodyModule + class FileBody + include FileBodyModule + attr :body, :file_items + def initialize body + @body = body + @file_items = self.items.map {|item| + FileItem.new self, item + } + end + + def filer + @body.filer end def manifest - @filer.manifest + self.filer.manifest end def item_name @@ -30,11 +33,11 @@ module Manifest end def template_dir - @filer.template_dir + self.filer.template_dir end def template_file_name - "body" + "file_body" end def template_name diff --git a/lib/locmare/filer/body/file_body/file_item.rb b/lib/locmare/filer/body/file_body/file_item.rb new file mode 100644 index 00000000..89656e2d --- /dev/null +++ b/lib/locmare/filer/body/file_body/file_item.rb @@ -0,0 +1,63 @@ +require_dependency "locmare/filer/body/file_body/file_item/symbol" +require_dependency "locmare/filer/body/file_body/file_item/caption" +require_dependency "locmare/filer/body/file_body/file_item/summary" +require_dependency "locmare/filer/body/file_body/file_item/icon" +require_dependency "locmare/filer/body/file_body/file_item/date" +require_dependency "locmare/filer/body/file_body/file_item/edit" +module Locmare + module FilerModule + module BodyModule + module FileBodyModule + class FileItem + include FileItemModule + + attr :file_body, :item, + :symbol, :caption, :summary, :icon, :date, :edit + def initialize file_body, item + @file_body = file_body + @item = item + @symbol = SymbolItemColumnFactory.factory self, self.filer.manifest.symbol, @item + @caption = CaptionItemColumnFactory.factory self, self.filer.manifest.caption, @item + @summary = SummaryItemColumnFactory.factory self, self.filer.manifest.summary, @item + @icon = IconItemColumnFactory.factory self, self.filer.manifest.icon, @item + @date = DateItemColumnFactory.factory self, self.filer.manifest.date, @item + @edit = EditItemColumnFactory.factory self, self.filer.manifest.edit, @item + end + + def filer + @file_body.filer + end + + def manifest + self.filer.manifest + end + + def item_name + self.filer.item_name + end + + def model + self.filer.model + end + + def items + self.filer.items + end + + def template_dir + self.filer.template_dir + end + + def template_file_name + "file_item" + end + + def template_name + self.template_dir + self.template_file_name + end + + end + end + end + end +end diff --git a/lib/locmare/filer/body/file_body/file_item/caption.rb b/lib/locmare/filer/body/file_body/file_item/caption.rb new file mode 100644 index 00000000..18852560 --- /dev/null +++ b/lib/locmare/filer/body/file_body/file_item/caption.rb @@ -0,0 +1,28 @@ +require_dependency "locmare/filer/body/file_body/file_item/caption/base" +require_dependency "locmare/filer/body/file_body/file_item/caption/default" +require_dependency "locmare/filer/body/file_body/file_item/caption/template" +require_dependency "locmare/filer/body/file_body/file_item/caption/none" +module Locmare + module FilerModule + module BodyModule + module FileBodyModule + module FileItemModule + class CaptionItemColumnFactory + include CaptionItemColumnModule + @@types = { + 'default' => Default, 'template' => Template, 'none' => None + } + def self.factory file_item, my_manifest, item + type = my_manifest.type + raise "undefined type for local view filers > #{file_item.item_name} > caption > default > face\n" unless type + my_class = @@types[type] + raise "undefined class for local view filers > #{file_item.item_name} > caption > default > face > #{type}\n" unless my_class + my_class.new(file_item, my_manifest, item) + end + + end + end + end + end + end +end diff --git a/lib/locmare/filer/body/file_body/file_item/caption/base.rb b/lib/locmare/filer/body/file_body/file_item/caption/base.rb new file mode 100644 index 00000000..ad808feb --- /dev/null +++ b/lib/locmare/filer/body/file_body/file_item/caption/base.rb @@ -0,0 +1,60 @@ +module Locmare + module FilerModule + module BodyModule + module FileBodyModule + module FileItemModule + module CaptionItemColumnModule + class Base + attr :file_item, :caption_manifest, :item, :column_name + + def initialize file_item, caption_manifest, item + @file_item = file_item + @caption_manifest = caption_manifest + @item = item + @column_name = 'caption' + end + + def filer + @file_item.filer + end + + def manifest + self.filer.manifest + end + + def item_name + self.filer.item_name + end + + def column_template_dir + self.filer.template_dir + 'item_column/' + end + + def column_template_file_name + raise "undefined column_template_file_name\n" + end + + def column_template_name + self.column_template_dir + self.column_template_file_name + end + + def item_template_dir + self.filer.template_dir + 'caption/' + end + + def item_template_file_name + raise "undefined item_template_file_name\n" + end + + def item_template_name + self.item_template_dir + self.item_template_file_name + end + + end + + end + end + end + end + end +end diff --git a/lib/locmare/filer/body/file_body/file_item/caption/default.rb b/lib/locmare/filer/body/file_body/file_item/caption/default.rb new file mode 100644 index 00000000..ed816280 --- /dev/null +++ b/lib/locmare/filer/body/file_body/file_item/caption/default.rb @@ -0,0 +1,37 @@ +require_dependency "locmare/filer/body/file_body/file_item/caption/default/face" +require_dependency "locmare/filer/body/file_body/file_item/caption/default/link" +module Locmare + module FilerModule + module BodyModule + module FileBodyModule + module FileItemModule + module CaptionItemColumnModule + class Default < Base + include DefaultModule + attr :face, :link + + def initialize file_item, caption_manifest, item + super + @face = FaceFactory.factory self, self.caption_manifest.face, @item + @link = LinkFactory.factory self, self.caption_manifest.link, @item + end + + def column_template_file_name + 'show' + end + + def item_template_file_name + if @caption_manifest.link.type == 'none' + 'default_without_link' + else + 'default' + end + end + + end + end + end + end + end + end +end diff --git a/lib/locmare/filer/body/file_body/file_item/caption/default/face.rb b/lib/locmare/filer/body/file_body/file_item/caption/default/face.rb new file mode 100644 index 00000000..d63018fe --- /dev/null +++ b/lib/locmare/filer/body/file_body/file_item/caption/default/face.rb @@ -0,0 +1,29 @@ +require_dependency "locmare/filer/body/file_body/file_item/caption/default/face/face" +module Locmare + module FilerModule + module BodyModule + module FileBodyModule + module FileItemModule + module CaptionItemColumnModule + module DefaultModule + class FaceFactory + include FaceModule + @@types = { + 'column' => ColumnFace, 'method' => MethodFace, 'none' => NoneFace + } + def self.factory file_item, my_manifest, item + type = my_manifest.type + raise "undefined type for local view filers > #{file_item.item_name} > caption > face\n" unless type + my_class = @@types[type] + raise "undefined class for local view filers > #{file_item.item_name} > caption > face > #{type}\n" unless my_class + my_class.new(file_item, my_manifest, item) + end + + end + end + end + end + end + end + end +end diff --git a/lib/locmare/filer/body/file_body/file_item/caption/default/face/face.rb b/lib/locmare/filer/body/file_body/file_item/caption/default/face/face.rb new file mode 100644 index 00000000..210137a6 --- /dev/null +++ b/lib/locmare/filer/body/file_body/file_item/caption/default/face/face.rb @@ -0,0 +1,87 @@ +module Locmare + module FilerModule + module BodyModule + module FileBodyModule + module FileItemModule + module CaptionItemColumnModule + module DefaultModule + module FaceModule + class BaseFace + attr :default_caption, :face_manifest, :item + def initialize default_caption, face_manifest, item + @default_caption = default_caption + @face_manifest = face_manifest + @item = item + end + + def filer + @default_caption.filer + end + + def manifest + self.filer.manifest + end + + def item_name + self.filer.item_name + end + + def template_dir + self.filer.template_dir + "caption_face/" + end + + def template_file_name + raise "undefined template_file_name\n" + end + + def template_name + self.template_dir + self.template_file_name + end + + end + + class ColumnFace < BaseFace + def template_file_name + if face.blank? + 'empty' + else + 'column' + end + end + + def face + @item.attributes[@face_manifest.column_name] + end + + end + + class MethodFace < BaseFace + def template_file_name + if face.blank? + 'empty' + else + 'column' + end + end + + def face + @item.__send__ @face_manifest.method_name + end + + end + + class NoneFace < BaseFace + def template_file_name + 'none' + end + + end + + end + end + end + end + end + end + end +end diff --git a/lib/locmare/filer/body/file_body/file_item/caption/default/link.rb b/lib/locmare/filer/body/file_body/file_item/caption/default/link.rb new file mode 100644 index 00000000..4174b3fe --- /dev/null +++ b/lib/locmare/filer/body/file_body/file_item/caption/default/link.rb @@ -0,0 +1,29 @@ +require_dependency "locmare/filer/body/file_body/file_item/caption/default/link/link" +module Locmare + module FilerModule + module BodyModule + module FileBodyModule + module FileItemModule + module CaptionItemColumnModule + module DefaultModule + class LinkFactory + include LinkModule + @@types = { + 'action' => ActionLink, 'none' => NoneLink, 'url_column' => UrlColumnLink + } + def self.factory file_item, my_manifest, item + type = my_manifest.type + raise "undefined type for local view filers > #{file_item.item_name} > caption > link\n" unless type + my_class = @@types[type] + raise "undefined class for local view filers > #{file_item.item_name} > caption > link > #{type}\n" unless my_class + my_class.new(file_item, my_manifest, item) + end + + end + end + end + end + end + end + end +end diff --git a/lib/locmare/filer/body/file_body/file_item/caption/default/link/link.rb b/lib/locmare/filer/body/file_body/file_item/caption/default/link/link.rb new file mode 100644 index 00000000..54dfcb4e --- /dev/null +++ b/lib/locmare/filer/body/file_body/file_item/caption/default/link/link.rb @@ -0,0 +1,54 @@ +module Locmare + module FilerModule + module BodyModule + module FileBodyModule + module FileItemModule + module CaptionItemColumnModule + module DefaultModule + module LinkModule + class BaseLink + attr :default_caption, :link_manifest, :item + def initialize default_caption, link_manifest, item + @default_caption = default_caption + @link_manifest = link_manifest + @item = item + end + + def url + raise "undefined url\n" + end + + end + + class ActionLink < BaseLink + + def url + @link_manifest.action_path + @item.id.to_s + end + + end + + class NoneLink < BaseLink + + def url + nil + end + + end + + class UrlColumnLink < BaseLink + + def url + @item.attributes[@link_manifest.column_name] + end + + end + + end + end + end + end + end + end + end +end diff --git a/lib/locmare/filer/body/file_body/file_item/caption/none.rb b/lib/locmare/filer/body/file_body/file_item/caption/none.rb new file mode 100644 index 00000000..661ed75d --- /dev/null +++ b/lib/locmare/filer/body/file_body/file_item/caption/none.rb @@ -0,0 +1,19 @@ +module Locmare + module FilerModule + module BodyModule + module FileBodyModule + module FileItemModule + module CaptionItemColumnModule + class None < Base + + def column_template_file_name + 'none' + end + + end + end + end + end + end + end +end diff --git a/lib/locmare/filer/body/file_body/file_item/caption/template.rb b/lib/locmare/filer/body/file_body/file_item/caption/template.rb new file mode 100644 index 00000000..b775b692 --- /dev/null +++ b/lib/locmare/filer/body/file_body/file_item/caption/template.rb @@ -0,0 +1,18 @@ +module Locmare + module FilerModule + module BodyModule + module FileBodyModule + module FileItemModule + module CaptionItemColumnModule + class Template < Base + def template_file_name + @caption_manifest.template_name + end + + end + end + end + end + end + end +end diff --git a/lib/locmare/filer/body/file_body/file_item/date.rb b/lib/locmare/filer/body/file_body/file_item/date.rb new file mode 100644 index 00000000..40342390 --- /dev/null +++ b/lib/locmare/filer/body/file_body/file_item/date.rb @@ -0,0 +1,25 @@ +require_dependency "locmare/filer/body/file_body/file_item/date/date" +module Locmare + module FilerModule + module BodyModule + module FileBodyModule + module FileItemModule + class DateItemColumnFactory + include DateItemColumnModule + @@types = { + 'default' => Default, 'none' => None + } + def self.factory file_item, my_manifest, item + type = my_manifest.type + raise "undefined type for local view filers > #{file_item.item_name} > date\n" unless type + my_class = @@types[type] + raise "undefined class for local view filers > #{file_item.item_name} > date > #{type}\n" unless my_class + my_class.new(file_item, my_manifest, item) + end + + end + end + end + end + end +end diff --git a/lib/locmare/filer/body/file_body/file_item/date/date.rb b/lib/locmare/filer/body/file_body/file_item/date/date.rb new file mode 100644 index 00000000..a13ea131 --- /dev/null +++ b/lib/locmare/filer/body/file_body/file_item/date/date.rb @@ -0,0 +1,78 @@ +module Locmare + module FilerModule + module BodyModule + module FileBodyModule + module FileItemModule + module DateItemColumnModule + class Base + attr :file_item, :date_manifest, :item, :column_name + + def initialize file_item, date_manifest, item + @file_item = file_item + @date_manifest = date_manifest + @item = item + @column_name = 'date' + end + + def filer + @file_item.filer + end + + def manifest + self.filer.manifest + end + + def item_name + self.filer.item_name + end + + def column_template_dir + self.filer.template_dir + 'item_column/' + end + + def column_template_file_name + raise "undefined column_template_file_name\n" + end + + def column_template_name + self.column_template_dir + self.column_template_file_name + end + + def item_template_dir + self.filer.template_dir + 'date/' + end + + def item_template_file_name + raise "undefined item_template_file_name\n" + end + + def item_template_name + self.item_template_dir + self.item_template_file_name + end + + end + + class Default < Base + def column_template_file_name + 'show' + end + + def item_template_file_name + 'default' + end + + end + + class None < Base + def column_template_file_name + 'none' + end + + end + + end + end + end + end + end +end diff --git a/lib/locmare/filer/body/file_body/file_item/edit.rb b/lib/locmare/filer/body/file_body/file_item/edit.rb new file mode 100644 index 00000000..ee7e3357 --- /dev/null +++ b/lib/locmare/filer/body/file_body/file_item/edit.rb @@ -0,0 +1,25 @@ +require_dependency "locmare/filer/body/file_body/file_item/edit/edit" +module Locmare + module FilerModule + module BodyModule + module FileBodyModule + module FileItemModule + class EditItemColumnFactory + include EditItemColumnModule + @@types = { + 'default' => Default, 'none' => None, 'account' => Account, 'template' => Template + } + def self.factory file_item, my_manifest, item + type = my_manifest.type + raise "undefined type for local view filers > #{file_item.item_name} > edit\n" unless type + my_class = @@types[type] + raise "undefined class for local view filers > #{file_item.item_name} > edit > #{type}\n" unless my_class + my_class.new(file_item, my_manifest, item) + end + + end + end + end + end + end +end diff --git a/lib/locmare/filer/body/file_body/file_item/edit/edit.rb b/lib/locmare/filer/body/file_body/file_item/edit/edit.rb new file mode 100644 index 00000000..ee199a37 --- /dev/null +++ b/lib/locmare/filer/body/file_body/file_item/edit/edit.rb @@ -0,0 +1,158 @@ +module Locmare + module FilerModule + module BodyModule + module FileBodyModule + module FileItemModule + module EditItemColumnModule + class Base + attr :file_item, :edit_manifest, :item, :column_name + + def initialize file_item, edit_manifest, item + @file_item = file_item + @edit_manifest = edit_manifest + @item = item + @column_name = 'edit' + end + + def filer + @file_item.filer + end + + def manifest + self.filer.manifest + end + + def item_name + self.filer.item_name + end + + def image_dir + self.filer.image_dir + end + + def column_template_dir + self.filer.template_dir + 'item_column/' + end + + def column_template_file_name + raise "undefined column_template_file_name\n" + end + + def column_template_name + self.column_template_dir + self.column_template_file_name + end + + def item_template_dir + self.filer.template_dir + 'edit/' + end + + def item_template_file_name + raise "undefined item_template_file_name\n" + end + + def item_template_name + self.item_template_dir + self.item_template_file_name + end + + end + + class Default < Base + def column_template_file_name + 'show' + end + + def item_template_file_name + if @item.own? self.filer.operators + 'default' + else + 'none' + end + end + + def edit_img_file_name + self.image_dir + 'edit.png' + end + + def remove_img_file_name + self.image_dir + 'remove.png' + end + + def img_opt + {:width => Manifest.manifest.magic_numbers['thumbnail_width'] / 2, + :height => Manifest.manifest.magic_numbers['thumbnail_height'] / 2} + end + + def edit_img_opt + img_opt.merge :src => self.edit_img_file_name + end + + def remove_img_opt + img_opt.merge :src => self.remove_img_file_name + end + + end + + class None < Base + def column_template_file_name + 'none' + end + + end + + class Account < Base + def column_template_file_name + 'show' + end + + def item_template_file_name + if @item.own? self.filer.operators + 'account' + else + 'none' + end + end + + def edit_img_file_name + self.image_dir + 'edit.png' + end + + def img_opt + {:width => Manifest.manifest.magic_numbers['thumbnail_width'] / 2, + :height => Manifest.manifest.magic_numbers['thumbnail_height'] / 2} + end + + def edit_img_opt + img_opt.merge :src => self.edit_img_file_name + end + + end + + class Template < Base + def column_template_file_name + 'show' + end + + def item_template_file_name + 'template' + end + + def template_dir + @item.path_name + '/' + end + + def template_file_name + @edit_manifest.template_name + end + + def template_name + self.template_dir + self.template_file_name + end + + end + + end + end + end + end + end +end diff --git a/lib/locmare/filer/body/file_body/file_item/icon.rb b/lib/locmare/filer/body/file_body/file_item/icon.rb new file mode 100644 index 00000000..ece8c12f --- /dev/null +++ b/lib/locmare/filer/body/file_body/file_item/icon.rb @@ -0,0 +1,25 @@ +require_dependency "locmare/filer/body/file_body/file_item/icon/icon" +module Locmare + module FilerModule + module BodyModule + module FileBodyModule + module FileItemModule + class IconItemColumnFactory + include IconItemColumnModule + @@types = { + 'default' => Default, 'none' => None + } + def self.factory file_item, my_manifest, item + type = my_manifest.type + raise "undefined type for local view filers > #{file_item.item_name} > icon\n" unless type + my_class = @@types[type] + raise "undefined class for local view filers > #{file_item.item_name} > icon > #{type}\n" unless my_class + my_class.new(file_item, my_manifest, item) + end + + end + end + end + end + end +end diff --git a/lib/locmare/filer/body/file_body/file_item/icon/icon.rb b/lib/locmare/filer/body/file_body/file_item/icon/icon.rb new file mode 100644 index 00000000..87eeb356 --- /dev/null +++ b/lib/locmare/filer/body/file_body/file_item/icon/icon.rb @@ -0,0 +1,86 @@ +module Locmare + module FilerModule + module BodyModule + module FileBodyModule + module FileItemModule + module IconItemColumnModule + class Base + attr :file_item, :icon_manifest, :item, :column_name + + def initialize file_item, icon_manifest, item + @file_item = file_item + @icon_manifest = icon_manifest + @item = item + @column_name = 'icon' + end + + def filer + @file_item.filer + end + + def manifest + self.filer.manifest + end + + def item_name + self.filer.item_name + end + + def column_template_dir + self.filer.template_dir + 'item_column/' + end + + def column_template_file_name + raise "undefined column_template_file_name\n" + end + + def column_template_name + self.column_template_dir + self.column_template_file_name + end + + def item_template_dir + self.filer.template_dir + 'icon/' + end + + def item_template_file_name + raise "undefined item_template_file_name\n" + end + + def item_template_name + self.item_template_dir + self.item_template_file_name + end + + end + + class Default < Base + def column_template_file_name + 'show' + end + + def item_template_file_name + 'default' + end + + def icon_file_name + '/images/prof.png' + end + + def icon_size + Manifest.manifest.magic_numbers['thumbnail_width'] + end + + end + + class None < Base + def column_template_file_name + 'none' + end + + end + + end + end + end + end + end +end diff --git a/lib/locmare/filer/body/file_body/file_item/summary.rb b/lib/locmare/filer/body/file_body/file_item/summary.rb new file mode 100644 index 00000000..f1d62c84 --- /dev/null +++ b/lib/locmare/filer/body/file_body/file_item/summary.rb @@ -0,0 +1,25 @@ +require_dependency "locmare/filer/body/file_body/file_item/summary/summary" +module Locmare + module FilerModule + module BodyModule + module FileBodyModule + module FileItemModule + class SummaryItemColumnFactory + include SummaryItemColumnModule + @@types = { + 'none' => None, 'template' => Template + } + def self.factory file_item, my_manifest, item + type = my_manifest.type + raise "undefined type for local view filers > #{file_item.item_name} > summary\n" unless type + my_class = @@types[type] + raise "undefined class for local view filers > #{file_item.item_name} > summary > #{type}\n" unless my_class + my_class.new(file_item, my_manifest, item) + end + + end + end + end + end + end +end diff --git a/lib/locmare/filer/body/file_body/file_item/summary/summary.rb b/lib/locmare/filer/body/file_body/file_item/summary/summary.rb new file mode 100644 index 00000000..b382aedd --- /dev/null +++ b/lib/locmare/filer/body/file_body/file_item/summary/summary.rb @@ -0,0 +1,89 @@ +module Locmare + module FilerModule + module BodyModule + module FileBodyModule + module FileItemModule + module SummaryItemColumnModule + class Base + attr :file_item, :summary_manifest, :item, :column_name + + def initialize file_item, summary_manifest, item + @file_item = file_item + @summary_manifest = summary_manifest + @item = item + @column_name = 'summary' + end + + def filer + @file_item.filer + end + + def manifest + self.filer.manifest + end + + def item_name + self.filer.item_name + end + + def column_template_dir + self.filer.template_dir + 'item_column/' + end + + def column_template_file_name + raise "undefined column_template_file_name\n" + end + + def column_template_name + self.column_template_dir + self.column_template_file_name + end + + def item_template_dir + self.filer.template_dir + 'summary/' + end + + def item_template_file_name + raise "undefined item_template_file_name\n" + end + + def item_template_name + self.item_template_dir + self.item_template_file_name + end + + end + + class None < Base + def column_template_file_name + "none" + end + + end + + class Template < Base + def column_template_file_name + 'show' + end + + def item_template_file_name + 'template' + end + + def template_dir + @item.path_name + '/' + end + + def template_file_name + @summary_manifest.template_name + end + + def template_name + self.template_dir + self.template_file_name + end + + end + end + end + end + end + end +end diff --git a/lib/locmare/filer/body/file_body/file_item/symbol.rb b/lib/locmare/filer/body/file_body/file_item/symbol.rb new file mode 100644 index 00000000..3d5b5592 --- /dev/null +++ b/lib/locmare/filer/body/file_body/file_item/symbol.rb @@ -0,0 +1,27 @@ +require_dependency "locmare/filer/body/file_body/file_item/symbol/base" +require_dependency "locmare/filer/body/file_body/file_item/symbol/default" +require_dependency "locmare/filer/body/file_body/file_item/symbol/template" +module Locmare + module FilerModule + module BodyModule + module FileBodyModule + module FileItemModule + class SymbolItemColumnFactory + include SymbolItemColumnModule + @@types = { + 'default' => Default, 'template' => Template + } + def self.factory file_item, my_manifest, item + type = my_manifest.type + raise "undefined type for local view filers > #{file_item.item_name} > symbol\n" unless type + my_class = @@types[type] + raise "undefined class for local view filers > #{file_item.item_name} > symbol > #{type}\n" unless my_class + my_class.new(file_item, my_manifest, item) + end + + end + end + end + end + end +end diff --git a/lib/locmare/filer/body/file_body/file_item/symbol/base.rb b/lib/locmare/filer/body/file_body/file_item/symbol/base.rb new file mode 100644 index 00000000..aa066e88 --- /dev/null +++ b/lib/locmare/filer/body/file_body/file_item/symbol/base.rb @@ -0,0 +1,60 @@ +module Locmare + module FilerModule + module BodyModule + module FileBodyModule + module FileItemModule + module SymbolItemColumnModule + class Base + attr :file_item, :symbol_manifest, :item, :column_name + + def initialize file_item, symbol_manifest, item + @file_item = file_item + @symbol_manifest = symbol_manifest + @item = item + @column_name = 'symbol' + end + + def filer + @file_item.filer + end + + def manifest + self.filer.manifest + end + + def item_name + self.filer.item_name + end + + def column_template_dir + self.filer.template_dir + 'item_column/' + end + + def column_template_file_name + raise "undefined column_template_file_name\n" + end + + def column_template_name + self.column_template_dir + self.column_template_file_name + end + + def item_template_dir + self.filer.template_dir + 'symbol/' + end + + def item_template_file_name + raise "undefined item_template_file_name\n" + end + + def item_template_name + self.item_template_dir + self.item_template_file_name + end + + end + + end + end + end + end + end +end diff --git a/lib/locmare/filer/body/file_body/file_item/symbol/default.rb b/lib/locmare/filer/body/file_body/file_item/symbol/default.rb new file mode 100644 index 00000000..fad23bc1 --- /dev/null +++ b/lib/locmare/filer/body/file_body/file_item/symbol/default.rb @@ -0,0 +1,37 @@ +require_dependency "locmare/filer/body/file_body/file_item/symbol/default/face" +require_dependency "locmare/filer/body/file_body/file_item/symbol/default/link" +module Locmare + module FilerModule + module BodyModule + module FileBodyModule + module FileItemModule + module SymbolItemColumnModule + class Default < Base + include DefaultModule + attr :face, :link + + def initialize file_item, symbol_manifest, item + super + @face = FaceFactory.factory self, self.symbol_manifest.face, @item + @link = LinkFactory.factory self, self.symbol_manifest.link, @item + end + + def column_template_file_name + 'show' + end + + def item_template_file_name + if @symbol_manifest.link.type == 'none' + 'default_without_link' + else + 'default' + end + end + + end + end + end + end + end + end +end diff --git a/lib/locmare/filer/body/file_body/file_item/symbol/default/face.rb b/lib/locmare/filer/body/file_body/file_item/symbol/default/face.rb new file mode 100644 index 00000000..f62942cb --- /dev/null +++ b/lib/locmare/filer/body/file_body/file_item/symbol/default/face.rb @@ -0,0 +1,29 @@ +require_dependency "locmare/filer/body/file_body/file_item/symbol/default/face/face" +module Locmare + module FilerModule + module BodyModule + module FileBodyModule + module FileItemModule + module SymbolItemColumnModule + module DefaultModule + class FaceFactory + include FaceModule + @@types = { + 'image' => ImageFace, 'picture' => PictureFace + } + def self.factory file_item, my_manifest, item + type = my_manifest.type + raise "undefined type for local view filers > #{file_item.item_name} > symbol > face\n" unless type + my_class = @@types[type] + raise "undefined class for local view filers > #{file_item.item_name} > symbol > face > #{type}\n" unless my_class + my_class.new(file_item, my_manifest, item) + end + + end + end + end + end + end + end + end +end diff --git a/lib/locmare/filer/body/file_body/file_item/symbol/default/face/face.rb b/lib/locmare/filer/body/file_body/file_item/symbol/default/face/face.rb new file mode 100644 index 00000000..72121c41 --- /dev/null +++ b/lib/locmare/filer/body/file_body/file_item/symbol/default/face/face.rb @@ -0,0 +1,84 @@ +module Locmare + module FilerModule + module BodyModule + module FileBodyModule + module FileItemModule + module SymbolItemColumnModule + module DefaultModule + module FaceModule + class BaseFace + attr :default_symbol, :face_manifest, :item + def initialize default_symbol, face_manifest, item + @default_symbol = default_symbol + @face_manifest = face_manifest + @item = item + end + + def filer + @default_symbol.filer + end + + def manifest + self.filer.manifest + end + + def item_name + self.filer.item_name + end + + def template_dir + self.filer.template_dir + "symbol_face/" + end + + def template_file_name + raise "undefined template_file_name\n" + end + + def template_name + self.template_dir + self.template_file_name + end + + end + + class ImageFace < BaseFace + def template_file_name + 'image' + end + + def url + @face_manifest.url + end + + def tag_opt + {:src => self.url, :width => Manifest.manifest.magic_numbers['thumbnail_width'], :height => Manifest.manifest.magic_numbers['thumbnail_height']} + end + + end + + class PictureFace < BaseFace + def template_file_name + 'picture' + end + + def method_name + @face_manifest.method_name + end + + def tag_opt + if @item.methods(true).include?(self.method_name.to_sym) + @item.__send__ self.method_name + else + {:src => '/images/error.png', :width => Manifest.manifest.magic_numbers['thumbnail_width'], :height => Manifest.manifest.magic_numbers['thumbnail_height']} + end + end + + end + + end + end + end + end + end + end + end +end diff --git a/lib/locmare/filer/body/file_body/file_item/symbol/default/link.rb b/lib/locmare/filer/body/file_body/file_item/symbol/default/link.rb new file mode 100644 index 00000000..9761ba7f --- /dev/null +++ b/lib/locmare/filer/body/file_body/file_item/symbol/default/link.rb @@ -0,0 +1,29 @@ +require_dependency "locmare/filer/body/file_body/file_item/symbol/default/link/link" +module Locmare + module FilerModule + module BodyModule + module FileBodyModule + module FileItemModule + module SymbolItemColumnModule + module DefaultModule + class LinkFactory + include LinkModule + @@types = { + 'action' => ActionLink, 'none' => NoneLink, 'url_column' => UrlColumnLink + } + def self.factory file_item, my_manifest, item + type = my_manifest.type + raise "undefined type for local view filers > #{file_item.item_name} > symbol > link\n" unless type + my_class = @@types[type] + raise "undefined class for local view filers > #{file_item.item_name} > symbol > link > #{type}\n" unless my_class + my_class.new(file_item, my_manifest, item) + end + + end + end + end + end + end + end + end +end diff --git a/lib/locmare/filer/body/file_body/file_item/symbol/default/link/link.rb b/lib/locmare/filer/body/file_body/file_item/symbol/default/link/link.rb new file mode 100644 index 00000000..dba63898 --- /dev/null +++ b/lib/locmare/filer/body/file_body/file_item/symbol/default/link/link.rb @@ -0,0 +1,53 @@ +module Locmare + module FilerModule + module BodyModule + module FileBodyModule + module FileItemModule + module SymbolItemColumnModule + module DefaultModule + module LinkModule + class BaseLink + attr :default_symbol, :link_manifest, :item + def initialize default_symbol, link_manifest, item + @default_symbol = default_symbol + @link_manifest = link_manifest + @item = item + end + + def url + raise "undefined url\n" + end + + end + + class ActionLink < BaseLink + + def url + @link_manifest.action_path + @item.id.to_s + end + end + + class NoneLink < BaseLink + + def url + nil + end + + end + + class UrlColumnLink < BaseLink + + def url + @item.attributes[@link_manifest.column_name] + end + + end + + end + end + end + end + end + end + end +end diff --git a/lib/locmare/filer/body/file_body/file_item/symbol/template.rb b/lib/locmare/filer/body/file_body/file_item/symbol/template.rb new file mode 100644 index 00000000..23ddc6dd --- /dev/null +++ b/lib/locmare/filer/body/file_body/file_item/symbol/template.rb @@ -0,0 +1,34 @@ +module Locmare + module FilerModule + module BodyModule + module FileBodyModule + module FileItemModule + module SymbolItemColumnModule + class Template < Base + def column_template_file_name + 'show' + end + + def item_template_file_name + 'template' + end + + def template_dir + @item.path_name + '/' + end + + def template_file_name + @symbol_manifest.template_name + end + + def template_name + self.template_dir + self.template_file_name + end + + end + end + end + end + end + end +end diff --git a/lib/locmare/filer/body/file_header.rb b/lib/locmare/filer/body/file_header.rb new file mode 100644 index 00000000..4fcf5c74 --- /dev/null +++ b/lib/locmare/filer/body/file_header.rb @@ -0,0 +1,63 @@ +require_dependency "locmare/filer/body/file_header/base" +require_dependency "locmare/filer/body/file_header/show" +require_dependency "locmare/filer/body/file_header/none" +module Locmare + module FilerModule + module BodyModule + class FileHeader + include FileHeaderModule + + attr :body, + :symbol, :caption, :summary, :icon, :date, :edit + def initialize body + @body = body + c = self.filer.manifest.symbol.visible? ? Show : None + @symbol = c.new self, 'symbol' + c = self.filer.manifest.caption.visible? ? Show : None + @caption = c.new self, 'caption' + c = self.filer.manifest.summary.visible? ? Show : None + @summary = c.new self, 'summary' + c = self.filer.manifest.icon.visible? ? Show : None + @icon = c.new self, 'icon' + c = self.filer.manifest.date.visible? ? Show : None + @date = c.new self, 'date' + c = self.filer.manifest.edit.visible? ? Show : None + @edit = c.new self, 'edit' + end + + def filer + @body.filer + end + + def manifest + self.filer.manifest + end + + def item_name + self.filer.item_name + end + + def model + self.filer.model + end + + def items + self.filer.items + end + + def template_dir + @body.template_dir + end + + def template_file_name + "file_header" + end + + def template_name + self.template_dir + self.template_file_name + end + + end + end + end +end diff --git a/lib/manifest/local/view/filer/body/file_body.rb b/lib/locmare/filer/body/file_header/base.rb similarity index 57% rename from lib/manifest/local/view/filer/body/file_body.rb rename to lib/locmare/filer/body/file_header/base.rb index 42353550..100c9e3b 100644 --- a/lib/manifest/local/view/filer/body/file_body.rb +++ b/lib/locmare/filer/body/file_header/base.rb @@ -1,20 +1,16 @@ -require_dependency "manifest/local/view/filer/body/file_body/file_item" -module Manifest - module View - module FilerModule - module BodyModule - class FileBody - include FileBodyModule - attr :body, :file_items - def initialize body - @body = body - @file_items = self.items.map {|item| - FileItem.new self, item - } +module Locmare + module FilerModule + module BodyModule + module FileHeaderModule + class Base + attr :file_header, :column_name + def initialize file_header, column_name + @file_header = file_header + @column_name = column_name end def filer - @body.filer + @file_header.filer end def manifest @@ -34,11 +30,11 @@ module Manifest end def template_dir - self.filer.template_dir + self.filer.template_dir + 'header_column/' end def template_file_name - "file_body" + "show" end def template_name diff --git a/lib/locmare/filer/body/file_header/none.rb b/lib/locmare/filer/body/file_header/none.rb new file mode 100644 index 00000000..9fe0cf4f --- /dev/null +++ b/lib/locmare/filer/body/file_header/none.rb @@ -0,0 +1,13 @@ +module Locmare + module FilerModule + module BodyModule + module FileHeaderModule + class None < Base + def template_file_name + "none" + end + end + end + end + end +end diff --git a/lib/locmare/filer/body/file_header/show.rb b/lib/locmare/filer/body/file_header/show.rb new file mode 100644 index 00000000..e2c60dbc --- /dev/null +++ b/lib/locmare/filer/body/file_header/show.rb @@ -0,0 +1,13 @@ +module Locmare + module FilerModule + module BodyModule + module FileHeaderModule + class Show < Base + def template_file_name + "show" + end + end + end + end + end +end diff --git a/lib/locmare/filer/footer.rb b/lib/locmare/filer/footer.rb new file mode 100644 index 00000000..7e98a3d1 --- /dev/null +++ b/lib/locmare/filer/footer.rb @@ -0,0 +1,24 @@ +module Locmare + module FilerModule + class Footer + attr :filer, :paginate + def initialize filer, paginate + @filer = filer + @paginate = paginate + end + + def template_dir + @filer.template_dir + end + + def template_file_name + "footer" + end + + def template_name + self.template_dir + self.template_file_name + end + + end + end +end diff --git a/lib/locmare/filer/header.rb b/lib/locmare/filer/header.rb new file mode 100644 index 00000000..e165dbab --- /dev/null +++ b/lib/locmare/filer/header.rb @@ -0,0 +1,39 @@ +module Locmare + module FilerModule + class Header + attr :filer + def initialize filer + @filer = filer + end + + def model + @filer.model + end + + def icon_name + self.model.singular + end + + def icon_size + Manifest.manifest.magic_numbers['thumbnail_width'] / 2 + end + + def human_name + self.model.model_name.human + end + + def template_dir + @filer.template_dir + end + + def template_file_name + "header" + end + + def template_name + self.template_dir + self.template_file_name + end + + end + end +end diff --git a/lib/locmare/form.rb b/lib/locmare/form.rb new file mode 100644 index 00000000..7fc8dd53 --- /dev/null +++ b/lib/locmare/form.rb @@ -0,0 +1,65 @@ +require_dependency "locmare/form/field" +module Locmare + class Form + include FormModule + attr :form_name, :item, :mounted, :submit, :operators, :template_dir, + :fields + def initialize form_name, item, mounted, submit, operators + @form_name = form_name + @item = item + @mounted = mounted + @submit = submit + @operators = operators + @manifest = LocalManifest.manifest.forms[@form_name] + @template_dir = 'templates/r/form/' + @fields = {} + @manifest.each_field do |field_name, field_manifest| + @fields[field_name] = Field.new self, field_name, field_manifest + end + end + + def each_field + @manifest.each_field do |field_name, field_manifest| + yield field_name, @fields[field_name] + end + end + + def template_file_name + "form" + end + + def template_name + self.template_dir + self.template_file_name + end + + def submit_name + if @item.new_record? + @item.table_name + '.submit.new' + else + @item.table_name + '.submit.edit' + end + end + + def submit_template_dir + self.template_dir + 'submit/' + end + + def submit_template_name + if @submit + self.submit_template_dir + 'submit' + else + self.submit_template_dir + 'none' + end + end + + def fields_template_name + self.template_dir + 'fields' + end + + def image_dir + '/images/' + end + + end +end + diff --git a/lib/locmare/form/field.rb b/lib/locmare/form/field.rb new file mode 100644 index 00000000..014eb578 --- /dev/null +++ b/lib/locmare/form/field.rb @@ -0,0 +1,81 @@ +require_dependency "locmare/form/field/label" +require_dependency "locmare/form/field/tag" +require_dependency "locmare/form/field/helper" +module Locmare + module FormModule + class Field + include FieldModule + attr :form, :field_name, :field_manifest, + :label, :tag, :helpers, :options + def initialize form, field_name, field_manifest + @form = form + @field_name = field_name + @field_manifest = field_manifest + @label = LabelFactory.factory self, @field_manifest.label + @tag = TagFactory.factory self, @field_manifest.tag + @helpers = {} + @field_manifest.helpers.each {|helper_name, helper_manifest| + @helpers[helper_name] = HelperFactory.factory self, helper_manifest + } + @options = {'data-model' => @field_manifest.model_name} + end + + def mounted + @form.mounted ? 0 : 1 + end + + def mount_option + {'mount' => self.mounted} + end + + def item + @form.item + end + + def value + self.item.attributes[@field_manifest.column_name] + end + + def options tag_options = {} + self.item.field_tag_attributes(@field_manifest.column_name, tag_options).merge(self.mount_option) + end + + def form_field_name + @field_manifest.form_field_name + end + + def form_name + @form.form_name + end + + def template_dir + @form.template_dir + 'field/' + end + + def template_file_name + @field_manifest.type + end + + def template_name + self.template_dir + self.template_file_name + end + + def row_break_template_dir + @form.template_dir + 'row_break/' + end + + def row_break_template_file_name + if @field_manifest.row_break + 'br' + else + 'no_break' + end + end + + def row_break_template_name + self.row_break_template_dir + self.row_break_template_file_name + end + + end + end +end diff --git a/lib/locmare/form/field/helper.rb b/lib/locmare/form/field/helper.rb new file mode 100644 index 00000000..22d921bc --- /dev/null +++ b/lib/locmare/form/field/helper.rb @@ -0,0 +1,26 @@ +require_dependency "locmare/form/field/helper/base" +require_dependency "locmare/form/field/helper/size" +require_dependency "locmare/form/field/helper/tail_angle" +require_dependency "locmare/form/field/helper/color" +require_dependency "locmare/form/field/helper/popup" +module Locmare + module FormModule + module FieldModule + class HelperFactory + include HelperModule + @@types = { + 'size' => Size, 'tail_angle' => TailAngle, 'color' => Color, + 'popup' => Popup + } + def self.factory field, my_manifest + type = my_manifest.type + my_class = @@types[type] + raise "undefined class for local view forms > #{field.form_name} > fields > #{field.field_name} > helper > #{type}\n" unless my_class + my_class.new(field, my_manifest) + end + + end + + end + end +end diff --git a/lib/locmare/form/field/helper/base.rb b/lib/locmare/form/field/helper/base.rb new file mode 100644 index 00000000..a974459e --- /dev/null +++ b/lib/locmare/form/field/helper/base.rb @@ -0,0 +1,50 @@ +module Locmare + module FormModule + module FieldModule + module HelperModule + class Base + attr :field, :helper_manifest + + def initialize field, helper_manifest + @field = field + @helper_manifest = helper_manifest + end + + def type + @helper_manifest.type + end + + def path + @helper_manifest.path + end + + def form + @field.form + end + + def template_dir + self.form.template_dir + 'helper/' + end + + def template_file_name + @helper_manifest.file_name + end + + def template_name + self.template_dir + self.template_file_name + end + + def form_name + @field.form_name + end + + def field_name + @field.field_name + end + + end + + end + end + end +end diff --git a/lib/locmare/form/field/helper/color.rb b/lib/locmare/form/field/helper/color.rb new file mode 100644 index 00000000..8d2c3a15 --- /dev/null +++ b/lib/locmare/form/field/helper/color.rb @@ -0,0 +1,15 @@ +module Locmare + module FormModule + module FieldModule + module HelperModule + class Color < Base + def wrapper + @helper_manifest.wrapper + end + + end + + end + end + end +end diff --git a/lib/locmare/form/field/helper/popup.rb b/lib/locmare/form/field/helper/popup.rb new file mode 100644 index 00000000..4fa7e1c5 --- /dev/null +++ b/lib/locmare/form/field/helper/popup.rb @@ -0,0 +1,13 @@ +module Locmare + module FormModule + module FieldModule + module HelperModule + class Popup < Base + attr :source + + end + + end + end + end +end diff --git a/lib/locmare/form/field/helper/size.rb b/lib/locmare/form/field/helper/size.rb new file mode 100644 index 00000000..dac12b99 --- /dev/null +++ b/lib/locmare/form/field/helper/size.rb @@ -0,0 +1,16 @@ +module Locmare + module FormModule + module FieldModule + module HelperModule + class Size < Base + + def dom_class + @helper_manifest.dom_class + end + + end + + end + end + end +end diff --git a/lib/locmare/form/field/helper/tail_angle.rb b/lib/locmare/form/field/helper/tail_angle.rb new file mode 100644 index 00000000..4ec9d01a --- /dev/null +++ b/lib/locmare/form/field/helper/tail_angle.rb @@ -0,0 +1,12 @@ +module Locmare + module FormModule + module FieldModule + module HelperModule + class TailAngle < Base + + end + + end + end + end +end diff --git a/lib/locmare/form/field/label.rb b/lib/locmare/form/field/label.rb new file mode 100644 index 00000000..e351982b --- /dev/null +++ b/lib/locmare/form/field/label.rb @@ -0,0 +1,21 @@ +require_dependency "locmare/form/field/label/label" +module Locmare + module FormModule + module FieldModule + class LabelFactory + include LabelModule + @@types = { + 'default' => Default, 'none' => None + } + def self.factory field, my_manifest + type = my_manifest.type + my_class = @@types[type] + raise "undefined class for local view forms > #{field.form_name} > fields > #{field.field_name} > label > #{type}\n" unless my_class + my_class.new(field, my_manifest) + end + + end + + end + end +end diff --git a/lib/locmare/form/field/label/label.rb b/lib/locmare/form/field/label/label.rb new file mode 100644 index 00000000..3d10dd75 --- /dev/null +++ b/lib/locmare/form/field/label/label.rb @@ -0,0 +1,92 @@ +module Locmare + module FormModule + module FieldModule + module LabelModule + class Base + attr :field, :label_manifest + + def initialize field, label_manifest + @field = field + @label_manifest = label_manifest + end + + def form + @field.form + end + + def manifest + self.form.manifest + end + + def form_name + self.form.form_name + end + + def model + self.form.model + end + + def item + self.form.item + end + + def model_name + @label_manifest.model_name + end + + def column_name + @label_manifest.column_name + end + + def template_dir + self.form.template_dir + 'label/' + end + + def template_file_name + raise "undefined template_file_name\n" + end + + def template_name + self.template_dir + self.template_file_name + end + + def label_row_break_template_dir + self.form.template_dir + 'label_row_break/' + end + + def label_row_break_template_file_name + if @label_manifest.row_break + 'br' + else + 'no_break' + end + end + + def label_row_break_template_name + self.label_row_break_template_dir + self.label_row_break_template_file_name + end + + end + + class Default < Base + def template_file_name + 'default' + end + + def label_name + 'activerecord.attributes.' + self.model_name + '.' + self.column_name + end + + end + + class None < Base + def template_file_name + 'none' + end + + end + + end + end + end +end diff --git a/lib/locmare/form/field/tag.rb b/lib/locmare/form/field/tag.rb new file mode 100644 index 00000000..075dc04d --- /dev/null +++ b/lib/locmare/form/field/tag.rb @@ -0,0 +1,27 @@ +require_dependency "locmare/form/field/tag/base" +require_dependency "locmare/form/field/tag/text" +require_dependency "locmare/form/field/tag/number" +require_dependency "locmare/form/field/tag/text_area" +require_dependency "locmare/form/field/tag/select" +require_dependency "locmare/form/field/tag/hidden" +module Locmare + module FormModule + module FieldModule + class TagFactory + include TagModule + @@types = { + 'text' => TextTag, 'number' => NumberTag, 'text_area' => TextAreaTag, + 'select' => SelectTag, 'hidden' => HiddenTag + } + def self.factory field, my_manifest + type = my_manifest.type + my_class = @@types[type] + raise "undefined class for local view forms > #{field.form_name} > fields > #{field.field_name} > tag > #{type}\n" unless my_class + my_class.new(field, my_manifest) + end + + end + + end + end +end diff --git a/lib/locmare/form/field/tag/base.rb b/lib/locmare/form/field/tag/base.rb new file mode 100644 index 00000000..484608aa --- /dev/null +++ b/lib/locmare/form/field/tag/base.rb @@ -0,0 +1,70 @@ +module Locmare + module FormModule + module FieldModule + module TagModule + class Base + attr :field, :tag_manifest + + def initialize field, tag_manifest + @field = field + @tag_manifest = tag_manifest + end + + def form_field_name + @field.form_field_name + end + + def value + @field.value + end + + def options + @field.options @tag_manifest.options + end + + def form + @field.form + end + + def manifest + self.form.manifest + end + + def form_name + self.form.form_name + end + + def model + self.form.model + end + + def item + self.form.item + end + + def model_name + @label_manifest.model_name + end + + def column_name + @label_manifest.column_name + end + + def template_dir + self.form.template_dir + 'tag/' + end + + def template_file_name + raise "undefined template_file_name\n" + end + + def template_name + self.template_dir + self.template_file_name + end + + end + + end + end + end +end diff --git a/lib/locmare/form/field/tag/hidden.rb b/lib/locmare/form/field/tag/hidden.rb new file mode 100644 index 00000000..19e97d66 --- /dev/null +++ b/lib/locmare/form/field/tag/hidden.rb @@ -0,0 +1,15 @@ +module Locmare + module FormModule + module FieldModule + module TagModule + class HiddenTag < Base + def template_file_name + 'hidden' + end + + end + + end + end + end +end diff --git a/lib/locmare/form/field/tag/number.rb b/lib/locmare/form/field/tag/number.rb new file mode 100644 index 00000000..891daf1f --- /dev/null +++ b/lib/locmare/form/field/tag/number.rb @@ -0,0 +1,15 @@ +module Locmare + module FormModule + module FieldModule + module TagModule + class NumberTag < Base + def template_file_name + 'number' + end + + end + + end + end + end +end diff --git a/lib/locmare/form/field/tag/select.rb b/lib/locmare/form/field/tag/select.rb new file mode 100644 index 00000000..3da48a02 --- /dev/null +++ b/lib/locmare/form/field/tag/select.rb @@ -0,0 +1,25 @@ +module Locmare + module FormModule + module FieldModule + module TagModule + class SelectTag < Base + def template_file_name + 'select' + end + + def select_item_name + model = ::Manifest.manifest.models[@field.field_manifest.model_name] + attr = model.attributes[@field.field_manifest.column_name] + attr.source.select_item_name + end + + def items + ::Manifest.manifest.system_resources.select_items[self.select_item_name] + end + + end + + end + end + end +end diff --git a/lib/locmare/form/field/tag/text.rb b/lib/locmare/form/field/tag/text.rb new file mode 100644 index 00000000..9d668320 --- /dev/null +++ b/lib/locmare/form/field/tag/text.rb @@ -0,0 +1,15 @@ +module Locmare + module FormModule + module FieldModule + module TagModule + class TextTag < Base + def template_file_name + 'text' + end + + end + + end + end + end +end diff --git a/lib/locmare/form/field/tag/text_area.rb b/lib/locmare/form/field/tag/text_area.rb new file mode 100644 index 00000000..2cbf03f3 --- /dev/null +++ b/lib/locmare/form/field/tag/text_area.rb @@ -0,0 +1,15 @@ +module Locmare + module FormModule + module FieldModule + module TagModule + class TextAreaTag < Base + def template_file_name + 'text_area' + end + + end + + end + end + end +end diff --git a/lib/locmare/list_group.rb b/lib/locmare/list_group.rb new file mode 100644 index 00000000..e2089388 --- /dev/null +++ b/lib/locmare/list_group.rb @@ -0,0 +1,29 @@ +require_dependency "locmare/list_group/list/base" +require_dependency "locmare/list_group/list/public" +require_dependency "locmare/list_group/list/private" +require_dependency "locmare/list_group/list/system_resource" +require_dependency "locmare/list_group/list/filter" +require_dependency "locmare/list_group/list/through_filter" +require_dependency "locmare/list_group/list/foreign_filter" +require_dependency "locmare/list_group/list/play" +module Locmare + class ListGroup + include ListGroupModule + + def self.types + { + 'public' => PublicList, 'private' => PrivateList, 'system_resource' => SystemResourceList, + 'filter' => FilterList, 'through_filter' => ThroughFilterList, 'foreign_filter' => ForeignFilterList, + 'play' => PlayList + } + end + + def self.list item_name, list_name + list_group_manifest = LocalManifest.manifest.list_groups[item_name] + list_manifest = list_group_manifest.lists[list_name] + self.types[list_manifest.type].new item_name, list_name + end + + end +end + diff --git a/lib/locmare/list_group/list/base.rb b/lib/locmare/list_group/list/base.rb new file mode 100644 index 00000000..7e71f68c --- /dev/null +++ b/lib/locmare/list_group/list/base.rb @@ -0,0 +1,107 @@ +module Locmare + module ListGroupModule + class Base + class ListResult + attr :items, :paginate + def initialize items, paginate + @items = items + @paginate = paginate + end + + end + + attr :item_name, :list_name, + :model_manifest, :model_list_manifest, :model, + :default_page_size, :max_page_size + def initialize item_name, list_name + @item_name = item_name + @list_name = list_name + self.init + end + + def init + @list_group_manifest = LocalManifest.manifest.list_groups[@item_name] + @list_manifest = @list_group_manifest.lists[@list_name] + @where = @list_manifest.where + @includes = @list_manifest.includes + @model_manifest = ::Manifest.manifest.models[@item_name] + @model_list_manifest = @model_manifest.list + @model = ::Manifest.item_name_to_model @item_name + @table_name = @model.table_name + end + + def model_name + @model.model_name + end + + def model_manifest + @model.model_manifest + end + + def page_number prm = nil + page = prm.to_i + page = 1 if page < 1 + page + end + + def page_size prm + page_size = prm.to_i + page_size = self.max_page_size if page_size > self.max_page_size + page_size = self.default_page_size if page_size < 1 + page_size + end + + def default_page_size + @model_list_manifest.default_page_size + end + + def max_page_size + @model_list_manifest.max_page_size + end + + def base_where_condition + method_name = @where.conditions do |name| + name + end + @model.__send__ method_name + end + + def where_condition + base_where_condition + end + + def include_hash + @includes.includes + end + + def order + @model.list_order + end + + def items operators, options, offset, page_size + @model.where(self.where_condition).includes(self.include_hash).order(self.order).offset(offset).limit(page_size) + end + + def count operators, options + @model.where(self.where_condition).includes(self.include_hash).count + end + + def paginate count, offset, page_size + c = count ? count.to_i : 0 + Kaminari.paginate_array(Array.new(c, nil)).page(offset).per(page_size) + end + + def open operators, options + page = self.page_number(options[:page]) + page_size = self.page_size options[:page_size] + offset = (page -1) * page_size + items = self.items operators, options, offset, page_size + count = self.count operators, options + pg = self.paginate count, offset, page_size + ListResult.new items, pg + end + + end + + end +end diff --git a/lib/locmare/list_group/list/filter.rb b/lib/locmare/list_group/list/filter.rb new file mode 100644 index 00000000..b1050913 --- /dev/null +++ b/lib/locmare/list_group/list/filter.rb @@ -0,0 +1,37 @@ +module Locmare + module ListGroupModule + class FilterList < Base + attr :filter_key, :filter_item_name + + def init + super + @filter_key = @list_manifest.filter_key + @filter_item_name = @list_manifest.filter_item_name + end + + def where_condition filter_item_id + w = self.base_where_condition + w += ' and ' unless w.blank? + [w + @table_name + '.' + @filter_key + ' = ?', filter_item_id] + end + + def include_hash + w = super + w.merge!({@filter_item_name => {} }) unless w[@filter_item_name] + w + end + + def items operators, options, offset, page_size + filter_item_id = options[:id] + @model.where(self.where_condition(filter_item_id)).includes(self.include_hash).order(self.order).offset(offset).limit(page_size) + end + + def count operators, options + filter_item_id = options[:id] + @model.where(self.where_condition(filter_item_id)).includes(self.include_hash).count + end + + end + + end +end diff --git a/lib/locmare/list_group/list/foreign_filter.rb b/lib/locmare/list_group/list/foreign_filter.rb new file mode 100644 index 00000000..007e072c --- /dev/null +++ b/lib/locmare/list_group/list/foreign_filter.rb @@ -0,0 +1,24 @@ +module Locmare + module ListGroupModule + class ForeignFilterList < FilterList + + def init + super + @filter_table_name = ::Manifest.manifest.models[@filter_item_name].classify.table_name + @tree_name = @list_manifest.tree_name + end + + def where_condition filter_item_id + w = self.base_where_condition + w += ' and ' unless w.blank? + [w + @filter_table_name + '.id' + ' = ?', filter_item_id] + end + + def include_hash + @model_manifest.tree[@tree_name].include_hash + end + + end + + end +end diff --git a/lib/locmare/list_group/list/play.rb b/lib/locmare/list_group/list/play.rb new file mode 100644 index 00000000..72612364 --- /dev/null +++ b/lib/locmare/list_group/list/play.rb @@ -0,0 +1,41 @@ +module Locmare + module ListGroupModule + class PlayList + attr :model, :list_name, :list_manifest, :type, + :default_page_size, :max_page_size + + def initialize model, list_name, list_manifest + @model = model + @list_name = list_name + @list_manifest = list_manifest + self.set_default + self.init + end + + def set_default + @list_manifest['args'] ||= {} + return + @default_page_size = @conf['default_page_size'] || 25 + @max_page_size = @conf['max_page_size'] || 100 + @params_offset = params_offset + @params_count = params_count + @list_list_conf = @manifest.list(@item_name).lists[list_name] || {} + @model_name = @list_list_conf['model'] + @filter_key = @list_list_conf['filter_key'] + @model = @model_name.classify.constantize + @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 init + @type = @list_manifest['type'] + @args = @list_manifest['args'] + end + + end + + end +end diff --git a/lib/locmare/list_group/list/private.rb b/lib/locmare/list_group/list/private.rb new file mode 100644 index 00000000..27aeefa9 --- /dev/null +++ b/lib/locmare/list_group/list/private.rb @@ -0,0 +1,42 @@ +module Locmare + module ListGroupModule + class PrivateList < Base + + def init + super + end + + def where_condition operators + case @model.owner_type + when :author + operator = operators.author + when :artist + operator = operators.artist + end + t = if @owner_model + if @owner_model.owner_model + @owner_model.owner_model.table_name + else + @owner_model.table_name + end + else + @table_name + end + @where.conditions do |name| + [t + '.' + @model.owner_type.to_s + '_id = ?', operator.id] + end + end + + def items operators, options, offset, page_size + @model.where(self.where_condition(operators)).includes(self.include_hash).order(self.order).offset(offset).limit(page_size) + end + + def count operators, options + filter_item_id = options[:id] + @model.where(self.where_condition(operators)).includes(self.include_hash).count + end + + end + + end +end diff --git a/lib/locmare/list_group/list/public.rb b/lib/locmare/list_group/list/public.rb new file mode 100644 index 00000000..9259827b --- /dev/null +++ b/lib/locmare/list_group/list/public.rb @@ -0,0 +1,16 @@ +module Locmare + module ListGroupModule + class PublicList < Base + + def init + super + end + + def order + @model.list_order + end + + end + + end +end diff --git a/lib/locmare/list_group/list/system_resource.rb b/lib/locmare/list_group/list/system_resource.rb new file mode 100644 index 00000000..94b1846e --- /dev/null +++ b/lib/locmare/list_group/list/system_resource.rb @@ -0,0 +1,19 @@ +module Locmare + module ListGroupModule + class SystemResourceList < Base + + def init + super + end + + def items operators, options, offset, page_size + # enable_list does not work when configured auto load in development.rb + # auto loader undefing MODEL at reload manifest file + # @model.enable_list + super + end + + end + + end +end diff --git a/lib/locmare/list_group/list/through_filter.rb b/lib/locmare/list_group/list/through_filter.rb new file mode 100644 index 00000000..322cd3f4 --- /dev/null +++ b/lib/locmare/list_group/list/through_filter.rb @@ -0,0 +1,25 @@ +module Locmare + module ListGroupModule + class ThroughFilterList < FilterList + attr :through + + def init + super + @through = @list_manifest.through + @filter_table_name = ::Manifest.manifest.models[@filter_item_name].classify.table_name + end + + def include_hash + {@through => {@filter_item_name => {}} } + end + + def where_condition filter_item_id + w = self.base_where_condition + w += ' and ' unless w.blank? + [w + @filter_table_name + '.id' + ' = ?', filter_item_id] + end + + end + + end +end diff --git a/lib/locmare/locmare.rb b/lib/locmare/locmare.rb new file mode 100644 index 00000000..3606e89f --- /dev/null +++ b/lib/locmare/locmare.rb @@ -0,0 +1,4 @@ +require_dependency "locmare/filer" +require_dependency "locmare/form" +require_dependency "locmare/profiler" +require_dependency "locmare/list_group" diff --git a/lib/locmare/profiler.rb b/lib/locmare/profiler.rb new file mode 100644 index 00000000..e1672c4c --- /dev/null +++ b/lib/locmare/profiler.rb @@ -0,0 +1,64 @@ +require_dependency "locmare/profiler/header" +require_dependency "locmare/profiler/column" +require_dependency "locmare/profiler/association" +module Locmare + class Profiler + include ProfilerModule + attr :profiler_manifest, :item_name, :item, :operators, :template_dir, + :header, :columns, :associations + def initialize item_name, item, operators + @item_name = item_name + @item = item + @operators = operators + @profiler_manifest = LocalManifest.manifest.profilers[@item_name] + @template_dir = 'templates/r/profiler/' + @header = Header.new self + @columns = @profiler_manifest.column_names.map {|column_name| + Column.new self, column_name + } + @associations = Association.new self, @profiler_manifest.associations + end + + def model + ::Manifest::item_name_to_model @item_name + end + + def template_file_name + "profiler" + end + + def template_name + self.template_dir + self.template_file_name + end + + def header_template_file_name + "header" + end + + def header_template_name + self.template_dir + self.header_template_file_name + end + + def columns_template_file_name + "columns" + end + + def columns_template_name + self.template_dir + self.columns_template_file_name + end + + def associations_template_file_name + "associations" + end + + def associations_template_name + self.template_dir + self.associations_template_file_name + end + + def image_dir + '/images/' + end + + end +end + diff --git a/lib/locmare/profiler/association.rb b/lib/locmare/profiler/association.rb new file mode 100644 index 00000000..a5c6f405 --- /dev/null +++ b/lib/locmare/profiler/association.rb @@ -0,0 +1,68 @@ +require_dependency "locmare/profiler/association/belongs_to" +require_dependency "locmare/profiler/association/has_many" +require_dependency "locmare/profiler/association/has_one" +module Locmare + module ProfilerModule + class Association + include AssociationModule + attr :profiler, :association_manifest, + :belongs_to, :has_many, :has_one + def initialize profiler, association_manifest + @profiler = profiler + @association_manifest = association_manifest + @belongs_to = @association_manifest.belongs_to.map {|belongs_to_manifest| + BelongsTo.new self, belongs_to_manifest + } + @has_many = @association_manifest.has_many.map {|list_name| + HasMany.new self, list_name + } + @has_one = @association_manifest.has_one.map {|list_name| + HasOne.new self, list_name + } + end + + def item + @profiler.item + end + + def model_manifest + ::Manifest.manifest.models[@profiler.item_name] + end + + def model_attribute_manifest + model_manifest.attributes[@column_name] + end + + def template_dir + @profiler.template_dir + end + + def template_file_name + "associations" + end + + def template_name + self.template_dir + self.template_file_name + end + + def each_belongs_to_filer + @belongs_to.each {|b| + yield b.filer + } + end + + def each_has_many_filer + @has_many.each {|h| + yield h.filer + } + end + + def each_has_one_filer + @has_one.each {|h| + yield h.filer + } + end + + end + end +end diff --git a/lib/locmare/profiler/association/belongs_to.rb b/lib/locmare/profiler/association/belongs_to.rb new file mode 100644 index 00000000..6dbc1d04 --- /dev/null +++ b/lib/locmare/profiler/association/belongs_to.rb @@ -0,0 +1,48 @@ +module Locmare + module ProfilerModule + module AssociationModule + class BelongsTo + attr :association, :belongs_to_manifest + def initialize association, belongs_to_manifest + @association = association + @belongs_to_manifest = belongs_to_manifest + end + + def item + self.profiler.item + end + + def parent_model + @belongs_to_manifest.model + end + + def parent_id + self.item.attributes[self.model_belongs_to_manifest.id_column] + end + + def filer + r = nil + begin + r = [self.parent_model.show(self.parent_id, self.profiler.operators)] + rescue ActiveRecord::RecordNotFound, ActiveRecord::Forbidden + r = [] + end + ::Locmare::Filer.new self.parent_model.item_name, r, nil, self.profiler.operators + end + + def model_manifest + ::Manifest.manifest.models[self.profiler.item_name] + end + + def model_belongs_to_manifest + self.model_manifest.associations.belongs_to[@belongs_to_manifest.model_name] + end + + def profiler + @association.profiler + end + + end + end + end +end diff --git a/lib/locmare/profiler/association/has_many.rb b/lib/locmare/profiler/association/has_many.rb new file mode 100644 index 00000000..27bd9ea8 --- /dev/null +++ b/lib/locmare/profiler/association/has_many.rb @@ -0,0 +1,32 @@ +module Locmare + module ProfilerModule + module AssociationModule + class HasMany + attr :association, :has_many_manifest + def initialize association, has_many_manifest + @association = association + @has_many_manifest = has_many_manifest + end + + def item + self.profiler.item + end + + def has_many_model + @has_many_manifest.model + end + + def filer + list_result = @has_many_manifest.list.open(self.profiler.operators, {:id => self.item.id, :page => 1, :page_size => 3}) + items = list_result.items + ::Locmare::Filer.new self.has_many_model.item_name, items, nil, self.profiler.operators + end + + def profiler + @association.profiler + end + + end + end + end +end diff --git a/lib/locmare/profiler/association/has_one.rb b/lib/locmare/profiler/association/has_one.rb new file mode 100644 index 00000000..9191174c --- /dev/null +++ b/lib/locmare/profiler/association/has_one.rb @@ -0,0 +1,32 @@ +module Locmare + module ProfilerModule + module AssociationModule + class HasOne + attr :association, :has_one_manifest + def initialize association, has_one_manifest + @association = association + @has_one_manifest = has_one_manifest + end + + def item + self.profiler.item + end + + def has_one_model + @has_one_manifest.model + end + + def filer + list_result = @has_one_manifest.list.open(self.profiler.operators, {:id => self.item.id}) + items = list_result.items + ::Locmare::Filer.new self.has_one_model.item_name, items, nil, self.profiler.operators + end + + def profiler + @association.profiler + end + + end + end + end +end diff --git a/lib/locmare/profiler/column.rb b/lib/locmare/profiler/column.rb new file mode 100644 index 00000000..8e33c127 --- /dev/null +++ b/lib/locmare/profiler/column.rb @@ -0,0 +1,116 @@ +module Locmare + module ProfilerModule + class Column + attr :profiler, :column_name + def initialize profiler, column_name + @profiler = profiler + @column_name = column_name + end + + def label + self.item.class.human_attribute_name(@column_name) + end + + def value + self.item.attributes[@column_name] + end + + def note + end + + def date? + case model_attribute_manifest.type + when 'datetime' + if self.value + true + else + false + end + else + false + end + end + + def note? + if self.model_attribute_source_manifest + case self.model_attribute_source_manifest.type + when 'magic_number' + true + when 'model' + false + else + false + end + else + false + end + end + + def select_item_name + self.model_attribute_source_manifest.select_item_name + end + + def item + @profiler.item + end + + def model_manifest + ::Manifest.manifest.models[@profiler.item_name] + end + + def model_attribute_manifest + self.model_manifest.attributes[@column_name] + end + + def model_attribute_source_manifest + self.model_attribute_manifest.source + end + + def template_dir + @profiler.template_dir + end + + def template_file_name + "column" + end + + def template_name + self.template_dir + self.template_file_name + end + + def value_template_dir + @profiler.template_dir + "column_value/" + end + + def value_template_file_name + if self.date? + 'date' + else + 'default' + end + end + + def value_template_name + self.value_template_dir + self.value_template_file_name + end + + def note_template_dir + @profiler.template_dir + "column_note/" + end + + def note_template_file_name + if self.note? + 'default' + else + 'none' + end + end + + def note_template_name + self.note_template_dir + self.note_template_file_name + end + + end + end +end + diff --git a/lib/locmare/profiler/header.rb b/lib/locmare/profiler/header.rb new file mode 100644 index 00000000..92d8c6df --- /dev/null +++ b/lib/locmare/profiler/header.rb @@ -0,0 +1,17 @@ +module Locmare + module ProfilerModule + class Header + attr :profiler + def initialize profiler + @profiler = profiler + end + + def filer + Locmare::Filer.new @profiler.item_name, [@profiler.item], nil, @profiler.operators + end + + end + + end +end + diff --git a/lib/manifest.rb b/lib/manifest.rb index 056e05d3..19820714 100644 --- a/lib/manifest.rb +++ b/lib/manifest.rb @@ -3,12 +3,7 @@ end require_dependency "manifest/manifest" require_dependency "manifest/controller" require_dependency "manifest/model" -require_dependency "manifest/profiler" -require_dependency "manifest/filer" -require_dependency "manifest/form" -require_dependency "manifest/list_group" require_dependency "manifest/system_resource" -require_dependency "manifest/local/view" Manifest::load JSON.parse(open(File.expand_path('../../public/manifest.json', __FILE__)).read) Manifest.manifest.init diff --git a/lib/manifest/local/view.rb b/lib/manifest/local/view.rb deleted file mode 100644 index 6b116d64..00000000 --- a/lib/manifest/local/view.rb +++ /dev/null @@ -1,10 +0,0 @@ -require_dependency "manifest/local/view/filer" -require_dependency "manifest/local/view/form" -require_dependency "manifest/local/view/profiler" -require_dependency "manifest/local/view/list_group" -module Manifest - module View - end - -end - diff --git a/lib/manifest/local/view/filer.rb b/lib/manifest/local/view/filer.rb deleted file mode 100644 index 50a44ab4..00000000 --- a/lib/manifest/local/view/filer.rb +++ /dev/null @@ -1,40 +0,0 @@ -require_dependency "manifest/local/view/filer/header" -require_dependency "manifest/local/view/filer/body" -require_dependency "manifest/local/view/filer/footer" -module Manifest - module View - class Filer - include FilerModule - attr :manifest, :item_name, :items, :paginate, :operators, :template_dir, - :header, :body, :footer - def initialize item_name, items, paginate, operators - @item_name = item_name - @items = items - @paginate = paginate - @operators = operators - @manifest = Manifest.manifest.filers[@item_name] - @template_dir = 'templates/r/filer/' - @header = Header.new self - @body = Body.new self - @footer = Footer.new self, paginate - end - - def model - ::Manifest::item_name_to_model @item_name - end - - def template_file_name - "filer" - end - - def template_name - self.template_dir + self.template_file_name - end - - def image_dir - '/images/' - end - - end - end -end diff --git a/lib/manifest/local/view/filer/body/file_body/file_item.rb b/lib/manifest/local/view/filer/body/file_body/file_item.rb deleted file mode 100644 index 24f9899b..00000000 --- a/lib/manifest/local/view/filer/body/file_body/file_item.rb +++ /dev/null @@ -1,65 +0,0 @@ -require_dependency "manifest/local/view/filer/body/file_body/file_item/symbol" -require_dependency "manifest/local/view/filer/body/file_body/file_item/caption" -require_dependency "manifest/local/view/filer/body/file_body/file_item/summary" -require_dependency "manifest/local/view/filer/body/file_body/file_item/icon" -require_dependency "manifest/local/view/filer/body/file_body/file_item/date" -require_dependency "manifest/local/view/filer/body/file_body/file_item/edit" -module Manifest - module View - module FilerModule - module BodyModule - module FileBodyModule - class FileItem - include FileItemModule - - attr :file_body, :item, - :symbol, :caption, :summary, :icon, :date, :edit - def initialize file_body, item - @file_body = file_body - @item = item - @symbol = SymbolItemColumnFactory.factory self, self.filer.manifest.symbol, @item - @caption = CaptionItemColumnFactory.factory self, self.filer.manifest.caption, @item - @summary = SummaryItemColumnFactory.factory self, self.filer.manifest.summary, @item - @icon = IconItemColumnFactory.factory self, self.filer.manifest.icon, @item - @date = DateItemColumnFactory.factory self, self.filer.manifest.date, @item - @edit = EditItemColumnFactory.factory self, self.filer.manifest.edit, @item - end - - def filer - @file_body.filer - end - - def manifest - self.filer.manifest - end - - def item_name - self.filer.item_name - end - - def model - self.filer.model - end - - def items - self.filer.items - end - - def template_dir - self.filer.template_dir - end - - def template_file_name - "file_item" - end - - def template_name - self.template_dir + self.template_file_name - end - - end - end - end - end - end -end diff --git a/lib/manifest/local/view/filer/body/file_body/file_item/caption.rb b/lib/manifest/local/view/filer/body/file_body/file_item/caption.rb deleted file mode 100644 index e1c342fc..00000000 --- a/lib/manifest/local/view/filer/body/file_body/file_item/caption.rb +++ /dev/null @@ -1,30 +0,0 @@ -require_dependency "manifest/local/view/filer/body/file_body/file_item/caption/base" -require_dependency "manifest/local/view/filer/body/file_body/file_item/caption/default" -require_dependency "manifest/local/view/filer/body/file_body/file_item/caption/template" -require_dependency "manifest/local/view/filer/body/file_body/file_item/caption/none" -module Manifest - module View - module FilerModule - module BodyModule - module FileBodyModule - module FileItemModule - class CaptionItemColumnFactory - include CaptionItemColumnModule - @@types = { - 'default' => Default, 'template' => Template, 'none' => None - } - def self.factory file_item, my_manifest, item - type = my_manifest.type - raise "undefined type for local view filers > #{file_item.item_name} > caption > default > face\n" unless type - my_class = @@types[type] - raise "undefined class for local view filers > #{file_item.item_name} > caption > default > face > #{type}\n" unless my_class - my_class.new(file_item, my_manifest, item) - end - - end - end - end - end - end - end -end diff --git a/lib/manifest/local/view/filer/body/file_body/file_item/caption/base.rb b/lib/manifest/local/view/filer/body/file_body/file_item/caption/base.rb deleted file mode 100644 index 7e3ce52f..00000000 --- a/lib/manifest/local/view/filer/body/file_body/file_item/caption/base.rb +++ /dev/null @@ -1,62 +0,0 @@ -module Manifest - module View - module FilerModule - module BodyModule - module FileBodyModule - module FileItemModule - module CaptionItemColumnModule - class Base - attr :file_item, :caption_manifest, :item, :column_name - - def initialize file_item, caption_manifest, item - @file_item = file_item - @caption_manifest = caption_manifest - @item = item - @column_name = 'caption' - end - - def filer - @file_item.filer - end - - def manifest - self.filer.manifest - end - - def item_name - self.filer.item_name - end - - def column_template_dir - self.filer.template_dir + 'item_column/' - end - - def column_template_file_name - raise "undefined column_template_file_name\n" - end - - def column_template_name - self.column_template_dir + self.column_template_file_name - end - - def item_template_dir - self.filer.template_dir + 'caption/' - end - - def item_template_file_name - raise "undefined item_template_file_name\n" - end - - def item_template_name - self.item_template_dir + self.item_template_file_name - end - - end - - end - end - end - end - end - end -end diff --git a/lib/manifest/local/view/filer/body/file_body/file_item/caption/default.rb b/lib/manifest/local/view/filer/body/file_body/file_item/caption/default.rb deleted file mode 100644 index dd663757..00000000 --- a/lib/manifest/local/view/filer/body/file_body/file_item/caption/default.rb +++ /dev/null @@ -1,39 +0,0 @@ -require_dependency "manifest/local/view/filer/body/file_body/file_item/caption/default/face" -require_dependency "manifest/local/view/filer/body/file_body/file_item/caption/default/link" -module Manifest - module View - module FilerModule - module BodyModule - module FileBodyModule - module FileItemModule - module CaptionItemColumnModule - class Default < Base - include DefaultModule - attr :face, :link - - def initialize file_item, caption_manifest, item - super - @face = FaceFactory.factory self, self.caption_manifest.face, @item - @link = LinkFactory.factory self, self.caption_manifest.link, @item - end - - def column_template_file_name - 'show' - end - - def item_template_file_name - if @caption_manifest.link.type == 'none' - 'default_without_link' - else - 'default' - end - end - - end - end - end - end - end - end - end -end diff --git a/lib/manifest/local/view/filer/body/file_body/file_item/caption/default/face.rb b/lib/manifest/local/view/filer/body/file_body/file_item/caption/default/face.rb deleted file mode 100644 index 8f8c4f9b..00000000 --- a/lib/manifest/local/view/filer/body/file_body/file_item/caption/default/face.rb +++ /dev/null @@ -1,31 +0,0 @@ -require_dependency "manifest/local/view/filer/body/file_body/file_item/caption/default/face/face" -module Manifest - module View - module FilerModule - module BodyModule - module FileBodyModule - module FileItemModule - module CaptionItemColumnModule - module DefaultModule - class FaceFactory - include FaceModule - @@types = { - 'column' => ColumnFace, 'method' => MethodFace, 'none' => NoneFace - } - def self.factory file_item, my_manifest, item - type = my_manifest.type - raise "undefined type for local view filers > #{file_item.item_name} > caption > face\n" unless type - my_class = @@types[type] - raise "undefined class for local view filers > #{file_item.item_name} > caption > face > #{type}\n" unless my_class - my_class.new(file_item, my_manifest, item) - end - - end - end - end - end - end - end - end - end -end diff --git a/lib/manifest/local/view/filer/body/file_body/file_item/caption/default/face/face.rb b/lib/manifest/local/view/filer/body/file_body/file_item/caption/default/face/face.rb deleted file mode 100644 index e2bf7e96..00000000 --- a/lib/manifest/local/view/filer/body/file_body/file_item/caption/default/face/face.rb +++ /dev/null @@ -1,89 +0,0 @@ -module Manifest - module View - module FilerModule - module BodyModule - module FileBodyModule - module FileItemModule - module CaptionItemColumnModule - module DefaultModule - module FaceModule - class BaseFace - attr :default_caption, :face_manifest, :item - def initialize default_caption, face_manifest, item - @default_caption = default_caption - @face_manifest = face_manifest - @item = item - end - - def filer - @default_caption.filer - end - - def manifest - self.filer.manifest - end - - def item_name - self.filer.item_name - end - - def template_dir - self.filer.template_dir + "caption_face/" - end - - def template_file_name - raise "undefined template_file_name\n" - end - - def template_name - self.template_dir + self.template_file_name - end - - end - - class ColumnFace < BaseFace - def template_file_name - if face.blank? - 'empty' - else - 'column' - end - end - - def face - @item.attributes[@face_manifest.column_name] - end - - end - - class MethodFace < BaseFace - def template_file_name - if face.blank? - 'empty' - else - 'column' - end - end - - def face - @item.__send__ @face_manifest.method_name - end - - end - - class NoneFace < BaseFace - def template_file_name - 'none' - end - - end - - end - end - end - end - end - end - end - end -end diff --git a/lib/manifest/local/view/filer/body/file_body/file_item/caption/default/link.rb b/lib/manifest/local/view/filer/body/file_body/file_item/caption/default/link.rb deleted file mode 100644 index 18780537..00000000 --- a/lib/manifest/local/view/filer/body/file_body/file_item/caption/default/link.rb +++ /dev/null @@ -1,31 +0,0 @@ -require_dependency "manifest/local/view/filer/body/file_body/file_item/caption/default/link/link" -module Manifest - module View - module FilerModule - module BodyModule - module FileBodyModule - module FileItemModule - module CaptionItemColumnModule - module DefaultModule - class LinkFactory - include LinkModule - @@types = { - 'action' => ActionLink, 'none' => NoneLink, 'url_column' => UrlColumnLink - } - def self.factory file_item, my_manifest, item - type = my_manifest.type - raise "undefined type for local view filers > #{file_item.item_name} > caption > link\n" unless type - my_class = @@types[type] - raise "undefined class for local view filers > #{file_item.item_name} > caption > link > #{type}\n" unless my_class - my_class.new(file_item, my_manifest, item) - end - - end - end - end - end - end - end - end - end -end diff --git a/lib/manifest/local/view/filer/body/file_body/file_item/caption/default/link/link.rb b/lib/manifest/local/view/filer/body/file_body/file_item/caption/default/link/link.rb deleted file mode 100644 index e42feb5b..00000000 --- a/lib/manifest/local/view/filer/body/file_body/file_item/caption/default/link/link.rb +++ /dev/null @@ -1,56 +0,0 @@ -module Manifest - module View - module FilerModule - module BodyModule - module FileBodyModule - module FileItemModule - module CaptionItemColumnModule - module DefaultModule - module LinkModule - class BaseLink - attr :default_caption, :link_manifest, :item - def initialize default_caption, link_manifest, item - @default_caption = default_caption - @link_manifest = link_manifest - @item = item - end - - def url - raise "undefined url\n" - end - - end - - class ActionLink < BaseLink - - def url - @link_manifest.action_path + @item.id.to_s - end - - end - - class NoneLink < BaseLink - - def url - nil - end - - end - - class UrlColumnLink < BaseLink - - def url - @item.attributes[@link_manifest.column_name] - end - - end - - end - end - end - end - end - end - end - end -end diff --git a/lib/manifest/local/view/filer/body/file_body/file_item/caption/none.rb b/lib/manifest/local/view/filer/body/file_body/file_item/caption/none.rb deleted file mode 100644 index d8a0dcd8..00000000 --- a/lib/manifest/local/view/filer/body/file_body/file_item/caption/none.rb +++ /dev/null @@ -1,21 +0,0 @@ -module Manifest - module View - module FilerModule - module BodyModule - module FileBodyModule - module FileItemModule - module CaptionItemColumnModule - class None < Base - - def column_template_file_name - 'none' - end - - end - end - end - end - end - end - end -end diff --git a/lib/manifest/local/view/filer/body/file_body/file_item/caption/template.rb b/lib/manifest/local/view/filer/body/file_body/file_item/caption/template.rb deleted file mode 100644 index e7b9ccbc..00000000 --- a/lib/manifest/local/view/filer/body/file_body/file_item/caption/template.rb +++ /dev/null @@ -1,20 +0,0 @@ -module Manifest - module View - module FilerModule - module BodyModule - module FileBodyModule - module FileItemModule - module CaptionItemColumnModule - class Template < Base - def template_file_name - @caption_manifest.template_name - end - - end - end - end - end - end - end - end -end diff --git a/lib/manifest/local/view/filer/body/file_body/file_item/date.rb b/lib/manifest/local/view/filer/body/file_body/file_item/date.rb deleted file mode 100644 index 5cda87a9..00000000 --- a/lib/manifest/local/view/filer/body/file_body/file_item/date.rb +++ /dev/null @@ -1,27 +0,0 @@ -require_dependency "manifest/local/view/filer/body/file_body/file_item/date/date" -module Manifest - module View - module FilerModule - module BodyModule - module FileBodyModule - module FileItemModule - class DateItemColumnFactory - include DateItemColumnModule - @@types = { - 'default' => Default, 'none' => None - } - def self.factory file_item, my_manifest, item - type = my_manifest.type - raise "undefined type for local view filers > #{file_item.item_name} > date\n" unless type - my_class = @@types[type] - raise "undefined class for local view filers > #{file_item.item_name} > date > #{type}\n" unless my_class - my_class.new(file_item, my_manifest, item) - end - - end - end - end - end - end - end -end diff --git a/lib/manifest/local/view/filer/body/file_body/file_item/date/date.rb b/lib/manifest/local/view/filer/body/file_body/file_item/date/date.rb deleted file mode 100644 index 176d9621..00000000 --- a/lib/manifest/local/view/filer/body/file_body/file_item/date/date.rb +++ /dev/null @@ -1,80 +0,0 @@ -module Manifest - module View - module FilerModule - module BodyModule - module FileBodyModule - module FileItemModule - module DateItemColumnModule - class Base - attr :file_item, :date_manifest, :item, :column_name - - def initialize file_item, date_manifest, item - @file_item = file_item - @date_manifest = date_manifest - @item = item - @column_name = 'date' - end - - def filer - @file_item.filer - end - - def manifest - self.filer.manifest - end - - def item_name - self.filer.item_name - end - - def column_template_dir - self.filer.template_dir + 'item_column/' - end - - def column_template_file_name - raise "undefined column_template_file_name\n" - end - - def column_template_name - self.column_template_dir + self.column_template_file_name - end - - def item_template_dir - self.filer.template_dir + 'date/' - end - - def item_template_file_name - raise "undefined item_template_file_name\n" - end - - def item_template_name - self.item_template_dir + self.item_template_file_name - end - - end - - class Default < Base - def column_template_file_name - 'show' - end - - def item_template_file_name - 'default' - end - - end - - class None < Base - def column_template_file_name - 'none' - end - - end - - end - end - end - end - end - end -end diff --git a/lib/manifest/local/view/filer/body/file_body/file_item/edit.rb b/lib/manifest/local/view/filer/body/file_body/file_item/edit.rb deleted file mode 100644 index 6dc62e0c..00000000 --- a/lib/manifest/local/view/filer/body/file_body/file_item/edit.rb +++ /dev/null @@ -1,27 +0,0 @@ -require_dependency "manifest/local/view/filer/body/file_body/file_item/edit/edit" -module Manifest - module View - module FilerModule - module BodyModule - module FileBodyModule - module FileItemModule - class EditItemColumnFactory - include EditItemColumnModule - @@types = { - 'default' => Default, 'none' => None, 'account' => Account, 'template' => Template - } - def self.factory file_item, my_manifest, item - type = my_manifest.type - raise "undefined type for local view filers > #{file_item.item_name} > edit\n" unless type - my_class = @@types[type] - raise "undefined class for local view filers > #{file_item.item_name} > edit > #{type}\n" unless my_class - my_class.new(file_item, my_manifest, item) - end - - end - end - end - end - end - end -end diff --git a/lib/manifest/local/view/filer/body/file_body/file_item/edit/edit.rb b/lib/manifest/local/view/filer/body/file_body/file_item/edit/edit.rb deleted file mode 100644 index 86419c03..00000000 --- a/lib/manifest/local/view/filer/body/file_body/file_item/edit/edit.rb +++ /dev/null @@ -1,160 +0,0 @@ -module Manifest - module View - module FilerModule - module BodyModule - module FileBodyModule - module FileItemModule - module EditItemColumnModule - class Base - attr :file_item, :edit_manifest, :item, :column_name - - def initialize file_item, edit_manifest, item - @file_item = file_item - @edit_manifest = edit_manifest - @item = item - @column_name = 'edit' - end - - def filer - @file_item.filer - end - - def manifest - self.filer.manifest - end - - def item_name - self.filer.item_name - end - - def image_dir - self.filer.image_dir - end - - def column_template_dir - self.filer.template_dir + 'item_column/' - end - - def column_template_file_name - raise "undefined column_template_file_name\n" - end - - def column_template_name - self.column_template_dir + self.column_template_file_name - end - - def item_template_dir - self.filer.template_dir + 'edit/' - end - - def item_template_file_name - raise "undefined item_template_file_name\n" - end - - def item_template_name - self.item_template_dir + self.item_template_file_name - end - - end - - class Default < Base - def column_template_file_name - 'show' - end - - def item_template_file_name - if @item.own? self.filer.operators - 'default' - else - 'none' - end - end - - def edit_img_file_name - self.image_dir + 'edit.png' - end - - def remove_img_file_name - self.image_dir + 'remove.png' - end - - def img_opt - {:width => Manifest.manifest.magic_numbers['thumbnail_width'] / 2, - :height => Manifest.manifest.magic_numbers['thumbnail_height'] / 2} - end - - def edit_img_opt - img_opt.merge :src => self.edit_img_file_name - end - - def remove_img_opt - img_opt.merge :src => self.remove_img_file_name - end - - end - - class None < Base - def column_template_file_name - 'none' - end - - end - - class Account < Base - def column_template_file_name - 'show' - end - - def item_template_file_name - if @item.own? self.filer.operators - 'account' - else - 'none' - end - end - - def edit_img_file_name - self.image_dir + 'edit.png' - end - - def img_opt - {:width => Manifest.manifest.magic_numbers['thumbnail_width'] / 2, - :height => Manifest.manifest.magic_numbers['thumbnail_height'] / 2} - end - - def edit_img_opt - img_opt.merge :src => self.edit_img_file_name - end - - end - - class Template < Base - def column_template_file_name - 'show' - end - - def item_template_file_name - 'template' - end - - def template_dir - @item.path_name + '/' - end - - def template_file_name - @edit_manifest.template_name - end - - def template_name - self.template_dir + self.template_file_name - end - - end - - end - end - end - end - end - end -end diff --git a/lib/manifest/local/view/filer/body/file_body/file_item/icon.rb b/lib/manifest/local/view/filer/body/file_body/file_item/icon.rb deleted file mode 100644 index be392b70..00000000 --- a/lib/manifest/local/view/filer/body/file_body/file_item/icon.rb +++ /dev/null @@ -1,27 +0,0 @@ -require_dependency "manifest/local/view/filer/body/file_body/file_item/icon/icon" -module Manifest - module View - module FilerModule - module BodyModule - module FileBodyModule - module FileItemModule - class IconItemColumnFactory - include IconItemColumnModule - @@types = { - 'default' => Default, 'none' => None - } - def self.factory file_item, my_manifest, item - type = my_manifest.type - raise "undefined type for local view filers > #{file_item.item_name} > icon\n" unless type - my_class = @@types[type] - raise "undefined class for local view filers > #{file_item.item_name} > icon > #{type}\n" unless my_class - my_class.new(file_item, my_manifest, item) - end - - end - end - end - end - end - end -end diff --git a/lib/manifest/local/view/filer/body/file_body/file_item/icon/icon.rb b/lib/manifest/local/view/filer/body/file_body/file_item/icon/icon.rb deleted file mode 100644 index 31db72b5..00000000 --- a/lib/manifest/local/view/filer/body/file_body/file_item/icon/icon.rb +++ /dev/null @@ -1,88 +0,0 @@ -module Manifest - module View - module FilerModule - module BodyModule - module FileBodyModule - module FileItemModule - module IconItemColumnModule - class Base - attr :file_item, :icon_manifest, :item, :column_name - - def initialize file_item, icon_manifest, item - @file_item = file_item - @icon_manifest = icon_manifest - @item = item - @column_name = 'icon' - end - - def filer - @file_item.filer - end - - def manifest - self.filer.manifest - end - - def item_name - self.filer.item_name - end - - def column_template_dir - self.filer.template_dir + 'item_column/' - end - - def column_template_file_name - raise "undefined column_template_file_name\n" - end - - def column_template_name - self.column_template_dir + self.column_template_file_name - end - - def item_template_dir - self.filer.template_dir + 'icon/' - end - - def item_template_file_name - raise "undefined item_template_file_name\n" - end - - def item_template_name - self.item_template_dir + self.item_template_file_name - end - - end - - class Default < Base - def column_template_file_name - 'show' - end - - def item_template_file_name - 'default' - end - - def icon_file_name - '/images/prof.png' - end - - def icon_size - Manifest.manifest.magic_numbers['thumbnail_width'] - end - - end - - class None < Base - def column_template_file_name - 'none' - end - - end - - end - end - end - end - end - end -end diff --git a/lib/manifest/local/view/filer/body/file_body/file_item/summary.rb b/lib/manifest/local/view/filer/body/file_body/file_item/summary.rb deleted file mode 100644 index 3dd2cfa1..00000000 --- a/lib/manifest/local/view/filer/body/file_body/file_item/summary.rb +++ /dev/null @@ -1,27 +0,0 @@ -require_dependency "manifest/local/view/filer/body/file_body/file_item/summary/summary" -module Manifest - module View - module FilerModule - module BodyModule - module FileBodyModule - module FileItemModule - class SummaryItemColumnFactory - include SummaryItemColumnModule - @@types = { - 'none' => None, 'template' => Template - } - def self.factory file_item, my_manifest, item - type = my_manifest.type - raise "undefined type for local view filers > #{file_item.item_name} > summary\n" unless type - my_class = @@types[type] - raise "undefined class for local view filers > #{file_item.item_name} > summary > #{type}\n" unless my_class - my_class.new(file_item, my_manifest, item) - end - - end - end - end - end - end - end -end diff --git a/lib/manifest/local/view/filer/body/file_body/file_item/summary/summary.rb b/lib/manifest/local/view/filer/body/file_body/file_item/summary/summary.rb deleted file mode 100644 index eab6c6f6..00000000 --- a/lib/manifest/local/view/filer/body/file_body/file_item/summary/summary.rb +++ /dev/null @@ -1,91 +0,0 @@ -module Manifest - module View - module FilerModule - module BodyModule - module FileBodyModule - module FileItemModule - module SummaryItemColumnModule - class Base - attr :file_item, :summary_manifest, :item, :column_name - - def initialize file_item, summary_manifest, item - @file_item = file_item - @summary_manifest = summary_manifest - @item = item - @column_name = 'summary' - end - - def filer - @file_item.filer - end - - def manifest - self.filer.manifest - end - - def item_name - self.filer.item_name - end - - def column_template_dir - self.filer.template_dir + 'item_column/' - end - - def column_template_file_name - raise "undefined column_template_file_name\n" - end - - def column_template_name - self.column_template_dir + self.column_template_file_name - end - - def item_template_dir - self.filer.template_dir + 'summary/' - end - - def item_template_file_name - raise "undefined item_template_file_name\n" - end - - def item_template_name - self.item_template_dir + self.item_template_file_name - end - - end - - class None < Base - def column_template_file_name - "none" - end - - end - - class Template < Base - def column_template_file_name - 'show' - end - - def item_template_file_name - 'template' - end - - def template_dir - @item.path_name + '/' - end - - def template_file_name - @summary_manifest.template_name - end - - def template_name - self.template_dir + self.template_file_name - end - - end - end - end - end - end - end - end -end diff --git a/lib/manifest/local/view/filer/body/file_body/file_item/symbol.rb b/lib/manifest/local/view/filer/body/file_body/file_item/symbol.rb deleted file mode 100644 index b515b3c2..00000000 --- a/lib/manifest/local/view/filer/body/file_body/file_item/symbol.rb +++ /dev/null @@ -1,29 +0,0 @@ -require_dependency "manifest/local/view/filer/body/file_body/file_item/symbol/base" -require_dependency "manifest/local/view/filer/body/file_body/file_item/symbol/default" -require_dependency "manifest/local/view/filer/body/file_body/file_item/symbol/template" -module Manifest - module View - module FilerModule - module BodyModule - module FileBodyModule - module FileItemModule - class SymbolItemColumnFactory - include SymbolItemColumnModule - @@types = { - 'default' => Default, 'template' => Template - } - def self.factory file_item, my_manifest, item - type = my_manifest.type - raise "undefined type for local view filers > #{file_item.item_name} > symbol\n" unless type - my_class = @@types[type] - raise "undefined class for local view filers > #{file_item.item_name} > symbol > #{type}\n" unless my_class - my_class.new(file_item, my_manifest, item) - end - - end - end - end - end - end - end -end diff --git a/lib/manifest/local/view/filer/body/file_body/file_item/symbol/base.rb b/lib/manifest/local/view/filer/body/file_body/file_item/symbol/base.rb deleted file mode 100644 index f4e76177..00000000 --- a/lib/manifest/local/view/filer/body/file_body/file_item/symbol/base.rb +++ /dev/null @@ -1,62 +0,0 @@ -module Manifest - module View - module FilerModule - module BodyModule - module FileBodyModule - module FileItemModule - module SymbolItemColumnModule - class Base - attr :file_item, :symbol_manifest, :item, :column_name - - def initialize file_item, symbol_manifest, item - @file_item = file_item - @symbol_manifest = symbol_manifest - @item = item - @column_name = 'symbol' - end - - def filer - @file_item.filer - end - - def manifest - self.filer.manifest - end - - def item_name - self.filer.item_name - end - - def column_template_dir - self.filer.template_dir + 'item_column/' - end - - def column_template_file_name - raise "undefined column_template_file_name\n" - end - - def column_template_name - self.column_template_dir + self.column_template_file_name - end - - def item_template_dir - self.filer.template_dir + 'symbol/' - end - - def item_template_file_name - raise "undefined item_template_file_name\n" - end - - def item_template_name - self.item_template_dir + self.item_template_file_name - end - - end - - end - end - end - end - end - end -end diff --git a/lib/manifest/local/view/filer/body/file_body/file_item/symbol/default.rb b/lib/manifest/local/view/filer/body/file_body/file_item/symbol/default.rb deleted file mode 100644 index 1b28350f..00000000 --- a/lib/manifest/local/view/filer/body/file_body/file_item/symbol/default.rb +++ /dev/null @@ -1,39 +0,0 @@ -require_dependency "manifest/local/view/filer/body/file_body/file_item/symbol/default/face" -require_dependency "manifest/local/view/filer/body/file_body/file_item/symbol/default/link" -module Manifest - module View - module FilerModule - module BodyModule - module FileBodyModule - module FileItemModule - module SymbolItemColumnModule - class Default < Base - include DefaultModule - attr :face, :link - - def initialize file_item, symbol_manifest, item - super - @face = FaceFactory.factory self, self.symbol_manifest.face, @item - @link = LinkFactory.factory self, self.symbol_manifest.link, @item - end - - def column_template_file_name - 'show' - end - - def item_template_file_name - if @symbol_manifest.link.type == 'none' - 'default_without_link' - else - 'default' - end - end - - end - end - end - end - end - end - end -end diff --git a/lib/manifest/local/view/filer/body/file_body/file_item/symbol/default/face.rb b/lib/manifest/local/view/filer/body/file_body/file_item/symbol/default/face.rb deleted file mode 100644 index 4cab5293..00000000 --- a/lib/manifest/local/view/filer/body/file_body/file_item/symbol/default/face.rb +++ /dev/null @@ -1,31 +0,0 @@ -require_dependency "manifest/local/view/filer/body/file_body/file_item/symbol/default/face/face" -module Manifest - module View - module FilerModule - module BodyModule - module FileBodyModule - module FileItemModule - module SymbolItemColumnModule - module DefaultModule - class FaceFactory - include FaceModule - @@types = { - 'image' => ImageFace, 'picture' => PictureFace - } - def self.factory file_item, my_manifest, item - type = my_manifest.type - raise "undefined type for local view filers > #{file_item.item_name} > symbol > face\n" unless type - my_class = @@types[type] - raise "undefined class for local view filers > #{file_item.item_name} > symbol > face > #{type}\n" unless my_class - my_class.new(file_item, my_manifest, item) - end - - end - end - end - end - end - end - end - end -end diff --git a/lib/manifest/local/view/filer/body/file_body/file_item/symbol/default/face/face.rb b/lib/manifest/local/view/filer/body/file_body/file_item/symbol/default/face/face.rb deleted file mode 100644 index 1d20a45d..00000000 --- a/lib/manifest/local/view/filer/body/file_body/file_item/symbol/default/face/face.rb +++ /dev/null @@ -1,86 +0,0 @@ -module Manifest - module View - module FilerModule - module BodyModule - module FileBodyModule - module FileItemModule - module SymbolItemColumnModule - module DefaultModule - module FaceModule - class BaseFace - attr :default_symbol, :face_manifest, :item - def initialize default_symbol, face_manifest, item - @default_symbol = default_symbol - @face_manifest = face_manifest - @item = item - end - - def filer - @default_symbol.filer - end - - def manifest - self.filer.manifest - end - - def item_name - self.filer.item_name - end - - def template_dir - self.filer.template_dir + "symbol_face/" - end - - def template_file_name - raise "undefined template_file_name\n" - end - - def template_name - self.template_dir + self.template_file_name - end - - end - - class ImageFace < BaseFace - def template_file_name - 'image' - end - - def url - @face_manifest.url - end - - def tag_opt - {:src => self.url, :width => Manifest.manifest.magic_numbers['thumbnail_width'], :height => Manifest.manifest.magic_numbers['thumbnail_height']} - end - - end - - class PictureFace < BaseFace - def template_file_name - 'picture' - end - - def method_name - @face_manifest.method_name - end - - def tag_opt - if @item.methods(true).include?(self.method_name.to_sym) - @item.__send__ self.method_name - else - {:src => '/images/error.png', :width => Manifest.manifest.magic_numbers['thumbnail_width'], :height => Manifest.manifest.magic_numbers['thumbnail_height']} - end - end - - end - - end - end - end - end - end - end - end - end -end diff --git a/lib/manifest/local/view/filer/body/file_body/file_item/symbol/default/link.rb b/lib/manifest/local/view/filer/body/file_body/file_item/symbol/default/link.rb deleted file mode 100644 index ce392044..00000000 --- a/lib/manifest/local/view/filer/body/file_body/file_item/symbol/default/link.rb +++ /dev/null @@ -1,31 +0,0 @@ -require_dependency "manifest/local/view/filer/body/file_body/file_item/symbol/default/link/link" -module Manifest - module View - module FilerModule - module BodyModule - module FileBodyModule - module FileItemModule - module SymbolItemColumnModule - module DefaultModule - class LinkFactory - include LinkModule - @@types = { - 'action' => ActionLink, 'none' => NoneLink, 'url_column' => UrlColumnLink - } - def self.factory file_item, my_manifest, item - type = my_manifest.type - raise "undefined type for local view filers > #{file_item.item_name} > symbol > link\n" unless type - my_class = @@types[type] - raise "undefined class for local view filers > #{file_item.item_name} > symbol > link > #{type}\n" unless my_class - my_class.new(file_item, my_manifest, item) - end - - end - end - end - end - end - end - end - end -end diff --git a/lib/manifest/local/view/filer/body/file_body/file_item/symbol/default/link/link.rb b/lib/manifest/local/view/filer/body/file_body/file_item/symbol/default/link/link.rb deleted file mode 100644 index ab0e4599..00000000 --- a/lib/manifest/local/view/filer/body/file_body/file_item/symbol/default/link/link.rb +++ /dev/null @@ -1,55 +0,0 @@ -module Manifest - module View - module FilerModule - module BodyModule - module FileBodyModule - module FileItemModule - module SymbolItemColumnModule - module DefaultModule - module LinkModule - class BaseLink - attr :default_symbol, :link_manifest, :item - def initialize default_symbol, link_manifest, item - @default_symbol = default_symbol - @link_manifest = link_manifest - @item = item - end - - def url - raise "undefined url\n" - end - - end - - class ActionLink < BaseLink - - def url - @link_manifest.action_path + @item.id.to_s - end - end - - class NoneLink < BaseLink - - def url - nil - end - - end - - class UrlColumnLink < BaseLink - - def url - @item.attributes[@link_manifest.column_name] - end - - end - - end - end - end - end - end - end - end - end -end diff --git a/lib/manifest/local/view/filer/body/file_body/file_item/symbol/template.rb b/lib/manifest/local/view/filer/body/file_body/file_item/symbol/template.rb deleted file mode 100644 index fa974f86..00000000 --- a/lib/manifest/local/view/filer/body/file_body/file_item/symbol/template.rb +++ /dev/null @@ -1,36 +0,0 @@ -module Manifest - module View - module FilerModule - module BodyModule - module FileBodyModule - module FileItemModule - module SymbolItemColumnModule - class Template < Base - def column_template_file_name - 'show' - end - - def item_template_file_name - 'template' - end - - def template_dir - @item.path_name + '/' - end - - def template_file_name - @symbol_manifest.template_name - end - - def template_name - self.template_dir + self.template_file_name - end - - end - end - end - end - end - end - end -end diff --git a/lib/manifest/local/view/filer/body/file_header.rb b/lib/manifest/local/view/filer/body/file_header.rb deleted file mode 100644 index 8f267990..00000000 --- a/lib/manifest/local/view/filer/body/file_header.rb +++ /dev/null @@ -1,65 +0,0 @@ -require_dependency "manifest/local/view/filer/body/file_header/base" -require_dependency "manifest/local/view/filer/body/file_header/show" -require_dependency "manifest/local/view/filer/body/file_header/none" -module Manifest - module View - module FilerModule - module BodyModule - class FileHeader - include FileHeaderModule - - attr :body, - :symbol, :caption, :summary, :icon, :date, :edit - def initialize body - @body = body - c = self.filer.manifest.symbol.visible? ? Show : None - @symbol = c.new self, 'symbol' - c = self.filer.manifest.caption.visible? ? Show : None - @caption = c.new self, 'caption' - c = self.filer.manifest.summary.visible? ? Show : None - @summary = c.new self, 'summary' - c = self.filer.manifest.icon.visible? ? Show : None - @icon = c.new self, 'icon' - c = self.filer.manifest.date.visible? ? Show : None - @date = c.new self, 'date' - c = self.filer.manifest.edit.visible? ? Show : None - @edit = c.new self, 'edit' - end - - def filer - @body.filer - end - - def manifest - self.filer.manifest - end - - def item_name - self.filer.item_name - end - - def model - self.filer.model - end - - def items - self.filer.items - end - - def template_dir - @body.template_dir - end - - def template_file_name - "file_header" - end - - def template_name - self.template_dir + self.template_file_name - end - - end - end - end - end -end diff --git a/lib/manifest/local/view/filer/body/file_header/base.rb b/lib/manifest/local/view/filer/body/file_header/base.rb deleted file mode 100644 index cfe363e1..00000000 --- a/lib/manifest/local/view/filer/body/file_header/base.rb +++ /dev/null @@ -1,50 +0,0 @@ -module Manifest - module View - module FilerModule - module BodyModule - module FileHeaderModule - class Base - attr :file_header, :column_name - def initialize file_header, column_name - @file_header = file_header - @column_name = column_name - end - - def filer - @file_header.filer - end - - def manifest - self.filer.manifest - end - - def item_name - self.filer.item_name - end - - def model - self.filer.model - end - - def items - self.filer.items - end - - def template_dir - self.filer.template_dir + 'header_column/' - end - - def template_file_name - "show" - end - - def template_name - self.template_dir + self.template_file_name - end - - end - end - end - end - end -end diff --git a/lib/manifest/local/view/filer/body/file_header/none.rb b/lib/manifest/local/view/filer/body/file_header/none.rb deleted file mode 100644 index d1bf4b93..00000000 --- a/lib/manifest/local/view/filer/body/file_header/none.rb +++ /dev/null @@ -1,15 +0,0 @@ -module Manifest - module View - module FilerModule - module BodyModule - module FileHeaderModule - class None < Base - def template_file_name - "none" - end - end - end - end - end - end -end diff --git a/lib/manifest/local/view/filer/body/file_header/show.rb b/lib/manifest/local/view/filer/body/file_header/show.rb deleted file mode 100644 index 3f69cd8c..00000000 --- a/lib/manifest/local/view/filer/body/file_header/show.rb +++ /dev/null @@ -1,15 +0,0 @@ -module Manifest - module View - module FilerModule - module BodyModule - module FileHeaderModule - class Show < Base - def template_file_name - "show" - end - end - end - end - end - end -end diff --git a/lib/manifest/local/view/filer/footer.rb b/lib/manifest/local/view/filer/footer.rb deleted file mode 100644 index 12203764..00000000 --- a/lib/manifest/local/view/filer/footer.rb +++ /dev/null @@ -1,26 +0,0 @@ -module Manifest - module View - module FilerModule - class Footer - attr :filer, :paginate - def initialize filer, paginate - @filer = filer - @paginate = paginate - end - - def template_dir - @filer.template_dir - end - - def template_file_name - "footer" - end - - def template_name - self.template_dir + self.template_file_name - end - - end - end - end -end diff --git a/lib/manifest/local/view/filer/header.rb b/lib/manifest/local/view/filer/header.rb deleted file mode 100644 index 381eed59..00000000 --- a/lib/manifest/local/view/filer/header.rb +++ /dev/null @@ -1,41 +0,0 @@ -module Manifest - module View - module FilerModule - class Header - attr :filer - def initialize filer - @filer = filer - end - - def model - @filer.model - end - - def icon_name - self.model.singular - end - - def icon_size - Manifest.manifest.magic_numbers['thumbnail_width'] / 2 - end - - def human_name - self.model.model_name.human - end - - def template_dir - @filer.template_dir - end - - def template_file_name - "header" - end - - def template_name - self.template_dir + self.template_file_name - end - - end - end - end -end diff --git a/lib/manifest/local/view/form.rb b/lib/manifest/local/view/form.rb deleted file mode 100644 index ffa85818..00000000 --- a/lib/manifest/local/view/form.rb +++ /dev/null @@ -1,67 +0,0 @@ -require_dependency "manifest/local/view/form/field" -module Manifest - module View - class Form - include FormModule - attr :form_name, :item, :mounted, :submit, :operators, :template_dir, - :fields - def initialize form_name, item, mounted, submit, operators - @form_name = form_name - @item = item - @mounted = mounted - @submit = submit - @operators = operators - @manifest = Manifest.manifest.forms[@form_name] - @template_dir = 'templates/r/form/' - @fields = {} - @manifest.each_field do |field_name, field_manifest| - @fields[field_name] = Field.new self, field_name, field_manifest - end - end - - def each_field - @manifest.each_field do |field_name, field_manifest| - yield field_name, @fields[field_name] - end - end - - def template_file_name - "form" - end - - def template_name - self.template_dir + self.template_file_name - end - - def submit_name - if @item.new_record? - @item.table_name + '.submit.new' - else - @item.table_name + '.submit.edit' - end - end - - def submit_template_dir - self.template_dir + 'submit/' - end - - def submit_template_name - if @submit - self.submit_template_dir + 'submit' - else - self.submit_template_dir + 'none' - end - end - - def fields_template_name - self.template_dir + 'fields' - end - - def image_dir - '/images/' - end - - end - end - -end diff --git a/lib/manifest/local/view/form/field.rb b/lib/manifest/local/view/form/field.rb deleted file mode 100644 index 753b7a0b..00000000 --- a/lib/manifest/local/view/form/field.rb +++ /dev/null @@ -1,83 +0,0 @@ -require_dependency "manifest/local/view/form/field/label" -require_dependency "manifest/local/view/form/field/tag" -require_dependency "manifest/local/view/form/field/helper" -module Manifest - module View - module FormModule - class Field - include FieldModule - attr :form, :field_name, :field_manifest, - :label, :tag, :helpers, :options - def initialize form, field_name, field_manifest - @form = form - @field_name = field_name - @field_manifest = field_manifest - @label = LabelFactory.factory self, @field_manifest.label - @tag = TagFactory.factory self, @field_manifest.tag - @helpers = {} - @field_manifest.helpers.each {|helper_name, helper_manifest| - @helpers[helper_name] = HelperFactory.factory self, helper_manifest - } - @options = {'data-model' => @field_manifest.model_name} - end - - def mounted - @form.mounted ? 0 : 1 - end - - def mount_option - {'mount' => self.mounted} - end - - def item - @form.item - end - - def value - self.item.attributes[@field_manifest.column_name] - end - - def options tag_options = {} - self.item.field_tag_attributes(@field_manifest.column_name, tag_options).merge(self.mount_option) - end - - def form_field_name - @field_manifest.form_field_name - end - - def form_name - @form.form_name - end - - def template_dir - @form.template_dir + 'field/' - end - - def template_file_name - @field_manifest.type - end - - def template_name - self.template_dir + self.template_file_name - end - - def row_break_template_dir - @form.template_dir + 'row_break/' - end - - def row_break_template_file_name - if @field_manifest.row_break - 'br' - else - 'no_break' - end - end - - def row_break_template_name - self.row_break_template_dir + self.row_break_template_file_name - end - - end - end - end -end diff --git a/lib/manifest/local/view/form/field/helper.rb b/lib/manifest/local/view/form/field/helper.rb deleted file mode 100644 index bc3210f6..00000000 --- a/lib/manifest/local/view/form/field/helper.rb +++ /dev/null @@ -1,28 +0,0 @@ -require_dependency "manifest/local/view/form/field/helper/base" -require_dependency "manifest/local/view/form/field/helper/size" -require_dependency "manifest/local/view/form/field/helper/tail_angle" -require_dependency "manifest/local/view/form/field/helper/color" -require_dependency "manifest/local/view/form/field/helper/popup" -module Manifest - module View - module FormModule - module FieldModule - class HelperFactory - include HelperModule - @@types = { - 'size' => Size, 'tail_angle' => TailAngle, 'color' => Color, - 'popup' => Popup - } - def self.factory field, my_manifest - type = my_manifest.type - my_class = @@types[type] - raise "undefined class for local view forms > #{field.form_name} > fields > #{field.field_name} > helper > #{type}\n" unless my_class - my_class.new(field, my_manifest) - end - - end - - end - end - end -end diff --git a/lib/manifest/local/view/form/field/helper/base.rb b/lib/manifest/local/view/form/field/helper/base.rb deleted file mode 100644 index a2f628a9..00000000 --- a/lib/manifest/local/view/form/field/helper/base.rb +++ /dev/null @@ -1,52 +0,0 @@ -module Manifest - module View - module FormModule - module FieldModule - module HelperModule - class Base - attr :field, :helper_manifest - - def initialize field, helper_manifest - @field = field - @helper_manifest = helper_manifest - end - - def type - @helper_manifest.type - end - - def path - @helper_manifest.path - end - - def form - @field.form - end - - def template_dir - self.form.template_dir + 'helper/' - end - - def template_file_name - @helper_manifest.file_name - end - - def template_name - self.template_dir + self.template_file_name - end - - def form_name - @field.form_name - end - - def field_name - @field.field_name - end - - end - - end - end - end - end -end diff --git a/lib/manifest/local/view/form/field/helper/color.rb b/lib/manifest/local/view/form/field/helper/color.rb deleted file mode 100644 index 66e66d83..00000000 --- a/lib/manifest/local/view/form/field/helper/color.rb +++ /dev/null @@ -1,17 +0,0 @@ -module Manifest - module View - module FormModule - module FieldModule - module HelperModule - class Color < Base - def wrapper - @helper_manifest.wrapper - end - - end - - end - end - end - end -end diff --git a/lib/manifest/local/view/form/field/helper/popup.rb b/lib/manifest/local/view/form/field/helper/popup.rb deleted file mode 100644 index a525c231..00000000 --- a/lib/manifest/local/view/form/field/helper/popup.rb +++ /dev/null @@ -1,15 +0,0 @@ -module Manifest - module View - module FormModule - module FieldModule - module HelperModule - class Popup < Base - attr :source - - end - - end - end - end - end -end diff --git a/lib/manifest/local/view/form/field/helper/size.rb b/lib/manifest/local/view/form/field/helper/size.rb deleted file mode 100644 index dc9127a3..00000000 --- a/lib/manifest/local/view/form/field/helper/size.rb +++ /dev/null @@ -1,18 +0,0 @@ -module Manifest - module View - module FormModule - module FieldModule - module HelperModule - class Size < Base - - def dom_class - @helper_manifest.dom_class - end - - end - - end - end - end - end -end diff --git a/lib/manifest/local/view/form/field/helper/tail_angle.rb b/lib/manifest/local/view/form/field/helper/tail_angle.rb deleted file mode 100644 index b271692e..00000000 --- a/lib/manifest/local/view/form/field/helper/tail_angle.rb +++ /dev/null @@ -1,14 +0,0 @@ -module Manifest - module View - module FormModule - module FieldModule - module HelperModule - class TailAngle < Base - - end - - end - end - end - end -end diff --git a/lib/manifest/local/view/form/field/label.rb b/lib/manifest/local/view/form/field/label.rb deleted file mode 100644 index eb80b1df..00000000 --- a/lib/manifest/local/view/form/field/label.rb +++ /dev/null @@ -1,23 +0,0 @@ -require_dependency "manifest/local/view/form/field/label/label" -module Manifest - module View - module FormModule - module FieldModule - class LabelFactory - include LabelModule - @@types = { - 'default' => Default, 'none' => None - } - def self.factory field, my_manifest - type = my_manifest.type - my_class = @@types[type] - raise "undefined class for local view forms > #{field.form_name} > fields > #{field.field_name} > label > #{type}\n" unless my_class - my_class.new(field, my_manifest) - end - - end - - end - end - end -end diff --git a/lib/manifest/local/view/form/field/label/label.rb b/lib/manifest/local/view/form/field/label/label.rb deleted file mode 100644 index d7b776b8..00000000 --- a/lib/manifest/local/view/form/field/label/label.rb +++ /dev/null @@ -1,94 +0,0 @@ -module Manifest - module View - module FormModule - module FieldModule - module LabelModule - class Base - attr :field, :label_manifest - - def initialize field, label_manifest - @field = field - @label_manifest = label_manifest - end - - def form - @field.form - end - - def manifest - self.form.manifest - end - - def form_name - self.form.form_name - end - - def model - self.form.model - end - - def item - self.form.item - end - - def model_name - @label_manifest.model_name - end - - def column_name - @label_manifest.column_name - end - - def template_dir - self.form.template_dir + 'label/' - end - - def template_file_name - raise "undefined template_file_name\n" - end - - def template_name - self.template_dir + self.template_file_name - end - - def label_row_break_template_dir - self.form.template_dir + 'label_row_break/' - end - - def label_row_break_template_file_name - if @label_manifest.row_break - 'br' - else - 'no_break' - end - end - - def label_row_break_template_name - self.label_row_break_template_dir + self.label_row_break_template_file_name - end - - end - - class Default < Base - def template_file_name - 'default' - end - - def label_name - 'activerecord.attributes.' + self.model_name + '.' + self.column_name - end - - end - - class None < Base - def template_file_name - 'none' - end - - end - - end - end - end - end -end diff --git a/lib/manifest/local/view/form/field/tag.rb b/lib/manifest/local/view/form/field/tag.rb deleted file mode 100644 index 48c15393..00000000 --- a/lib/manifest/local/view/form/field/tag.rb +++ /dev/null @@ -1,29 +0,0 @@ -require_dependency "manifest/local/view/form/field/tag/base" -require_dependency "manifest/local/view/form/field/tag/text" -require_dependency "manifest/local/view/form/field/tag/number" -require_dependency "manifest/local/view/form/field/tag/text_area" -require_dependency "manifest/local/view/form/field/tag/select" -require_dependency "manifest/local/view/form/field/tag/hidden" -module Manifest - module View - module FormModule - module FieldModule - class TagFactory - include TagModule - @@types = { - 'text' => TextTag, 'number' => NumberTag, 'text_area' => TextAreaTag, - 'select' => SelectTag, 'hidden' => HiddenTag - } - def self.factory field, my_manifest - type = my_manifest.type - my_class = @@types[type] - raise "undefined class for local view forms > #{field.form_name} > fields > #{field.field_name} > tag > #{type}\n" unless my_class - my_class.new(field, my_manifest) - end - - end - - end - end - end -end diff --git a/lib/manifest/local/view/form/field/tag/base.rb b/lib/manifest/local/view/form/field/tag/base.rb deleted file mode 100644 index 33896602..00000000 --- a/lib/manifest/local/view/form/field/tag/base.rb +++ /dev/null @@ -1,72 +0,0 @@ -module Manifest - module View - module FormModule - module FieldModule - module TagModule - class Base - attr :field, :tag_manifest - - def initialize field, tag_manifest - @field = field - @tag_manifest = tag_manifest - end - - def form_field_name - @field.form_field_name - end - - def value - @field.value - end - - def options - @field.options @tag_manifest.options - end - - def form - @field.form - end - - def manifest - self.form.manifest - end - - def form_name - self.form.form_name - end - - def model - self.form.model - end - - def item - self.form.item - end - - def model_name - @label_manifest.model_name - end - - def column_name - @label_manifest.column_name - end - - def template_dir - self.form.template_dir + 'tag/' - end - - def template_file_name - raise "undefined template_file_name\n" - end - - def template_name - self.template_dir + self.template_file_name - end - - end - - end - end - end - end -end diff --git a/lib/manifest/local/view/form/field/tag/hidden.rb b/lib/manifest/local/view/form/field/tag/hidden.rb deleted file mode 100644 index 93476d01..00000000 --- a/lib/manifest/local/view/form/field/tag/hidden.rb +++ /dev/null @@ -1,17 +0,0 @@ -module Manifest - module View - module FormModule - module FieldModule - module TagModule - class HiddenTag < Base - def template_file_name - 'hidden' - end - - end - - end - end - end - end -end diff --git a/lib/manifest/local/view/form/field/tag/number.rb b/lib/manifest/local/view/form/field/tag/number.rb deleted file mode 100644 index 8b96c104..00000000 --- a/lib/manifest/local/view/form/field/tag/number.rb +++ /dev/null @@ -1,17 +0,0 @@ -module Manifest - module View - module FormModule - module FieldModule - module TagModule - class NumberTag < Base - def template_file_name - 'number' - end - - end - - end - end - end - end -end diff --git a/lib/manifest/local/view/form/field/tag/select.rb b/lib/manifest/local/view/form/field/tag/select.rb deleted file mode 100644 index 36f7dd64..00000000 --- a/lib/manifest/local/view/form/field/tag/select.rb +++ /dev/null @@ -1,27 +0,0 @@ -module Manifest - module View - module FormModule - module FieldModule - module TagModule - class SelectTag < Base - def template_file_name - 'select' - end - - def select_item_name - model = ::Manifest.manifest.models[@field.field_manifest.model_name] - attr = model.attributes[@field.field_manifest.column_name] - attr.source.select_item_name - end - - def items - ::Manifest.manifest.system_resources.select_items[self.select_item_name] - end - - end - - end - end - end - end -end diff --git a/lib/manifest/local/view/form/field/tag/text.rb b/lib/manifest/local/view/form/field/tag/text.rb deleted file mode 100644 index ed714789..00000000 --- a/lib/manifest/local/view/form/field/tag/text.rb +++ /dev/null @@ -1,17 +0,0 @@ -module Manifest - module View - module FormModule - module FieldModule - module TagModule - class TextTag < Base - def template_file_name - 'text' - end - - end - - end - end - end - end -end diff --git a/lib/manifest/local/view/form/field/tag/text_area.rb b/lib/manifest/local/view/form/field/tag/text_area.rb deleted file mode 100644 index 23cfdfa6..00000000 --- a/lib/manifest/local/view/form/field/tag/text_area.rb +++ /dev/null @@ -1,17 +0,0 @@ -module Manifest - module View - module FormModule - module FieldModule - module TagModule - class TextAreaTag < Base - def template_file_name - 'text_area' - end - - end - - end - end - end - end -end diff --git a/lib/manifest/local/view/list_group.rb b/lib/manifest/local/view/list_group.rb deleted file mode 100644 index b6890721..00000000 --- a/lib/manifest/local/view/list_group.rb +++ /dev/null @@ -1,30 +0,0 @@ -require_dependency "manifest/local/view/list_group/list/base" -require_dependency "manifest/local/view/list_group/list/public" -require_dependency "manifest/local/view/list_group/list/private" -require_dependency "manifest/local/view/list_group/list/system_resource" -require_dependency "manifest/local/view/list_group/list/filter" -require_dependency "manifest/local/view/list_group/list/through_filter" -require_dependency "manifest/local/view/list_group/list/foreign_filter" -require_dependency "manifest/local/view/list_group/list/play" -module Manifest - module View - class ListGroup - include ListGroupModule - - def self.types - { - 'public' => PublicList, 'private' => PrivateList, 'system_resource' => SystemResourceList, - 'filter' => FilterList, 'through_filter' => ThroughFilterList, 'foreign_filter' => ForeignFilterList, - 'play' => PlayList - } - end - - def self.list item_name, list_name - list_group_manifest = Manifest.manifest.list_groups[item_name] - list_manifest = list_group_manifest.lists[list_name] - self.types[list_manifest.type].new item_name, list_name - end - - end - end -end diff --git a/lib/manifest/local/view/list_group/list/base.rb b/lib/manifest/local/view/list_group/list/base.rb deleted file mode 100644 index 9adb6f42..00000000 --- a/lib/manifest/local/view/list_group/list/base.rb +++ /dev/null @@ -1,109 +0,0 @@ -module Manifest - module View - module ListGroupModule - class Base - class ListResult - attr :items, :paginate - def initialize items, paginate - @items = items - @paginate = paginate - end - - end - - attr :item_name, :list_name, - :model_manifest, :model_list_manifest, :model, - :default_page_size, :max_page_size - def initialize item_name, list_name - @item_name = item_name - @list_name = list_name - self.init - end - - def init - @list_group_manifest = ::Manifest.manifest.list_groups[@item_name] - @list_manifest = @list_group_manifest.lists[@list_name] - @where = @list_manifest.where - @includes = @list_manifest.includes - @model_manifest = ::Manifest.manifest.models[@item_name] - @model_list_manifest = @model_manifest.list - @model = ::Manifest.item_name_to_model @item_name - @table_name = @model.table_name - end - - def model_name - @model.model_name - end - - def model_manifest - @model.model_manifest - end - - def page_number prm = nil - page = prm.to_i - page = 1 if page < 1 - page - end - - def page_size prm - page_size = prm.to_i - page_size = self.max_page_size if page_size > self.max_page_size - page_size = self.default_page_size if page_size < 1 - page_size - end - - def default_page_size - @model_list_manifest.default_page_size - end - - def max_page_size - @model_list_manifest.max_page_size - end - - def base_where_condition - method_name = @where.conditions do |name| - name - end - @model.__send__ method_name - end - - def where_condition - base_where_condition - end - - def include_hash - @includes.includes - end - - def order - @model.list_order - end - - def items operators, options, offset, page_size - @model.where(self.where_condition).includes(self.include_hash).order(self.order).offset(offset).limit(page_size) - end - - def count operators, options - @model.where(self.where_condition).includes(self.include_hash).count - end - - def paginate count, offset, page_size - c = count ? count.to_i : 0 - Kaminari.paginate_array(Array.new(c, nil)).page(offset).per(page_size) - end - - def open operators, options - page = self.page_number(options[:page]) - page_size = self.page_size options[:page_size] - offset = (page -1) * page_size - items = self.items operators, options, offset, page_size - count = self.count operators, options - pg = self.paginate count, offset, page_size - ListResult.new items, pg - end - - end - - end - end -end diff --git a/lib/manifest/local/view/list_group/list/filter.rb b/lib/manifest/local/view/list_group/list/filter.rb deleted file mode 100644 index 2e4d7b44..00000000 --- a/lib/manifest/local/view/list_group/list/filter.rb +++ /dev/null @@ -1,39 +0,0 @@ -module Manifest - module View - module ListGroupModule - class FilterList < Base - attr :filter_key, :filter_item_name - - def init - super - @filter_key = @list_manifest.filter_key - @filter_item_name = @list_manifest.filter_item_name - end - - def where_condition filter_item_id - w = self.base_where_condition - w += ' and ' unless w.blank? - [w + @table_name + '.' + @filter_key + ' = ?', filter_item_id] - end - - def include_hash - w = super - w.merge!({@filter_item_name => {} }) unless w[@filter_item_name] - w - end - - def items operators, options, offset, page_size - filter_item_id = options[:id] - @model.where(self.where_condition(filter_item_id)).includes(self.include_hash).order(self.order).offset(offset).limit(page_size) - end - - def count operators, options - filter_item_id = options[:id] - @model.where(self.where_condition(filter_item_id)).includes(self.include_hash).count - end - - end - - end - end -end diff --git a/lib/manifest/local/view/list_group/list/foreign_filter.rb b/lib/manifest/local/view/list_group/list/foreign_filter.rb deleted file mode 100644 index 2ccee25b..00000000 --- a/lib/manifest/local/view/list_group/list/foreign_filter.rb +++ /dev/null @@ -1,24 +0,0 @@ -module Manifest - module View - module ListGroupModule - class ForeignFilterList < FilterList - - def init - super - end - - def where_condition filter_item_id - w = self.base_where_condition - w += ' and ' unless w.blank? - [w + @filter_table_name + '.id' + ' = ?', filter_item_id] - end - - def include_hash - @model_manifest.tree[@tree_name].include_hash - end - - end - - end - end -end diff --git a/lib/manifest/local/view/list_group/list/play.rb b/lib/manifest/local/view/list_group/list/play.rb deleted file mode 100644 index dbba7900..00000000 --- a/lib/manifest/local/view/list_group/list/play.rb +++ /dev/null @@ -1,43 +0,0 @@ -module Manifest - module View - module ListGroupModule - class PlayList - attr :model, :list_name, :list_manifest, :type, - :default_page_size, :max_page_size - - def initialize model, list_name, list_manifest - @model = model - @list_name = list_name - @list_manifest = list_manifest - self.set_default - self.init - end - - def set_default - @list_manifest['args'] ||= {} - return - @default_page_size = @conf['default_page_size'] || 25 - @max_page_size = @conf['max_page_size'] || 100 - @params_offset = params_offset - @params_count = params_count - @list_list_conf = @manifest.list(@item_name).lists[list_name] || {} - @model_name = @list_list_conf['model'] - @filter_key = @list_list_conf['filter_key'] - @model = @model_name.classify.constantize - @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 init - @type = @list_manifest['type'] - @args = @list_manifest['args'] - end - - end - - end - end -end diff --git a/lib/manifest/local/view/list_group/list/private.rb b/lib/manifest/local/view/list_group/list/private.rb deleted file mode 100644 index f0251937..00000000 --- a/lib/manifest/local/view/list_group/list/private.rb +++ /dev/null @@ -1,44 +0,0 @@ -module Manifest - module View - module ListGroupModule - class PrivateList < Base - - def init - super - end - - def where_condition operators - case @model.owner_type - when :author - operator = operators.author - when :artist - operator = operators.artist - end - t = if @owner_model - if @owner_model.owner_model - @owner_model.owner_model.table_name - else - @owner_model.table_name - end - else - @table_name - end - @where.conditions do |name| - [t + '.' + @model.owner_type.to_s + '_id = ?', operator.id] - end - end - - def items operators, options, offset, page_size - @model.where(self.where_condition(operators)).includes(self.include_hash).order(self.order).offset(offset).limit(page_size) - end - - def count operators, options - filter_item_id = options[:id] - @model.where(self.where_condition(operators)).includes(self.include_hash).count - end - - end - - end - end -end diff --git a/lib/manifest/local/view/list_group/list/public.rb b/lib/manifest/local/view/list_group/list/public.rb deleted file mode 100644 index 4b37f7d7..00000000 --- a/lib/manifest/local/view/list_group/list/public.rb +++ /dev/null @@ -1,18 +0,0 @@ -module Manifest - module View - module ListGroupModule - class PublicList < Base - - def init - super - end - - def order - @model.list_order - end - - end - - end - end -end diff --git a/lib/manifest/local/view/list_group/list/system_resource.rb b/lib/manifest/local/view/list_group/list/system_resource.rb deleted file mode 100644 index 321746ef..00000000 --- a/lib/manifest/local/view/list_group/list/system_resource.rb +++ /dev/null @@ -1,21 +0,0 @@ -module Manifest - module View - module ListGroupModule - class SystemResourceList < Base - - def init - super - end - - def items operators, options, offset, page_size - # enable_list does not work when configured auto load in development.rb - # auto loader undefing MODEL at reload manifest file - # @model.enable_list - super - end - - end - - end - end -end diff --git a/lib/manifest/local/view/list_group/list/through_filter.rb b/lib/manifest/local/view/list_group/list/through_filter.rb deleted file mode 100644 index b4008949..00000000 --- a/lib/manifest/local/view/list_group/list/through_filter.rb +++ /dev/null @@ -1,27 +0,0 @@ -module Manifest - module View - module ListGroupModule - class ThroughFilterList < FilterList - attr :through - - def init - super - @through = @list_manifest.through - @filter_table_name = ::Manifest.manifest.models[@filter_item_name].classify.table_name - end - - def include_hash - {@through => {@filter_item_name => {}} } - end - - def where_condition filter_item_id - w = self.base_where_condition - w += ' and ' unless w.blank? - [w + @filter_table_name + '.id' + ' = ?', filter_item_id] - end - - end - - end - end -end diff --git a/lib/manifest/local/view/profiler.rb b/lib/manifest/local/view/profiler.rb deleted file mode 100644 index ffb9efd8..00000000 --- a/lib/manifest/local/view/profiler.rb +++ /dev/null @@ -1,65 +0,0 @@ -require_dependency "manifest/local/view/profiler/header" -require_dependency "manifest/local/view/profiler/column" -require_dependency "manifest/local/view/profiler/association" -module Manifest - module View - class Profiler - include ProfilerModule - attr :profiler_manifest, :item_name, :item, :operators, :template_dir, - :header, :columns, :associations - def initialize item_name, item, operators - @item_name = item_name - @item = item - @operators = operators - @profiler_manifest = Manifest.manifest.profilers[@item_name] - @template_dir = 'templates/r/profiler/' - @header = Header.new self - @columns = @profiler_manifest.column_names.map {|column_name| - Column.new self, column_name - } - @associations = Association.new self, @profiler_manifest.associations - end - - def model - ::Manifest::item_name_to_model @item_name - end - - def template_file_name - "profiler" - end - - def template_name - self.template_dir + self.template_file_name - end - - def header_template_file_name - "header" - end - - def header_template_name - self.template_dir + self.header_template_file_name - end - - def columns_template_file_name - "columns" - end - - def columns_template_name - self.template_dir + self.columns_template_file_name - end - - def associations_template_file_name - "associations" - end - - def associations_template_name - self.template_dir + self.associations_template_file_name - end - - def image_dir - '/images/' - end - - end - end -end diff --git a/lib/manifest/local/view/profiler/association.rb b/lib/manifest/local/view/profiler/association.rb deleted file mode 100644 index 35cde9c5..00000000 --- a/lib/manifest/local/view/profiler/association.rb +++ /dev/null @@ -1,70 +0,0 @@ -require_dependency "manifest/local/view/profiler/association/belongs_to" -require_dependency "manifest/local/view/profiler/association/has_many" -require_dependency "manifest/local/view/profiler/association/has_one" -module Manifest - module View - module ProfilerModule - class Association - include AssociationModule - attr :profiler, :association_manifest, - :belongs_to, :has_many, :has_one - def initialize profiler, association_manifest - @profiler = profiler - @association_manifest = association_manifest - @belongs_to = @association_manifest.belongs_to.map {|belongs_to_manifest| - BelongsTo.new self, belongs_to_manifest - } - @has_many = @association_manifest.has_many.map {|list_name| - HasMany.new self, list_name - } - @has_one = @association_manifest.has_one.map {|list_name| - HasOne.new self, list_name - } - end - - def item - @profiler.item - end - - def model_manifest - ::Manifest.manifest.models[@profiler.item_name] - end - - def model_attribute_manifest - model_manifest.attributes[@column_name] - end - - def template_dir - @profiler.template_dir - end - - def template_file_name - "associations" - end - - def template_name - self.template_dir + self.template_file_name - end - - def each_belongs_to_filer - @belongs_to.each {|b| - yield b.filer - } - end - - def each_has_many_filer - @has_many.each {|h| - yield h.filer - } - end - - def each_has_one_filer - @has_one.each {|h| - yield h.filer - } - end - - end - end - end -end diff --git a/lib/manifest/local/view/profiler/association/belongs_to.rb b/lib/manifest/local/view/profiler/association/belongs_to.rb deleted file mode 100644 index 8955be08..00000000 --- a/lib/manifest/local/view/profiler/association/belongs_to.rb +++ /dev/null @@ -1,52 +0,0 @@ -module Manifest - module View - module ProfilerModule - module AssociationModule - class BelongsTo - attr :association, :belongs_to_manifest - def initialize association, belongs_to_manifest - @association = association - @belongs_to_manifest = belongs_to_manifest - end - - def item - self.profiler.item - end - - def parent_model - @belongs_to_manifest.model - end - - def parent_id - self.item.attributes[self.model_belongs_to_manifest.id_column] - end - - def filer - filer = nil - begin - r = self.parent_model.show(self.parent_id, self.profiler.operators) - if r - filer = ::Manifest::View::Filer.new self.parent_model.item_name, [r], nil, self.profiler.operators - end - rescue ActiveRecord::RecordNotFound, ActiveRecord::Forbidden - end - filer - end - - def model_manifest - ::Manifest.manifest.models[self.profiler.item_name] - end - - def model_belongs_to_manifest - self.model_manifest.associations.belongs_to[@belongs_to_manifest.model_name] - end - - def profiler - @association.profiler - end - - end - end - end - end -end diff --git a/lib/manifest/local/view/profiler/association/has_many.rb b/lib/manifest/local/view/profiler/association/has_many.rb deleted file mode 100644 index 46ea7198..00000000 --- a/lib/manifest/local/view/profiler/association/has_many.rb +++ /dev/null @@ -1,34 +0,0 @@ -module Manifest - module View - module ProfilerModule - module AssociationModule - class HasMany - attr :association, :has_many_manifest - def initialize association, has_many_manifest - @association = association - @has_many_manifest = has_many_manifest - end - - def item - self.profiler.item - end - - def has_many_model - @has_many_manifest.model - end - - def filer - list_result = @has_many_manifest.list.open(self.profiler.operators, {:id => self.item.id, :page => 1, :page_size => 3}) - items = list_result.items - ::Manifest::View::Filer.new self.has_many_model.item_name, items, nil, self.profiler.operators - end - - def profiler - @association.profiler - end - - end - end - end - end -end diff --git a/lib/manifest/local/view/profiler/association/has_one.rb b/lib/manifest/local/view/profiler/association/has_one.rb deleted file mode 100644 index 3b53201f..00000000 --- a/lib/manifest/local/view/profiler/association/has_one.rb +++ /dev/null @@ -1,34 +0,0 @@ -module Manifest - module View - module ProfilerModule - module AssociationModule - class HasOne - attr :association, :has_one_manifest - def initialize association, has_one_manifest - @association = association - @has_one_manifest = has_one_manifest - end - - def item - self.profiler.item - end - - def has_one_model - @has_one_manifest.model - end - - def filer - list_result = @has_one_manifest.list.open(self.profiler.operators, {:id => self.item.id}) - items = list_result.items - ::Manifest::View::Filer.new self.has_one_model.item_name, items, nil, self.profiler.operators - end - - def profiler - @association.profiler - end - - end - end - end - end -end diff --git a/lib/manifest/local/view/profiler/column.rb b/lib/manifest/local/view/profiler/column.rb deleted file mode 100644 index 9a7dc0ad..00000000 --- a/lib/manifest/local/view/profiler/column.rb +++ /dev/null @@ -1,118 +0,0 @@ -module Manifest - module View - module ProfilerModule - class Column - attr :profiler, :column_name - def initialize profiler, column_name - @profiler = profiler - @column_name = column_name - end - - def label - self.item.class.human_attribute_name(@column_name) - end - - def value - self.item.attributes[@column_name] - end - - def note - end - - def date? - case model_attribute_manifest.type - when 'datetime' - if self.value - true - else - false - end - else - false - end - end - - def note? - if self.model_attribute_source_manifest - case self.model_attribute_source_manifest.type - when 'magic_number' - true - when 'model' - false - else - false - end - else - false - end - end - - def select_item_name - self.model_attribute_source_manifest.select_item_name - end - - def item - @profiler.item - end - - def model_manifest - ::Manifest.manifest.models[@profiler.item_name] - end - - def model_attribute_manifest - self.model_manifest.attributes[@column_name] - end - - def model_attribute_source_manifest - self.model_attribute_manifest.source - end - - def template_dir - @profiler.template_dir - end - - def template_file_name - "column" - end - - def template_name - self.template_dir + self.template_file_name - end - - def value_template_dir - @profiler.template_dir + "column_value/" - end - - def value_template_file_name - if self.date? - 'date' - else - 'default' - end - end - - def value_template_name - self.value_template_dir + self.value_template_file_name - end - - def note_template_dir - @profiler.template_dir + "column_note/" - end - - def note_template_file_name - if self.note? - 'default' - else - 'none' - end - end - - def note_template_name - self.note_template_dir + self.note_template_file_name - end - - end - end - end -end - diff --git a/lib/manifest/local/view/profiler/header.rb b/lib/manifest/local/view/profiler/header.rb deleted file mode 100644 index 80a1d154..00000000 --- a/lib/manifest/local/view/profiler/header.rb +++ /dev/null @@ -1,19 +0,0 @@ -module Manifest - module View - module ProfilerModule - class Header - attr :profiler - def initialize profiler - @profiler = profiler - end - - def filer - ::Manifest::View::Filer.new @profiler.item_name, [@profiler.item], nil, @profiler.operators - end - - end - - end - end -end - diff --git a/lib/manifest/manifest.rb b/lib/manifest/manifest.rb index 866ed0da..17a96809 100644 --- a/lib/manifest/manifest.rb +++ b/lib/manifest/manifest.rb @@ -2,28 +2,24 @@ module Manifest class Manifest cattr_accessor :manifest attr :system_resources, :magic_numbers, - :controllers, :models, - :list_groups, :profilers, :filers, :forms + :controllers, :models # call me before load routes.rb # routes.rb needs engine_resources manifest in system_resources # ex. it's adding license_groups routes - def initialize manifest - @manifest = manifest || {} - @system_resources = SystemResource.new(self, SystemResource.set_default(@manifest['system_resources'])) - @magic_numbers = @manifest['magic_numbers'] + def initialize global_json + @global_json = global_json || {} + @system_resources = SystemResource.new(self, SystemResource.set_default(@global_json['system_resources'])) + @magic_numbers = @global_json['magic_numbers'] end def init # managers can't initialize before load application.rb return unless defined? ::Pettanr - @controllers = Controller.manager(self, @manifest['controllers'] || {}) - @models = Model.manager(self, @manifest['models'] || {}) - @locals = @manifest['locals'] - @list_groups = ListGroup.manager(self, @locals['list_groups'] || {}) - @filers = Filer.manager(self, @locals['filers'] || {}) - @profilers = Profiler.manager(self, @locals['profilers'] || {}) - @forms = Form.base_manager(self, @locals['forms'] || {}) - @forms.merge(Form.extend_manager(self, @locals['forms'] || {})) + @controllers = Controller.manager(self, @global_json['controllers'] || {}) + @models = Model.manager(self, @global_json['models'] || {}) + end + + def system_resources_init @system_resources.init end @@ -40,8 +36,8 @@ module Manifest Manifest.manifest end - def load json - Manifest.manifest = Manifest.new json + def load global_json + Manifest.manifest = Manifest.new global_json end def item_name_to_model item_name diff --git a/lib/manifest/system_resource.rb b/lib/manifest/system_resource.rb index 67561dea..5a3f4bf2 100644 --- a/lib/manifest/system_resource.rb +++ b/lib/manifest/system_resource.rb @@ -40,7 +40,7 @@ module Manifest resource_model_name = source_manifest.resource_model_name resource_list_name = source_manifest.resource_list_name caption = source_manifest.caption_name - list = ::Manifest::View::ListGroup.list resource_model_name, resource_list_name + list = Locmare::ListGroup.list resource_model_name, resource_list_name r = list.open nil, {} @select_items[source_manifest.select_item_name] = r.items.map {|item| [item.attributes[caption], item.id]} diff --git a/public/local_manifest.json b/public/local_manifest.json new file mode 100644 index 00000000..56bd0d68 --- /dev/null +++ b/public/local_manifest.json @@ -0,0 +1,2712 @@ +{ + "list_groups": { + "scroll": { + "lists": { + "public": { + "type": "public" + }, + "private": { + "type": "private" + }, + "by_author": { + "type": "filter" + }, + "by_panel": { + "type": "through_filter", + "args": { + "through": "scroll_panels" + } + }, + "play": { + "type": "play", + "args": { + "filter_item_name": "scroll", + "filter_model_name": "scroll_panel", + "filter_key": "scroll_id" + } + } + } + }, + "scroll_panel": { + "tree_name": "owner", + "lists": { + "public": { + "type": "public" + }, + "private": { + "type": "private" + }, + "by_scroll": { + "type": "filter" + }, + "by_panel": { + "type": "filter" + }, + "by_author": { + "type": "foreign_filter", + "args": { + "tree_name": "scroll_owner" + } + } + } + }, + "comic": { + "lists": { + "public": { + "type": "public" + }, + "private": { + "type": "private" + }, + "by_author": { + "type": "filter" + } + } + }, + "story": { + "tree_name": "owner", + "lists": { + "public": { + "type": "public" + }, + "private": { + "type": "private" + }, + "by_comic": { + "type": "filter" + }, + "by_sheet": { + "type": "through_filter", + "args": { + "through": "story_sheets" + } + }, + "by_author": { + "type": "foreign_filter", + "args": { + "tree_name": "comic_owner" + } + }, + "play": { + "type": "play" + } + } + }, + "story_sheet": { + "tree_name": "owner", + "lists": { + "public": { + "type": "public" + }, + "private": { + "type": "private" + }, + "by_story": { + "type": "filter" + }, + "by_sheet": { + "type": "filter" + }, + "by_author": { + "type": "foreign_filter", + "args": { + "tree_name": "comic_owner" + } + } + } + }, + "sheet": { + "lists": { + "public": { + "type": "public" + }, + "private": { + "type": "private" + }, + "by_story": { + "type": "through_filter", + "args": { + "through": "story_sheets" + } + }, + "by_panel": { + "type": "through_filter", + "args": { + "through": "sheet_panels" + } + }, + "by_author": { + "type": "filter" + }, + "play": { + "type": "play" + } + } + }, + "sheet_panel": { + "tree_name": "owner", + "lists": { + "public": { + "type": "public" + }, + "private": { + "type": "private" + }, + "by_sheet": { + "type": "filter" + }, + "by_panel": { + "type": "filter" + }, + "by_author": { + "type": "foreign_filter", + "args": { + "tree_name": "sheet_owner" + } + } + } + }, + "panel": { + "lists": { + "public": { + "type": "public" + }, + "private": { + "type": "private" + }, + "by_scroll": { + "type": "through_filter", + "args": { + "through": "scroll_panels" + } + }, + "by_sheet": { + "type": "through_filter", + "args": { + "through": "sheet_panels" + } + }, + "by_author": { + "type": "filter" + }, + "by_speech_balloon_template": { + "type": "through_filter" + } + } + }, + "panel_picture": { + "tree_name": "owner", + "lists": { + "public": { + "type": "public" + }, + "private": { + "type": "private" + }, + "by_panel": { + "type": "filter" + }, + "by_author": { + "type": "foreign_filter", + "args": { + "tree_name": "panel_owner" + } + } + } + }, + "speech_balloon": { + "tree_name": "owner", + "lists": { + "public": { + "type": "public" + }, + "private": { + "type": "private" + }, + "by_panel": { + "type": "filter" + }, + "by_speech_balloon_template": { + "type": "filter" + }, + "by_author": { + "type": "foreign_filter", + "args": { + "tree_name": "panel_owner" + } + } + } + }, + "speech": { + "tree_name": "owner", + "lists": { + "public": { + "type": "public" + }, + "private": { + "type": "private" + }, + "by_panel": { + "type": "filter" + }, + "by_speech_balloon": { + "type": "filter" + }, + "by_author": { + "type": "foreign_filter", + "args": { + "tree_name": "panel_owner" + } + } + } + }, + "balloon": { + "tree_name": "owner", + "lists": { + "public": { + "type": "public" + }, + "by_speech_balloon": { + "type": "filter" + }, + "by_writing_format": { + "type": "filter" + }, + "by_author": { + "type": "foreign_filter", + "args": { + "tree_name": "panel_owner" + } + } + } + }, + "ground_picture": { + "tree_name": "owner", + "lists": { + "public": { + "type": "public" + }, + "private": { + "type": "private" + }, + "by_panel": { + "type": "filter" + }, + "by_author": { + "type": "foreign_filter", + "args": { + "tree_name": "panel_owner" + } + } + } + }, + "ground_color": { + "tree_name": "owner", + "lists": { + "public": { + "type": "public" + }, + "private": { + "type": "private" + }, + "by_panel": { + "type": "filter" + }, + "by_author": { + "type": "foreign_filter", + "args": { + "tree_name": "panel_owner" + } + } + } + }, + "original_picture": { + "lists": { + "private": { + "type": "private" + } + } + }, + "picture": {}, + "resource_picture": { + "lists": { + "public": { + "type": "public" + }, + "private": { + "type": "private" + }, + "by_original_picture": { + "type": "filter" + }, + "by_license": { + "type": "filter" + }, + "by_artist": { + "type": "filter" + } + } + }, + "speech_balloon_template": { + "lists": { + "public": { + "type": "public" + }, + "select_items": { + "type": "system_resource" + } + } + }, + "writing_format": { + "lists": { + "public": { + "type": "public" + }, + "select_items": { + "type": "system_resource" + }, + "by_system_picture": { + "type": "filter" + } + } + }, + "license_group": { + "lists": { + "public": { + "type": "public" + }, + "select_items": { + "type": "system_resource" + } + } + }, + "license": { + "lists": { + "public": { + "type": "public" + }, + "by_license_group": { + "type": "filter" + }, + "by_system_picture": { + "type": "filter" + } + } + }, + "author": { + "lists": { + "public": { + "type": "public" + } + } + }, + "artist": { + "lists": { + "public": { + "type": "public" + } + } + }, + "system_picture": { + "lists": { + "public": { + "type": "public" + } + } + } + }, + "profilers": { + "scroll": { + "column_names": [ + "title", + "description", + "visible", + "author_id" + ], + "associations": { + "belongs_to": [ + "author" + ], + "has_many": [ + "scroll_panels.by_scroll", + "panels.by_scroll" + ] + } + }, + "scroll_panel": { + "column_names": [ + "scroll_id", + "panel_id", + "t", + "author_id" + ], + "associations": { + "belongs_to": [ + "scroll", + "panel" + ] + } + }, + "comic": { + "column_names": [ + "title", + "description", + "visible", + "author_id" + ], + "associations": { + "belongs_to": [ + "author" + ], + "has_many": [ + "stories.by_comic" + ] + } + }, + "story": { + "column_names": [ + "comic_id", + "title", + "description", + "t", + "visible" + ], + "associations": { + "belongs_to": [ + "comic" + ], + "has_many": [ + "story_sheets.by_story", + "sheets.by_story" + ] + } + }, + "story_sheet": { + "column_names": [ + "story_id", + "sheet_id", + "t", + "author_id" + ], + "associations": { + "belongs_to": [ + "story", + "sheet" + ] + } + }, + "sheet": { + "column_names": [ + "caption", + "width", + "height", + "visible", + "author_id" + ], + "associations": { + "belongs_to": [ + "author" + ], + "has_many": [ + "story_sheets.by_sheet", + "stories.by_sheet", + "sheet_panels.by_sheet", + "panels.by_sheet" + ] + } + }, + "sheet_panel": { + "column_names": [ + "sheet_id", + "panel_id", + "x", + "y", + "z", + "t", + "author_id" + ], + "associations": { + "belongs_to": [ + "sheet", + "panel" + ] + } + }, + "panel": { + "column_names": [ + "width", + "height", + "border", + "caption", + "publish", + "author_id" + ], + "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": { + "column_names": [ + "panel_id", + "picture_id", + "caption", + "x", + "y", + "width", + "height", + "link", + "z", + "t" + ], + "associations": { + "belongs_to": [ + "panel" + ] + } + }, + "speech_balloon": { + "column_names": [ + "panel_id", + "speech_balloon_template_id", + "classname", + "z", + "t", + "settings", + "caption" + ], + "associations": { + "belongs_to": [ + "panel" + ], + "has_one": [ + "balloon.by_speech_balloon", + "speech.by_speech_balloon" + ] + } + }, + "speech": { + "column_names": [ + "speech_balloon_id", + "writing_format_id", + "content", + "font_size", + "text_align", + "fore_color", + "x", + "y", + "width", + "height", + "quotes", + "settings" + ], + "associations": { + "belongs_to": [ + "speech_balloon", + "writing_format" + ] + } + }, + "balloon": { + "column_names": [ + "speech_balloon_id", + "system_picture_id", + "x", + "y", + "width", + "height", + "r", + "settings" + ], + "associations": { + "belongs_to": [ + "speech_balloon", + "system_picture" + ] + } + }, + "ground_picture": { + "column_names": [ + "panel_id", + "picture_id", + "caption", + "repeat", + "x", + "y", + "z", + "t" + ], + "associations": { + "belongs_to": [ + "panel" + ] + } + }, + "ground_color": { + "column_names": [ + "panel_id", + "caption", + "code", + "orientation", + "xy", + "wh", + "z", + "t" + ], + "associations": { + "belongs_to": [ + "panel" + ] + } + }, + "original_picture": { + "column_names": [ + "ext", + "width", + "height", + "filesize", + "artist_id", + "md5", + "uploaded_at", + "published_at", + "stopped_at" + ], + "associations": { + "belongs_to": [ + "artist" + ], + "has_one": [ + "resource_picture.by_original_picture" + ] + } + }, + "picture": { + "column_names": [ + "original_picture_id", + "revision", + "ext", + "width", + "height", + "filesize", + "artist_id", + "license_id", + "md5", + "artist_name", + "credit", + "settings", + "classname" + ], + "associations": { + "belongs_to": [ + "license", + "artist" + ] + } + }, + "resource_picture": { + "column_names": [ + "original_picture_id", + "revision", + "ext", + "width", + "height", + "filesize", + "artist_id", + "license_id", + "md5", + "artist_name", + "credit", + "settings", + "picture_id", + "classname" + ], + "associations": { + "belongs_to": [ + "original_picture", + "license", + "artist" + ] + } + }, + "speech_balloon_template": { + "column_names": [ + "name", + "classname", + "caption", + "t", + "system_picture_id", + "settings" + ], + "associations": { + "belongs_to": [ + "system_picture" + ] + } + }, + "writing_format": { + "column_names": [ + "name", + "classname", + "caption", + "system_picture_id", + "settings" + ], + "associations": { + "belongs_to": [ + "system_picture" + ], + "has_many": [] + } + }, + "license_group": { + "column_names": [ + "name", + "classname", + "caption", + "url" + ], + "associations": { + "has_many": [ + "licenses.by_license_group" + ] + } + }, + "license": { + "column_names": [ + "license_group_id", + "name", + "caption", + "system_picture_id", + "url", + "settings", + "credit_pictures" + ], + "associations": { + "belongs_to": [ + "license_group", + "system_picture" + ], + "has_many": [ + "resource_pictures.by_license" + ] + } + }, + "author": { + "column_names": [ + "name", + "user_id" + ], + "associations": { + "has_many": [ + "scrolls.by_author", + "scroll_panels.by_author", + "comics.by_author", + "stories.by_author", + "sheets.by_author", + "sheet_panels.by_author", + "panels.by_author", + "panel_pictures.by_author", + "speech_balloons.by_author", + "balloons.by_author", + "speeches.by_author", + "ground_pictures.by_author", + "ground_colors.by_author" + ] + } + }, + "artist": { + "column_names": [ + "name", + "author_id" + ], + "associations": { + "has_many": [ + "resource_pictures.by_artist" + ] + } + }, + "system_picture": { + "column_names": [ + "ext", + "width", + "height", + "filesize", + "md5" + ], + "associations": { + "has_many": [ + "licenses.by_system_picture" + ] + } + } + }, + "filers": { + "scroll": { + "symbol": {}, + "caption": { + "type": "default", + "args": { + "face": { + "type": "column", + "args": { + "column_name": "title" + } + }, + "link": { + "type": "action", + "args": { + "action_name": "play" + } + } + } + }, + "summary": {}, + "edit": {} + }, + "scroll_panel": { + "symbol": { + "type": "default", + "args": { + "link": { + "type": "none" + } + } + }, + "caption": { + "type": "none" + }, + "summary": {}, + "edit": { + "type": "none" + } + }, + "comic": { + "symbol": {}, + "caption": { + "type": "default", + "args": { + "face": { + "type": "column", + "args": { + "column_name": "title" + } + } + } + }, + "summary": {}, + "edit": {} + }, + "story": { + "symbol": {}, + "caption": { + "type": "default", + "args": { + "face": { + "type": "method", + "args": { + "method_name": "title_with_t" + } + }, + "link": { + "type": "action", + "args": { + "action_name": "play" + } + } + } + }, + "summary": {}, + "edit": {} + }, + "story_sheet": { + "symbol": { + "type": "default", + "args": { + "link": { + "type": "none" + } + } + }, + "caption": { + "type": "none" + }, + "summary": {}, + "edit": { + "type": "none" + } + }, + "sheet": { + "symbol": {}, + "caption": { + "type": "default", + "args": { + "face": {}, + "link": { + "type": "action", + "args": { + "action_name": "play" + } + } + } + }, + "summary": {}, + "edit": {} + }, + "sheet_panel": { + "symbol": { + "type": "default", + "args": { + "link": { + "type": "none" + } + } + }, + "caption": { + "type": "none" + }, + "summary": {}, + "edit": { + "type": "none" + } + }, + "panel": { + "symbol": {}, + "caption": { + "type": "default", + "args": { + "link": { + "type": "none" + } + } + }, + "summary": {}, + "edit": {} + }, + "panel_picture": { + "symbol": { + "type": "default", + "args": { + "face": { + "type": "picture" + } + } + }, + "caption": { + "type": "default", + "args": { + "link": { + "type": "none" + } + } + }, + "summary": {}, + "edit": { + "type": "none" + } + }, + "speech_balloon": { + "symbol": { + "type": "default", + "args": { + "face": { + "type": "picture" + } + } + }, + "caption": { + "type": "default", + "args": { + "face": { + "type": "method", + "args": { + "method_name": "plain_scenario" + } + }, + "link": { + "type": "none" + } + } + }, + "summary": {}, + "edit": { + "type": "none" + } + }, + "speech": { + "symbol": { + "type": "default", + "args": { + "face": { + "type": "picture" + } + } + }, + "caption": { + "type": "default", + "args": { + "face": { + "type": "column", + "args": { + "column_name": "content" + } + }, + "link": { + "type": "none" + } + } + }, + "summary": {}, + "edit": { + "type": "none" + } + }, + "balloon": { + "symbol": { + "type": "default", + "args": { + "face": { + "type": "picture" + } + } + }, + "caption": { + "type": "none" + }, + "summary": {}, + "edit": { + "type": "none" + } + }, + "ground_picture": { + "symbol": { + "type": "default", + "args": { + "face": { + "type": "picture" + } + } + }, + "caption": { + "type": "default", + "args": { + "link": { + "type": "none" + } + } + }, + "summary": {}, + "edit": { + "type": "none" + } + }, + "ground_color": { + "symbol": { + "type": "template", + "args": { + "template_name": "symbol" + } + }, + "caption": { + "type": "default", + "args": { + "link": { + "type": "none" + } + } + }, + "summary": {}, + "edit": { + "type": "none" + } + }, + "original_picture": { + "symbol": { + "type": "default", + "args": { + "face": { + "type": "picture" + } + } + }, + "caption": { + "type": "default", + "args": { + "face": { + "type": "method", + "args": { + "method_name": "revision" + } + }, + "link": { + "type": "action", + "args": { + "action_name": "history" + } + } + } + }, + "summary": {}, + "edit": { + "type": "template", + "args": { + "template_name": "publish" + } + } + }, + "picture": { + "symbol": { + "type": "default", + "args": { + "face": { + "type": "picture" + } + } + }, + "caption": { + "type": "default", + "args": { + "face": { + "type": "column", + "args": { + "column_name": "revision" + } + } + } + }, + "summary": {}, + "edit": { + "type": "none" + } + }, + "resource_picture": { + "symbol": { + "type": "default", + "args": { + "face": { + "type": "picture" + } + } + }, + "caption": { + "type": "none" + }, + "summary": {}, + "edit": { + "type": "none" + } + }, + "speech_balloon_template": { + "symbol": { + "type": "default", + "args": { + "face": { + "type": "picture" + } + } + }, + "caption": {}, + "summary": { + "type": "none" + }, + "edit": { + "type": "none" + } + }, + "writing_format": { + "symbol": {}, + "caption": {}, + "summary": { + "type": "none" + }, + "edit": { + "type": "none" + } + }, + "license_group": { + "symbol": {}, + "caption": { + "type": "default", + "args": { + "link": { + "type": "url_column", + "args": { + "column_name": "url" + } + } + } + }, + "summary": { + "type": "none" + }, + "edit": { + "type": "none" + } + }, + "license": { + "symbol": {}, + "caption": { + "type": "default", + "args": { + "face": { + "type": "method", + "args": { + "method_name": "caption_with_group" + } + }, + "link": { + "type": "url_column", + "args": { + "column_name": "url" + } + } + } + }, + "summary": {}, + "edit": { + "type": "none" + } + }, + "author": { + "symbol": {}, + "caption": { + "type": "default", + "args": { + "face": { + "type": "column", + "args": { + "column_name": "name" + } + } + } + }, + "summary": {}, + "edit": { + "type": "account" + } + }, + "artist": { + "symbol": {}, + "caption": { + "type": "default", + "args": { + "face": { + "type": "column", + "args": { + "column_name": "name" + } + } + } + }, + "summary": {}, + "edit": { + "type": "account" + } + }, + "system_picture": { + "symbol": { + "type": "default", + "args": { + "face": { + "type": "picture" + } + } + }, + "caption": { + "type": "none" + }, + "summary": { + "type": "none" + }, + "edit": { + "type": "none" + } + } + }, + "forms": { + "base": { + "scroll": { + "fields": { + "title": { + "args": { + "label": { + "args": { + "row_break": true + } + }, + "tag": { + "type": "text" + }, + "row_break": true + } + }, + "description": { + "args": { + "label": { + "args": { + "row_break": true + } + }, + "tag": { + "type": "text_area" + } + } + }, + "visible": { + "args": { + "tag": { + "type": "select" + }, + "row_break": true + } + }, + "id": { + "args": { + "label": { + "type": "none" + }, + "tag": { + "type": "hidden" + } + } + }, + "author_id": { + "args": { + "label": { + "type": "none" + }, + "tag": { + "type": "hidden" + } + } + } + }, + "field_names": [ + "title", + "description", + "visible", + "id", + "author_id" + ] + }, + "scroll_panel": { + "fields": { + "scroll_id": { + "args": { + "tag": { + "type": "number" + } + } + }, + "panel_id": { + "args": { + "tag": { + "type": "number" + } + } + }, + "t": { + "args": { + "tag": { + "type": "number" + } + } + }, + "id": { + "args": { + "label": { + "type": "none" + }, + "tag": { + "type": "hidden" + } + } + } + }, + "field_names": [ + "scroll_id", + "panel_id", + "t", + "id" + ] + }, + "comic": { + "fields": { + "title": { + "args": { + "label": { + "args": { + "row_break": true + } + }, + "tag": { + "type": "text" + }, + "row_break": true + } + }, + "description": { + "args": { + "label": { + "args": { + "row_break": true + } + }, + "tag": { + "type": "text_area" + } + } + }, + "visible": { + "args": { + "tag": { + "type": "select" + }, + "row_break": true + } + }, + "id": { + "args": { + "label": { + "type": "none" + }, + "tag": { + "type": "hidden" + } + } + }, + "author_id": { + "args": { + "label": { + "type": "none" + }, + "tag": { + "type": "hidden" + } + } + } + }, + "field_names": [ + "title", + "description", + "visible", + "id", + "author_id" + ] + }, + "story": { + "fields": { + "comic_id": { + "args": { + "label": { + "type": "none" + }, + "tag": { + "type": "hidden" + } + } + }, + "title": { + "args": { + "label": { + "args": { + "row_break": true + } + }, + "tag": { + "type": "text" + }, + "row_break": true + } + }, + "description": { + "args": { + "label": { + "args": { + "row_break": true + } + }, + "tag": { + "type": "text_area" + }, + "row_break": true + } + }, + "visible": { + "args": { + "tag": { + "type": "select" + }, + "row_break": true + } + }, + "t": { + "args": { + "tag": { + "type": "number" + } + } + }, + "id": { + "args": { + "label": { + "type": "none" + }, + "tag": { + "type": "hidden" + } + } + }, + "author_id": { + "args": { + "label": { + "type": "none" + }, + "tag": { + "type": "hidden" + } + } + } + }, + "field_names": [ + "comic_id", + "title", + "description", + "visible", + "t", + "id", + "author_id" + ] + }, + "story_sheet": { + "fields": { + "story_id": { + "args": { + "label": { + "type": "none" + }, + "tag": { + "type": "number" + } + } + }, + "sheet_id": { + "args": { + "label": { + "type": "none" + }, + "tag": { + "type": "number" + } + } + }, + "t": { + "args": { + "tag": { + "type": "number" + } + } + }, + "id": { + "args": { + "label": { + "type": "none" + }, + "tag": { + "type": "hidden" + } + } + } + }, + "field_names": [ + "story_id", + "sheet_id", + "t", + "id" + ] + }, + "sheet": { + "fields": { + "caption": { + "args": { + "label": { + "args": { + "row_break": true + } + }, + "tag": { + "type": "text" + }, + "row_break": true + } + }, + "width": { + "args": { + "tag": { + "type": "number" + } + } + }, + "height": { + "args": { + "tag": { + "type": "number" + }, + "row_break": true + } + }, + "visible": { + "args": { + "tag": { + "type": "select" + }, + "row_break": true + } + }, + "id": { + "args": { + "label": { + "type": "none" + }, + "tag": { + "type": "hidden" + } + } + }, + "author_id": { + "args": { + "label": { + "type": "none" + }, + "tag": { + "type": "hidden" + } + } + } + }, + "field_names": [ + "caption", + "width", + "height", + "visible", + "id", + "author_id" + ] + }, + "sheet_panel": { + "fields": { + "sheet_id": { + "args": { + "tag": { + "type": "number" + } + } + }, + "panel_id": { + "args": { + "tag": { + "type": "number" + } + } + }, + "x": { + "args": { + "tag": { + "type": "number" + } + } + }, + "y": { + "args": { + "tag": { + "type": "number" + }, + "row_break": true + } + }, + "z": { + "args": { + "label": { + "type": "none" + }, + "tag": { + "type": "hidden" + } + } + }, + "t": { + "args": { + "label": { + "type": "none" + }, + "tag": { + "type": "hidden" + } + } + }, + "id": { + "args": { + "label": { + "type": "none" + }, + "tag": { + "type": "hidden" + } + } + } + }, + "field_names": [ + "sheet_id", + "panel_id", + "x", + "y", + "z", + "t", + "id" + ] + }, + "panel": { + "fields": { + "caption": { + "args": { + "tag": { + "type": "text" + }, + "row_break": true + } + }, + "width": { + "args": { + "tag": { + "type": "number" + } + } + }, + "height": { + "args": { + "tag": { + "type": "number" + }, + "row_break": true + } + }, + "border": { + "args": { + "tag": { + "type": "number" + } + } + }, + "publish": { + "args": { + "tag": { + "type": "select" + }, + "row_break": true + } + }, + "id": { + "args": { + "label": { + "type": "none" + }, + "tag": { + "type": "hidden" + } + } + }, + "author_id": { + "args": { + "label": { + "type": "none" + }, + "tag": { + "type": "hidden" + } + } + } + }, + "field_names": [ + "caption", + "width", + "height", + "border", + "publish", + "id", + "author_id" + ] + }, + "panel_picture": { + "fields": { + "caption": { + "args": { + "tag": { + "type": "text" + }, + "row_break": true + } + }, + "x": { + "args": { + "tag": { + "type": "number" + } + } + }, + "y": { + "args": { + "tag": { + "type": "number" + }, + "row_break": true + } + }, + "width": { + "args": { + "tag": { + "type": "number" + }, + "helpers": { + "size": { + "type": "size", + "args": { + "dom_class": "panel_picture_width_tool" + } + } + }, + "row_break": true + } + }, + "height": { + "args": { + "tag": { + "type": "number" + }, + "helpers": { + "size": { + "type": "size", + "args": { + "dom_class": "panel_picture_height_tool" + } + } + }, + "row_break": true + } + }, + "link": { + "args": { + "tag": { + "type": "text" + }, + "row_break": true + } + }, + "id": { + "args": { + "label": { + "type": "none" + }, + "tag": { + "type": "hidden" + } + } + }, + "panel_id": { + "args": { + "label": { + "type": "none" + }, + "tag": { + "type": "hidden" + } + } + }, + "picture_id": { + "args": { + "tag": { + "type": "hidden" + }, + "helpers": { + "popup": { + "type": "popup", + "args": { + "source": "pictures" + } + } + } + } + }, + "z": { + "args": { + "label": { + "type": "none" + }, + "tag": { + "type": "hidden" + } + } + }, + "t": { + "args": { + "label": { + "type": "none" + }, + "tag": { + "type": "hidden" + } + } + } + }, + "field_names": [ + "caption", + "x", + "y", + "width", + "height", + "link", + "id", + "panel_id", + "picture_id", + "z", + "t" + ] + }, + "speech_balloon": { + "fields": { + "speech_balloon.id": { + "args": { + "label": { + "type": "none" + }, + "tag": { + "type": "hidden" + } + } + }, + "speech_balloon.panel_id": { + "args": { + "label": { + "type": "none" + }, + "tag": { + "type": "hidden" + } + } + }, + "speech_balloon.speech_balloon_template_id": { + "args": { + "label": { + "type": "none" + }, + "tag": { + "type": "hidden" + } + } + }, + "speech_balloon.caption": { + "args": { + "tag": { + "type": "text" + }, + "row_break": true + } + }, + "speech_balloon.z": { + "args": { + "label": { + "type": "none" + }, + "tag": { + "type": "hidden" + } + } + }, + "speech_balloon.t": { + "args": { + "label": { + "type": "none" + }, + "tag": { + "type": "hidden" + } + } + }, + "speech_balloon.classname": { + "args": { + "label": { + "type": "none" + }, + "tag": { + "type": "hidden" + } + } + }, + "speech_balloon.settings": { + "args": { + "label": { + "type": "none" + }, + "tag": { + "type": "hidden" + } + } + }, + "balloon.id": { + "type": "part", + "args": { + "label": { + "type": "none" + }, + "tag": { + "type": "hidden" + } + } + }, + "balloon.speech_balloon_id": { + "type": "part", + "args": { + "label": { + "type": "none" + }, + "tag": { + "type": "hidden" + } + } + }, + "balloon.system_picture_id": { + "type": "part", + "args": { + "label": { + "type": "none" + }, + "tag": { + "type": "hidden" + } + } + }, + "balloon.r": { + "type": "part", + "args": { + "tag": { + "type": "number" + }, + "helpers": { + "tail_angle": { + "type": "size", + "args": {} + } + }, + "row_break": true + } + }, + "balloon.x": { + "type": "part", + "args": { + "tag": { + "type": "number" + } + } + }, + "balloon.y": { + "type": "part", + "args": { + "label": {}, + "tag": { + "type": "number" + }, + "row_break": true + } + }, + "balloon.width": { + "type": "part", + "args": { + "tag": { + "type": "number" + } + } + }, + "balloon.height": { + "type": "part", + "args": { + "tag": { + "type": "number" + }, + "row_break": true + } + }, + "balloon.settings": { + "type": "part", + "args": { + "label": { + "type": "none" + }, + "tag": { + "type": "hidden" + } + } + }, + "speech.id": { + "type": "part", + "args": { + "label": { + "type": "none" + }, + "tag": { + "type": "hidden" + } + } + }, + "speech.speech_balloon_id": { + "type": "part", + "args": { + "label": { + "type": "none" + }, + "tag": { + "type": "hidden" + } + } + }, + "speech.x": { + "type": "part", + "args": { + "label": { + "type": "none" + }, + "tag": { + "type": "hidden" + } + } + }, + "speech.y": { + "type": "part", + "args": { + "label": { + "type": "none" + }, + "tag": { + "type": "hidden" + } + } + }, + "speech.width": { + "type": "part", + "args": { + "label": { + "type": "none" + }, + "tag": { + "type": "hidden" + } + } + }, + "speech.height": { + "type": "part", + "args": { + "label": { + "type": "none" + }, + "tag": { + "type": "hidden" + } + } + }, + "speech.writing_format_id": { + "type": "part", + "args": { + "tag": { + "type": "select" + } + } + }, + "speech.font_size": { + "type": "part", + "args": { + "tag": { + "type": "select" + }, + "row_break": true + } + }, + "speech.text_align": { + "type": "part", + "args": { + "tag": { + "type": "select" + } + } + }, + "speech.quotes": { + "type": "part", + "args": { + "tag": { + "type": "text" + } + } + }, + "speech.content": { + "type": "part", + "args": { + "label": { + "args": { + "row_break": true + } + }, + "tag": { + "type": "text_area", + "args": { + "options": { + "size": "45x5" + } + } + } + } + }, + "speech.fore_color": { + "type": "part", + "args": { + "label": { + "row_break": true + }, + "tag": { + "type": "hidden" + }, + "helpers": { + "color": { + "type": "color", + "args": { + "wrapper": "speech-fore_color-wrap" + } + } + } + } + }, + "speech.settings": { + "type": "part", + "args": { + "label": { + "type": "none" + }, + "tag": { + "type": "hidden" + } + } + } + } + }, + "ground_picture": { + "fields": { + "id": { + "args": { + "label": { + "type": "none" + }, + "tag": { + "type": "hidden" + } + } + }, + "panel_id": { + "args": { + "label": { + "type": "none" + }, + "tag": { + "type": "hidden" + } + } + }, + "picture_id": { + "args": { + "label": { + "type": "none" + }, + "tag": { + "type": "hidden" + } + } + }, + "caption": { + "args": { + "tag": { + "type": "text" + }, + "row_break": true + } + }, + "repeat": { + "args": { + "tag": { + "type": "select", + "args": { + "source": "magic_number", + "key": "ground_picture_repeat_items" + } + }, + "row_break": true + } + }, + "x": { + "args": { + "tag": { + "type": "number" + } + } + }, + "y": { + "args": { + "tag": { + "type": "number" + }, + "row_break": true + } + }, + "z": { + "args": { + "label": { + "type": "none" + }, + "tag": { + "type": "hidden" + } + } + }, + "t": { + "args": { + "label": { + "type": "none" + }, + "tag": { + "type": "hidden" + } + } + } + }, + "field_names": [ + "caption", + "repeat", + "x", + "y", + "z", + "t", + "id", + "panel_id", + "picture_id" + ] + }, + "ground_color": { + "fields": { + "id": { + "args": { + "label": { + "type": "none" + }, + "tag": { + "type": "hidden" + } + } + }, + "panel_id": { + "args": { + "label": { + "type": "none" + }, + "tag": { + "type": "hidden" + } + } + }, + "caption": { + "args": { + "tag": { + "type": "text" + }, + "row_break": true + } + }, + "code": { + "args": { + "label": { + "args": { + "row_break": true + } + }, + "tag": { + "type": "hidden" + }, + "helpers": { + "color": { + "type": "color", + "args": { + "wrapper": "ground_color-code-wrap" + } + } + }, + "row_break": true + } + }, + "orientation": { + "args": { + "tag": { + "type": "select" + }, + "row_break": true + } + }, + "xy": { + "args": { + "tag": { + "type": "number" + } + } + }, + "wh": { + "args": { + "tag": { + "type": "number" + }, + "row_break": true + } + }, + "z": { + "args": { + "label": { + "type": "none" + }, + "tag": { + "type": "hidden" + } + } + }, + "t": { + "args": { + "label": { + "type": "none" + }, + "tag": { + "type": "hidden" + } + } + } + }, + "field_names": [ + "id", + "panel_id", + "caption", + "code", + "orientation", + "xy", + "wh", + "z", + "t" + ] + }, + "author": { + "fields": { + "id": { + "args": { + "label": { + "type": "none" + }, + "tag": { + "type": "hidden" + } + } + }, + "name": { + "args": { + "label": { + "args": { + "row_break": true + } + }, + "tag": { + "type": "text" + }, + "row_break": true + } + } + }, + "field_names": [ + "id", + "name" + ] + }, + "artist": { + "fields": { + "id": { + "args": { + "label": { + "type": "none" + }, + "tag": { + "type": "hidden" + } + } + }, + "name": { + "args": { + "label": { + "args": { + "row_break": true + } + }, + "tag": { + "type": "text" + }, + "row_break": true + } + } + }, + "field_names": [ + "id", + "name" + ] + } + }, + "extend": { + "CircleSpeechBalloon": { + "base": "speech_balloon", + "fields": {}, + "field_names": [ + "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": { + "base": "speech_balloon", + "fields": { + "balloon.r": { + "type": "part", + "args": { + "label": { + "type": "none" + }, + "tag": { + "type": "hidden" + } + } + } + }, + "field_names": [ + "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": { + "base": "speech_balloon", + "fields": { + "balloon.r": { + "type": "part", + "args": { + "label": { + "type": "none" + }, + "tag": { + "type": "hidden" + } + } + } + }, + "field_names": [ + "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" + ] + } + } + } +} \ No newline at end of file -- 2.11.0