OSDN Git Service

Merge branch 'v06' of git.sourceforge.jp:/gitroot/pettanr/pettanr into v06
authoryasushiito <yas@pen-chan.jp>
Tue, 4 Nov 2014 07:35:23 +0000 (16:35 +0900)
committeryasushiito <yas@pen-chan.jp>
Tue, 4 Nov 2014 07:35:23 +0000 (16:35 +0900)
147 files changed:
app/assets/javascripts/ap.js
app/assets/javascripts/local_manifest/filer/symbol/default/link/action.js.coffee
app/assets/javascripts/local_manifest/form/field.js.coffee
app/assets/javascripts/local_manifest/form/field/label/base.js.coffee
app/assets/javascripts/local_manifest/list_group.js.coffee
app/assets/javascripts/local_manifest/list_group/list/base.js.coffee
app/assets/javascripts/local_manifest/profiler/association/belongs_to.js.coffee
app/assets/javascripts/local_manifest/profiler/association/has_many.js.coffee
app/assets/javascripts/local_manifest/profiler/association/has_one.js.coffee
app/assets/javascripts/local_manifest/profiler/list.js.coffee
app/assets/javascripts/locmare/booster.js.coffee
app/assets/javascripts/locmare/filer/body/file_body/file_item/icon/default.js.coffee
app/assets/javascripts/locmare/form.js.coffee
app/assets/javascripts/locmare/form/extend_field.js.coffee
app/assets/javascripts/locmare/form/field/label/label.js.coffee
app/assets/javascripts/locmare/form/field/tag/base.js.coffee
app/assets/javascripts/locmare/form/field/tag/select.js.coffee
app/assets/javascripts/locmare/list_group.js.coffee
app/assets/javascripts/locmare/list_group/list/base.js.coffee
app/assets/javascripts/locmare/profiler/association/belongs_to.js.coffee
app/assets/javascripts/locmare/profiler/association/has_many.js.coffee
app/assets/javascripts/locmare/profiler/association/has_one.js.coffee
app/assets/javascripts/locmare/profiler/column/base.js.coffee
app/assets/javascripts/manifest/controller.js.coffee
app/assets/javascripts/manifest/controller/action/base.js.coffee
app/assets/javascripts/manifest/controller/action/count.js.coffee
app/assets/javascripts/manifest/controller/action/list.js.coffee
app/assets/javascripts/manifest/item/base.js.coffee
app/assets/javascripts/manifest/item/element.js.coffee
app/assets/javascripts/manifest/item/leaf.js.coffee
app/assets/javascripts/manifest/manifest.js.coffee
app/assets/javascripts/manifest/model.js.coffee
app/assets/javascripts/manifest/model/association.js.coffee
app/assets/javascripts/manifest/model/association/belongs_to.js.coffee
app/assets/javascripts/manifest/model/association/has_many.js.coffee
app/assets/javascripts/manifest/model/association/has_one.js.coffee
app/assets/javascripts/manifest/model/attribute.js.coffee
app/assets/javascripts/manifest/model/attribute/source/base.js.coffee
app/assets/javascripts/manifest/model/attribute/source/model.js.coffee
app/assets/javascripts/manifest/model/list.js.coffee [deleted file]
app/assets/javascripts/peta/item.js.coffee
app/assets/javascripts/pettanr.js.coffee
app/assets/javascripts/system.js.coffee
app/assets/javascripts/work/controllers.js.coffee.erb
app/assets/javascripts/work/inflectors.js.coffee.erb [new file with mode: 0644]
app/assets/javascripts/work/items.js.coffee.erb
app/assets/javascripts/work/list_groups.js.coffee.erb
app/assets/javascripts/work/models.js.coffee.erb
app/assets/javascripts/work/profilers.js.coffee.erb
app/controllers/application_controller.rb
app/controllers/artists_controller.rb
app/controllers/authors_controller.rb
app/controllers/balloons_controller.rb
app/controllers/comic_stories_controller.rb
app/controllers/comics_controller.rb
app/controllers/folders_controller.rb
app/controllers/ground_colors_controller.rb
app/controllers/ground_pictures_controller.rb
app/controllers/license_groups_controller.rb
app/controllers/licenses_controller.rb
app/controllers/original_pictures_controller.rb
app/controllers/panel_pictures_controller.rb
app/controllers/panels_controller.rb
app/controllers/pictures_controller.rb
app/controllers/resource_pictures_controller.rb
app/controllers/scroll_panels_controller.rb
app/controllers/scrolls_controller.rb
app/controllers/sheet_panels_controller.rb
app/controllers/sheets_controller.rb
app/controllers/speech_balloon_templates_controller.rb
app/controllers/speech_balloons_controller.rb
app/controllers/speeches_controller.rb
app/controllers/stories_controller.rb
app/controllers/story_sheets_controller.rb
app/controllers/system_pictures_controller.rb
app/controllers/writing_formats_controller.rb
app/models/writing_format.rb
app/views/stories/play.html.erb
app/views/system/_filer.html.erb [deleted file]
app/views/system/_jfiler.html.erb [deleted file]
app/views/system/filer.html.erb [deleted file]
app/views/templates/r/filer/icon/_default.html.erb
app/views/templates/r/form/helper/_tail_angle_helper.html.erb
app/views/templates/r/form/tag/_select.html.erb
config/locales/pettanr.ja.yml
config/routes.rb
lib/local_manifest/filer/caption/default/link/link.rb
lib/local_manifest/filer/symbol/default/link/link.rb
lib/local_manifest/form/field.rb
lib/local_manifest/form/field/label/label.rb
lib/local_manifest/list_group.rb
lib/local_manifest/list_group/list/base.rb
lib/local_manifest/list_group/list/filter.rb
lib/local_manifest/list_group/list/order.rb [deleted file]
lib/local_manifest/list_group/list/order/auto.rb [deleted file]
lib/local_manifest/list_group/list/order/base.rb [deleted file]
lib/local_manifest/list_group/list/order/method.rb [deleted file]
lib/local_manifest/list_group/list/play.rb
lib/local_manifest/profiler/association/belongs_to.rb
lib/local_manifest/profiler/association/has_many.rb
lib/local_manifest/profiler/association/has_one.rb
lib/local_manifest/profiler/list.rb
lib/locmare/booster.rb
lib/locmare/filer/body/file_body/file_item/caption/default/link/link.rb
lib/locmare/filer/body/file_body/file_item/icon/icon.rb
lib/locmare/filer/body/file_body/file_item/symbol/default/link/link.rb
lib/locmare/form.rb
lib/locmare/form/extend_field.rb
lib/locmare/form/field/label/label.rb
lib/locmare/form/field/tag/base.rb
lib/locmare/form/field/tag/select.rb
lib/locmare/list_group.rb
lib/locmare/list_group/list/base.rb
lib/locmare/list_group/list/filter.rb
lib/locmare/list_group/list/foreign_filter.rb
lib/locmare/list_group/list/private.rb
lib/locmare/list_group/list/public.rb
lib/locmare/list_group/list/system_resource.rb
lib/locmare/list_group/list/through_filter.rb
lib/locmare/profiler/association/belongs_to.rb
lib/locmare/profiler/association/has_many.rb
lib/locmare/profiler/association/has_one.rb
lib/locmare/profiler/column/extend.rb
lib/manifest/controller.rb
lib/manifest/controller/action/base.rb
lib/manifest/controller/action/count.rb
lib/manifest/controller/action/list.rb
lib/manifest/item/base.rb
lib/manifest/item/element.rb
lib/manifest/item/leaf.rb
lib/manifest/manifest.rb
lib/manifest/model.rb
lib/manifest/model/association.rb
lib/manifest/model/association/belongs_to.rb
lib/manifest/model/association/has_many.rb
lib/manifest/model/association/has_one.rb
lib/manifest/model/attribute.rb
lib/manifest/model/attribute/source/base.rb
lib/manifest/model/attribute/source/model.rb
lib/manifest/model/list.rb [deleted file]
lib/manifest/system_resource.rb
lib/peta/content.rb
lib/peta/element.rb
lib/peta/item.rb
lib/peta/leaf.rb
public/local_manifest.json
public/manifest.json

index d768012..92d5646 100644 (file)
@@ -62,7 +62,6 @@
 //= require ./manifest/model/association/belongs_to
 //= require ./manifest/model/association/has_many
 //= require ./manifest/model/association/has_one
-//= require ./manifest/model/list
 //= require ./local_manifest/local_manifest
 //= require ./local_manifest/profiler
 //= require ./local_manifest/profiler/column
index fdc3fa3..4275552 100644 (file)
@@ -8,10 +8,3 @@ class LocalManifest.FilerModule.SymbolModule.DefaultModule.LinkModule.ActionLink
     super()\r
     @action_name = @args['action_name']\r
   \r
-  action_path: () ->\r
-    a = if @action_name == 'show'\r
-      ''\r
-    else\r
-      @action_name + '/'\r
-    '/' + this.filer().item_class.path_name() + '/' + a\r
-  \r
index f1c5792..55f37f5 100644 (file)
@@ -24,7 +24,7 @@ class LocalManifest.FormModule.Field extends ManifestBase.NameValues
   column_name: () ->\r
     @name\r
   \r
-  model_name: () ->\r
+  item_name: () ->\r
     @form_name()\r
   \r
   form: () ->\r
index a67c204..f5266a1 100644 (file)
@@ -14,7 +14,7 @@ class LocalManifest.FormModule.FieldModule.LabelModule.Base extends ManifestBase
   field_name: () ->\r
     @parent.name\r
   \r
-  model_name: () ->\r
+  item_name: () ->\r
     @form_name()\r
   \r
   column_name: () ->\r
index e8c316b..e78efb3 100644 (file)
@@ -2,16 +2,15 @@ class LocalManifest.ListGroup extends ManifestBase.Base
   \r
   set_default: () ->\r
     super()\r
-    @json\r
     @json.lists ||= {}\r
-    #@json.item_name = Manifest.manifest().inflectors[@name]\r
-    @json.item_name = @name\r
-    \r
+  \r
   init: () ->\r
     super()\r
-    @item_name = @json.item_name\r
     @lists = ManifestBase.load_type_name_args this, @json, 'lists', LocalManifest.ListGroupModule.ListFactory\r
   \r
+  controller_name: () ->\r
+    @name\r
+  \r
   constructor: (manifest, name, json, module_name) ->\r
     super(manifest, name, json, module_name)\r
     \r
index 1f2c6a7..5dd5d99 100644 (file)
@@ -10,7 +10,17 @@ class LocalManifest.ListGroupModule.ListModule.Base extends ManifestBase.TypeNam
     @model = Manifest.item_name_to_model @item_name()\r
   \r
   item_name: () ->\r
-    @parent.item_name\r
+    @action_manifest().item_name\r
+  \r
+  action_manifest: () ->\r
+    c = Manifest.manifest().controllers[@controller_name()]\r
+    c.actions[@action_name()]\r
+  \r
+  action_name: () ->\r
+    @name\r
+  \r
+  controller_name: () ->\r
+    @parent.controller_name()\r
   \r
   list_group: () ->\r
     @parent\r
index b69bf14..c5a0938 100644 (file)
@@ -5,10 +5,10 @@ class LocalManifest.ProfilerModule.AssociationModule.BelongsTo extends ManifestB
     \r
   init: () ->\r
     super()\r
-    @model_name = @name\r
+    @item_name = @name\r
   \r
   model: () ->\r
-    Manifest.item_name_to_model @model_name\r
+    Manifest.item_name_to_model @item_name\r
   \r
   association_name: () ->\r
     @parent.name\r
index 15ca37d..6da3c51 100644 (file)
@@ -6,26 +6,19 @@ class LocalManifest.ProfilerModule.AssociationModule.HasMany extends ManifestBas
   init: () ->\r
     super()\r
     if list_manifest = @profiler().lists[@name]\r
-      @model_name = list_manifest.model_name\r
-      @list_name = list_manifest.list_name\r
+      @controller_name = list_manifest.controller_name\r
+      @action_name = list_manifest.action_name\r
     else\r
       n = @name.split '.'\r
       if n.length > 1\r
-        @table_name = n[0]\r
-        @item_name = Manifest.manifest().controllers[@table_name].item_name\r
-        @model_name = @item_name\r
-        @list_name = n[1]\r
+        @controller_name = n[0]\r
+        @action_name = n[1]\r
       else\r
         ManifestBase.alert_undefined_message 'list', this.module_message\r
   \r
-  list_options: (id) ->\r
-    params = {controller: @table_name, action: @list_name, id: id, page: 1, page_size: 3}\r
-    cm = Manifest.manifest().controllers[@table_name]\r
-    am = cm.actions[@list_name]\r
-    {model: @model(), action: am, params: params}\r
-  \r
   model: () ->\r
-    Manifest.item_name_to_model @model_name\r
+    item_name = Manifest.manifest().controllers[@controller_name].actions[@action_name].item_name\r
+    Manifest.item_name_to_model item_name\r
   \r
   association_name: () ->\r
     @parent.association_name\r
index 7c56cff..03bdba3 100644 (file)
@@ -6,25 +6,19 @@ class LocalManifest.ProfilerModule.AssociationModule.HasOne extends ManifestBase
   init: () ->\r
     super()\r
     if list_manifest = @profiler().lists[@name]\r
-      @model_name = @parent.model_name\r
-      @list_name = @parent.list_name\r
+      @controller_name = list_manifest.controller_name\r
+      @action_name = list_manifest.action_name\r
     else\r
       n = @name.split '.'\r
       if n.length > 1\r
-        @model_name = n[0]\r
-        @list_name = n[1]\r
+        @controller_name = n[0]\r
+        @action_name = n[1]\r
       else\r
-        ManifestBase.alert_undefined_message 'list', @module_message\r
-    @table_name = @model().table_name()\r
-  \r
-  list_options: (id) ->\r
-    params = {controller: @table_name, action: @list_name, id: id, page: 1, page_size: 3}\r
-    cm = Manifest.manifest().controllers[@table_name]\r
-    am = cm.actions[@list_name]\r
-    {model: @model(), action: am, params: params}\r
+        ManifestBase.alert_undefined_message 'list', this.module_message\r
   \r
   model: () ->\r
-    Manifest.item_name_to_model @model_name\r
+    item_name = Manifest.manifest().controllers[@controller_name].actions[@action_name].item_name\r
+    Manifest.item_name_to_model item_name\r
   \r
   association_name: () ->\r
     @parent.association_name\r
index fef2a74..6866f28 100644 (file)
@@ -2,13 +2,13 @@ class LocalManifest.ProfilerModule.List extends ManifestBase.NameValues
   \r
   set_default: () ->\r
     super()\r
-    ManifestBase.alert_undefined_message "model_name", this.module_message if not @json['model_name']\r
-    ManifestBase.alert_undefined_message "list_name", this.module_message if not @json['list_name']\r
+    ManifestBase.alert_undefined_message "controller_name", this.module_message if not @json['controller_name']\r
+    ManifestBase.alert_undefined_message "action_name", this.module_message if not @json['action_name']\r
     \r
   init: () ->\r
     super()\r
-    @model_name = @json['model_name']\r
-    @list_name = @json['list_name']\r
+    @model_name = @json['controller_name']\r
+    @list_name = @json['action_name']\r
   \r
   profiler_name: () ->\r
     @parent.item_name\r
index 815acdf..93f716d 100644 (file)
@@ -17,7 +17,7 @@ class Locmare.Booster
   template_manifest: () ->\r
     Manifest.manifest().system_resources.templates[@manifest.template_name]\r
   \r
-  model_name: () ->\r
+  item_name: () ->\r
     @template_path_name() + '_' + @manifest.item_name_for_extend_model\r
   \r
   is_enable: () ->\r
index 3109c01..43031f8 100644 (file)
@@ -11,7 +11,7 @@ class Locmare.FilerModule.BodyModule.FileBodyModule.FileItemModule.IconItemColum
       }\r
     })\r
     a = new Tag.A({\r
-      attr: {href: @path_name()}, \r
+      attr: {href: @url()}, \r
       content: icon.render().el\r
     })\r
     this.$el.html(a.render().el)\r
@@ -20,11 +20,16 @@ class Locmare.FilerModule.BodyModule.FileBodyModule.FileItemModule.IconItemColum
     })\r
     this\r
   \r
-  path_name: () ->\r
-    '/' + @manifest().item_class.path_name() + '/' + @item.get('id').toString() + '.prof'\r
-  \r
-  item_template_file_name: () ->\r
-    'default'\r
+  url: () ->\r
+    controller = Manifest.manifest().controllers[@item.table_name()]\r
+    action = controller.actions['show']\r
+    params = {\r
+      controller: controller,\r
+      action: action,\r
+      id: @item.get('id'),\r
+      format: 'prof'\r
+    }\r
+    '/' + action.url(params)\r
   \r
   icon_file_name: () ->\r
     '/images/prof.gif'\r
index 27ccbb0..bd2c9e5 100644 (file)
@@ -80,7 +80,7 @@ class Locmare.Form extends Locmare.FormBase
       else\r
         null\r
       if boost_name and extend_model # field is extend setting AND template has a extend model\r
-        extend_form_name = _this.item.boosters[boost_name].model_name()\r
+        extend_form_name = _this.item.boosters[boost_name].item_name()\r
         extend_item = _this.item.boosters[boost_name].extend_item()\r
         _this.fields[field_name] = new Locmare.ExtendForm({\r
           parent: _this, \r
index 99f1507..492685d 100644 (file)
@@ -13,7 +13,7 @@ class Locmare.FormModule.ExtendField extends Backbone.View
     _.each @field_manifest.helpers, (helper_manifest, helper_name) ->\r
       _this.helpers[helper_name] = Locmare.FormModule.FieldModule.HelperFactory.factory(_this, helper_manifest)\r
     @rb = @row_break()\r
-    @options = {'data-model': @field_manifest.model_name}\r
+    @options = {'data-model': @field_manifest.item_name()}\r
   \r
   render: () ->\r
     this.$el.html('')\r
index 06d2d1c..e5d9a39 100644 (file)
@@ -19,7 +19,7 @@ class Locmare.FormModule.FieldModule.LabelModule.Base extends Backbone.View
     @form().item\r
   \r
   item_name: () ->\r
-    @label_manifest.model_name()\r
+    @label_manifest.item_name()\r
   \r
   column_name: () ->\r
     @label_manifest.column_name()\r
index b04e2ca..9f2e413 100644 (file)
@@ -32,9 +32,3 @@ class Locmare.FormModule.FieldModule.TagModule.Base extends Backbone.View
   item: () ->\r
     @form().item\r
   \r
-  model_name: () ->\r
-    @tag_manifest.model_name()\r
-  \r
-  column_name: () ->\r
-    @tag_manifest.column_name()\r
-  \r
index 9983e7e..0a1eec3 100644 (file)
@@ -20,7 +20,7 @@ class Locmare.FormModule.FieldModule.TagModule.SelectTag extends Locmare.FormMod
     this\r
   \r
   model_manifest: () ->\r
-    Manifest.manifest().models[@field.field_manifest.model_name()]\r
+    Manifest.manifest().models[@field.field_manifest.item_name()]\r
   \r
   model_attribute_manifest: () ->\r
     @model_manifest().attributes[@field.field_manifest.column_name()]\r
@@ -28,7 +28,7 @@ class Locmare.FormModule.FieldModule.TagModule.SelectTag extends Locmare.FormMod
   select_item_name: () ->\r
     @model_attribute_manifest().source.select_item_name\r
   \r
-  source_by_model: () ->\r
+  source_by_filter: () ->\r
     switch @model_attribute_manifest().source.type\r
       when 'model', 'filter'\r
         true\r
@@ -41,17 +41,19 @@ class Locmare.FormModule.FieldModule.TagModule.SelectTag extends Locmare.FormMod
     @value() == member[1]\r
   \r
   select_values: (cb) ->\r
-    if @source_by_model()\r
-      resource_model_name = @model_attribute_manifest().source.resource_model_name\r
-      resource_list_name = @model_attribute_manifest().source.resource_list_name\r
-      caption_name = @model_attribute_manifest().source.caption_name\r
+    if @source_by_filter()\r
+      resource_item_name = @model_attribute_manifest().source.resource_item_name\r
+      resource_action_name = @model_attribute_manifest().source.resource_action_name\r
       filter_column_name = @model_attribute_manifest().source.filter_column_name\r
+      filter_id = @form().item.get(filter_column_name)\r
+      resource_controller_name = Manifest.manifest().models[resource_item_name].classify().table_name()\r
+      caption_name = @model_attribute_manifest().source.caption_name\r
       params = if filter_column_name\r
-        {id: @form().item.get(filter_column_name)}\r
+        {id: filter_id}\r
       else\r
         {}\r
-      list = Locmare.ListGroup.list(resource_model_name, resource_list_name)\r
-      list.open(@form().operators, params, list.action(), {}, (page_status) ->\r
+      list = Locmare.ListGroup.list(resource_model_name, resource_list_name, @form().operators, {})\r
+      list.open((page_status) ->\r
         members = _.map list.models, (member) ->\r
           [member.get(caption_name), member.get('id')]\r
         cb(members)\r
index ace81d7..c81199a 100644 (file)
@@ -10,10 +10,18 @@ class Locmare.ListGroup
       play: Locmare.ListGroupModule.PlayList\r
     }\r
   \r
-  @list: (item_name, list_name) ->\r
-    list_group_manifest = LocalManifest.manifest().list_groups[item_name]\r
-    list_manifest = list_group_manifest.lists[list_name]\r
-    c = Locmare.ListGroup.types()[list_manifest.type]\r
-    new c({item_name: item_name, list_name: list_name})\r
+  @list: (controller_name, action_name, operators, options = {}) ->\r
+    controller_manifest = Manifest.manifest().controllers[controller_name]\r
+    action_manifest = controller_manifest.actions[action_name]\r
+    if action_manifest.alias\r
+      options['order'] ||= action_manifest.order\r
+      options['direction'] ||= action_manifest.direction\r
+      alias_action = action_manifest.alias_action\r
+      Locmare.ListGroup.list(alias_action.path_name(), alias_action.name, operators, options)\r
+    else\r
+      list_group_manifest = LocalManifest.manifest().list_groups[controller_name]\r
+      list_manifest = list_group_manifest.lists[action_name]\r
+      c = Locmare.ListGroup.types()[list_manifest.type]\r
+      new c({list_group_name: controller_name, list_name: action_name, operators: operators, options: options})\r
   \r
 class Locmare.ListGroupModule\r
index 4fc3d30..b2683ed 100644 (file)
@@ -1,12 +1,20 @@
 class Locmare.ListGroupModule.Base extends Backbone.Collection\r
   \r
   initialize: (options) ->\r
-    @item_name = options.item_name\r
+    @list_group_name = options.list_group_name\r
     @list_name = options.list_name\r
-    @list_group_manifest = LocalManifest.manifest().list_groups[@item_name]\r
+    @operators = options.operators\r
+    @params = options.options\r
+    \r
+    @list_group_manifest = LocalManifest.manifest().list_groups[@list_group_name]\r
     @list_manifest = @list_group_manifest.lists[@list_name]\r
+    \r
+    @controller_name = @list_group_name\r
+    @action_name = @list_name\r
+    @controller_manifest = Manifest.manifest().controllers[@controller_name]\r
+    @action_manifest = @controller_manifest.actions[@action_name]\r
+    @item_name = @action_manifest.item_name\r
     @model_manifest = Manifest.manifest().models[@item_name]\r
-    @model_list_manifest = @model_manifest.list\r
     @model_class = Manifest.item_name_to_model @item_name\r
     @table_name = @model_class.table_name()\r
   \r
@@ -27,20 +35,22 @@ class Locmare.ListGroupModule.Base extends Backbone.Collection
   max_page_size: () ->\r
     @model_list_manifest.max_page_size\r
   \r
-  count: (operators, params, action) ->\r
-    new Pettanr.CounterModel({}, {url: '/' + action.counter_url(params)})\r
+  items: () ->\r
+    _this = this\r
+    _.map @models, (model) ->\r
+      new _this.model_class(model.attributes)\r
+  \r
+  count: () ->\r
+    new Pettanr.CounterModel({}, {url: '/' + @action_manifest.counter_url(@params)})\r
   \r
-  open: (operators, params, action, options, cb) ->\r
-    page = @page_number(params['page']) \r
-    page_size = @page_size(params['page_size'])\r
-    #offset = (page - 1) * page_size\r
-    #items = @items(operators, params, offset, page_size, action)\r
-    @url = '/' + action.url(params)\r
-    @model = Manifest.item_name_to_model action.item_name\r
+  open: (cb) ->\r
+    page = @params['page'] \r
+    page_size = @params['page_size'] \r
+    @url = '/' + @action_manifest.url(@params)\r
     _this = this\r
-    counter = new Locmare.ListGroupModule.Counter({}, {url: '/' + action.counter_url(params)})\r
+    counter = new Locmare.ListGroupModule.Counter({}, {url: '/' + @action_manifest.counter_url(@params)})\r
     counter.fetch({cache: true}).done ->\r
-      page_status = new Locmare.ListGroupModule.PageStatus(page, page_size, counter.count(), params)\r
+      page_status = new Locmare.ListGroupModule.PageStatus(page, page_size, counter.count(), _this.params)\r
       _this.fetch({cache: true}).done ->\r
         #_this.boost(items)\r
         cb(page_status)\r
index c9f53eb..d10b983 100644 (file)
@@ -34,7 +34,7 @@ class Locmare.ProfilerModule.AssociationModule.BelongsTo extends Backbone.View
     Manifest.manifest().models[@profiler().item_name]\r
   \r
   model_belongs_to_manifest: () ->\r
-    @model_manifest().associations.belongs_to[@belongs_to_manifest.model_name]\r
+    @model_manifest().associations.belongs_to[@belongs_to_manifest.item_name]\r
   \r
   profiler: () ->\r
     @association.profiler\r
index c0185a4..7e6d847 100644 (file)
@@ -5,15 +5,17 @@ class Locmare.ProfilerModule.AssociationModule.HasMany extends Backbone.View
     @association = options.association\r
     @has_many_manifest = options.has_many_manifest\r
     @filer = null\r
-    controller = Manifest.manifest().controllers[@has_many_manifest.table_name]\r
-    action = controller.actions[@has_many_manifest.list_name]\r
-    @list = Locmare.ListGroup.list(@has_many_manifest.item_name, @has_many_manifest.list_name)\r
-    params = {id: @item().get('id'), page: 1, page_size: 3}\r
+    controller = Manifest.manifest().controllers[@has_many_manifest.controller_name]\r
+    action = controller.actions[@has_many_manifest.action_name]\r
+    @list = Locmare.ListGroup.list(\r
+      action.path_name(), action.name, \r
+      @profiler().operators, {id: @item().get('id'), page: 1, page_size: 3}\r
+    )\r
     _this = this\r
-    @list.open(@profiler().operators, params, action, {}, (page_status) ->\r
+    @list.open((page_status) ->\r
       _this.filer = new Locmare.Filer({\r
         item_name: _this.has_many_model().item_name(), \r
-        items: _this.list.models\r
+        items: _this.list.items()\r
         pager: _this.pager, \r
         operators: _this.profiler().operators\r
       })\r
index 8ddd7fb..7ea42b4 100644 (file)
@@ -5,15 +5,17 @@ class Locmare.ProfilerModule.AssociationModule.HasOne extends Backbone.View
     @association = options.association\r
     @has_one_manifest = options.has_one_manifest\r
     @filer = null\r
-    controller = Manifest.manifest().controllers[@has_one_manifest.table_name]\r
-    action = controller.actions[@has_one_manifest.list_name]\r
-    @list = Locmare.ListGroup.list(@has_one_manifest.item_name, @has_one_manifest.list_name)\r
-    params = {id: @item().get('id')}\r
+    controller = Manifest.manifest().controllers[@has_one_manifest.controller_name]\r
+    action = controller.actions[@has_one_manifest.action_name]\r
+    @list = Locmare.ListGroup.list(\r
+      action.path_name(), action.name, \r
+      @profiler().operators, {id: @item().get('id')}\r
+    )\r
     _this = this\r
-    @list.open(@profiler().operators, params, action, {}, (page_status) ->\r
+    @list.open((page_status) ->\r
       _this.filer = new Locmare.Filer({\r
         item_name: _this.has_one_model().item_name(), \r
-        items: _this.list.models\r
+        items: _this.list.items()\r
         pager: _this.pager, \r
         operators: _this.profiler().operators\r
       })\r
index f4083ce..9b97ffa 100644 (file)
@@ -113,7 +113,7 @@ class Locmare.ProfilerModule.ColumnModule.ExtendValue extends Backbone.View
       _this.columns[column_name]\r
   \r
   extend_settings: () ->\r
-    @template_model_profiler().extend_settings[@booster().model_name()]\r
+    @template_model_profiler().extend_settings[@booster().item_name()]\r
   \r
   template_model_profiler: () ->\r
     LocalManifest.manifest().profilers[@template_model().item_name()]\r
index 3b5b84e..5177e9f 100644 (file)
@@ -2,13 +2,10 @@ class Manifest.Controller extends ManifestBase.Base
   \r
   set_default: () ->\r
     super()\r
-    @json\r
     @json.actions ||= {}\r
-    @json.item_name ||= @name\r
     \r
   init: () ->\r
     super()\r
-    @item_name = @json.item_name\r
     @actions = ManifestBase.load_type_name_args this, @json, 'actions', Manifest.ControllerModule.ActionFactory\r
   \r
   constructor: (manifest, name, json, module_name) ->\r
index 8dc8be2..6e4df9a 100644 (file)
@@ -2,7 +2,7 @@ class Manifest.ControllerModule.ActionModule.Base extends ManifestBase.TypeNameA
   \r
   set_default: () ->\r
     super()\r
-    @args.item_name ||= @parent.item_name  # not parent.name. follow singularized name\r
+    @args.item_name ||= Manifest.manifest().singularize(@parent.name)\r
     @args.param_id ||= 'prefix'\r
     \r
   init: () ->\r
@@ -10,6 +10,10 @@ class Manifest.ControllerModule.ActionModule.Base extends ManifestBase.TypeNameA
     @item_name = @args.item_name\r
     @param_id = @args.param_id\r
   \r
+  path_name: () ->\r
+    @parent.name\r
+    #Manifest.manifest().pluralize(@item_name)\r
+  \r
   encode_query: (params) ->\r
     q = []\r
     q.push('page=' + Pettanr.to_s(params['page'])) if params['page']\r
@@ -20,7 +24,8 @@ class Manifest.ControllerModule.ActionModule.Base extends ManifestBase.TypeNameA
       ''\r
   \r
   encode_url: (action_name, params) ->\r
-    c = Manifest.manifest().models[@item_name].table_name\r
+    controller_name = @path_name()\r
+    c = controller_name\r
     a = if action_name == 'index' or action_name == 'show' or action_name == 'destroy'\r
       ''\r
     else\r
index 8fd2215..6f4f27e 100644 (file)
@@ -2,9 +2,9 @@ class Manifest.ControllerModule.ActionModule.ActionCount extends Manifest.Contro
   \r
   set_default: () ->\r
     super()\r
-    @args.list_name ||= @name.replace(/^count_/, '')\r
+    @args.action_name ||= @name.replace(/^count_/, '')\r
     \r
   init: () ->\r
     super()\r
-    @list_name = @args.list_name\r
+    @action_name = @args.action_name\r
   \r
index 55226df..4368d1b 100644 (file)
@@ -2,11 +2,17 @@ class Manifest.ControllerModule.ActionModule.ActionList extends Manifest.Control
   \r
   set_default: () ->\r
     super()\r
-    @args.list_name ||= @name\r
+    @args.direction ||= -1\r
+    @args.default_page_size ||= 25\r
+    @args.max_page_size ||= 100\r
   \r
   init: () ->\r
     super()\r
-    @list_name = @args.list_name\r
+    @alias = @args.alias\r
+    @order = @args.order || 'updated_at'\r
+    @direction = @args.direction\r
+    @default_page_size = @args.default_page_size\r
+    @max_page_size = @args.max_page_size\r
     @counter_name = if @args.counter_name\r
       @args.counter_name\r
     else\r
@@ -15,6 +21,11 @@ class Manifest.ControllerModule.ActionModule.ActionList extends Manifest.Control
       else\r
         'count_' + @name\r
   \r
+  alias_action: () ->\r
+    s = @alias.split('.')\r
+    c = Manifest.manifest().controllers[s[0]]\r
+    c.actions[s[1]]\r
+  \r
   counter_url: (params) ->\r
     @encode_url(@counter_name, params)\r
     \r
index 27b7048..ea19f71 100644 (file)
@@ -6,11 +6,11 @@ class Manifest.ItemModule.BasePeta extends ManifestBase.TypeNameArgs
     \r
   init: () ->\r
     super()\r
-    @parent_model_name = null  # init at leaf, element\r
+    @parent_item_name = null  # init at leaf, element\r
     @boost = ManifestBase.load_name_values(this, @args, 'boost', Manifest.ItemModule.Boost)\r
   \r
   is_element: () ->\r
-    @parent_model_name != null\r
+    @parent_item_name != null\r
   \r
   find_boost_name: (column_name) -> \r
     r = null\r
index 0288b9b..4f28ba2 100644 (file)
@@ -2,9 +2,9 @@ class Manifest.ItemModule.ElementPeta extends Manifest.ItemModule.BasePeta
   \r
   set_default: () ->\r
     super()\r
-    ManifestBase.alert_undefined_message('parent_model_name', @module_message()) if not @args['parent_model_name']\r
+    ManifestBase.alert_undefined_message('parent_item_name', @module_message()) if not @args['parent_item_name']\r
     \r
   init: () ->\r
     super()\r
-    @parent_model_name = @args['parent_model_name']\r
+    @parent_item_name = @args['parent_item_name']\r
   \r
index 360b7bb..1cf73ca 100644 (file)
@@ -2,10 +2,10 @@ class Manifest.ItemModule.LeafPeta extends Manifest.ItemModule.BasePeta
   \r
   set_default: () ->\r
     super()\r
-    ManifestBase.alert_undefined_message('parent_model_name', @module_message()) if not @args['parent_model_name']\r
+    ManifestBase.alert_undefined_message('parent_item_name', @module_message()) if not @args['parent_item_name']\r
     \r
   init: () ->\r
     super()\r
-    @parent_model_name = @args['parent_model_name']\r
-    @destination_model_name = @args['destination_model_name']\r
+    @parent_item_name = @args['parent_item_name']\r
+    @destination_item_name = @args['destination_item_name']\r
   \r
index 77c1aba..eae9e96 100644 (file)
@@ -6,22 +6,27 @@ class Manifest
   \r
   init: () ->\r
     # managers can't initialize before load  application.rb\r
+    @inflectors = @global_json.inflectors\r
+    @item_names = {}\r
+    @table_names = {}\r
+    _this = this\r
+    _.each @inflectors, (table_name, item_name) ->\r
+      _this.item_names[item_name] = table_name  # monkey copy\r
+      _this.table_names[table_name] = item_name\r
     @items = ManifestBase.load_type_name_args(this, @global_json, 'items', Manifest.ItemFactory)\r
     @controllers = Manifest.Controller.load(this, @global_json, 'controllers', Manifest.Controller)\r
     @models = Manifest.Model.load(this, @global_json, 'models', Manifest.Model)\r
-    @inflectors = {}\r
-    _this = this\r
-    _.each @models, (model_manifest, item_name) ->\r
-      if model_manifest.table_name\r
-        _this.inflectors[model_manifest.table_name] = item_name\r
     true\r
   \r
+  pluralize: (item_name) ->\r
+    @item_names[item_name]\r
+  \r
+  singularize: (table_name) ->\r
+    @table_names[table_name]\r
+  \r
   @item_name_to_model: (item_name) ->\r
     Pettanr[Pettanr.camelize(item_name)]\r
   \r
-  @pluralize: (name) ->\r
-    name.pluralize\r
-  \r
   @manifest: () ->\r
     @mani\r
   \r
index f346b95..98c8ee1 100644 (file)
@@ -4,7 +4,7 @@ class Manifest.Model extends ManifestBase.Base
     super\r
     @json.attributes ||= {}\r
     @json.associations ||= {}\r
-    @json.list ||= {}\r
+    @json.table_name ||= Manifest.manifest().pluralize(@name)\r
     @json.attributes.id = {\r
       'type': 'number',\r
       'primary_key': 1,\r
@@ -24,17 +24,13 @@ class Manifest.Model extends ManifestBase.Base
     @table_name = @json.table_name\r
     @attributes = ManifestBase.load_name_values this, @json, 'attributes', Manifest.ModelModule.Attribute\r
     @associations = ManifestBase.load_value this, @json, 'associations', Manifest.ModelModule.Association\r
-    @list = ManifestBase.load_value this, @json, 'list', Manifest.ModelModule.List\r
   \r
-  model_name: () ->\r
+  item_name: () ->\r
     @name\r
   \r
   classify: () ->\r
     Manifest.item_name_to_model @name\r
   \r
-  table_name: () ->\r
-    @table_name\r
-  \r
   valid_encode_columns: () ->\r
     r = []\r
     _.each @attributes, (attribute, attribute_name) ->\r
@@ -56,7 +52,7 @@ class Manifest.Model extends ManifestBase.Base
     _this = this\r
     _.each Manifest.manifest().items, (peta_manifest, peta_name) ->\r
       return if not peta_manifest.is_element()\r
-      return if peta_manifest.parent_model_name != _this.name\r
+      return if peta_manifest.parent_item_name != _this.name\r
       r.push Manifest.manifest().models[peta_name]\r
     r\r
   \r
index 688b259..6c862b1 100644 (file)
@@ -12,17 +12,18 @@ class Manifest.ModelModule.Association extends ManifestBase.Values
     @has_many = ManifestBase.load_name_values this, @values, 'has_many', Manifest.ModelModule.AssociationModule.HasMany\r
     @has_one = ManifestBase.load_name_values this, @values, 'has_one', Manifest.ModelModule.AssociationModule.HasOne\r
   \r
-  model_name: () ->\r
-    @parent.name\r
+  item_name: () ->\r
+    @parent.item_name()\r
   \r
-  each_parent_model: () ->\r
-    _.each _belongs_to, (belongs_to_manifest, name) ->\r
-      next if not _parent.classify.is_element()\r
-      if _parent.classify.my_peta.type == 'element'\r
+  parent_models: () ->\r
+    _this = this\r
+    _.map _belongs_to, (belongs_to_manifest, name) ->\r
+      pm = _this.parent.classify()\r
+      next if not pm.is_element()\r
+      if pm.my_peta.type == 'element'\r
         next if not belongs_to_manifest.model.my_peta.type == 'root'\r
-      if _parent.classify.my_peta.type == 'leaf'\r
+      if pm.my_peta.type == 'leaf'\r
         next if not belongs_to_manifest.model.my_peta.type == 'binder'\r
-      #yield belongs_to_manifest.model\r
   \r
   child_element_name: (child_model) -> \r
     if @is_has_one(child_model)\r
index 367ac44..6198050 100644 (file)
@@ -2,16 +2,16 @@ class Manifest.ModelModule.AssociationModule.BelongsTo extends ManifestBase.Name
   \r
   set_default: () ->\r
     super()\r
-    @values['model_name'] ||= @name\r
+    @values['item_name'] ||= @name\r
     @values['id_column'] ||= @name + '_id' \r
     \r
   init: () ->\r
     super()\r
-    @model_name = @values['model_name']\r
+    @item_name = @values['item_name']\r
     @id_column = @values['id_column']\r
   \r
   model: () ->\r
-    Manifest.item_name_to_model @model_name\r
+    Manifest.item_name_to_model @item_name\r
   \r
   association_name: () ->\r
     @parent.association_name\r
index a5a9f8b..9478ea3 100644 (file)
@@ -2,12 +2,12 @@ class Manifest.ModelModule.AssociationModule.HasMany extends ManifestBase.NameVa
   \r
   set_default: () ->\r
     super()\r
-    @values['model_name'] ||= Manifest.manifest().controllers[@name].item_name\r
-    @values['foreign_key'] ||= @parent.model_name + '_id'\r
+    @values['item_name'] ||= Manifest.manifest().singularize(@name)\r
+    @values['foreign_key'] ||= @parent.item_name() + '_id'\r
     \r
   init: () ->\r
     super()\r
-    @model_name = @values['model_name']\r
+    @item_name = @values['item_name']\r
     @foreign_key = @values['foreign_key']\r
     @through = @values['through']\r
   \r
@@ -15,7 +15,7 @@ class Manifest.ModelModule.AssociationModule.HasMany extends ManifestBase.NameVa
     !@through\r
   \r
   model: () ->\r
-    Manifest.item_name_to_model @model_name\r
+    Manifest.item_name_to_model(@item_name())\r
   \r
   association_name: () ->\r
     @parent.association_name\r
index 8c33c79..8dc758f 100644 (file)
@@ -2,17 +2,17 @@ class Manifest.ModelModule.AssociationModule.HasOne extends ManifestBase.NameVal
   \r
   set_default: () ->\r
     super()\r
-    @values['model_name'] ||= @name\r
-    @values['foreign_key'] ||= @parent.model_name + '_id'\r
+    @values['item_name'] ||= @name\r
+    @values['foreign_key'] ||= @parent.item_name() + '_id'\r
     \r
   init: () ->\r
     super()\r
-    @model_name = @values['model_name']\r
+    @item_name = @values['item_name']\r
     @foreign_key = @values['foreign_key']\r
   \r
   is_through: () ->\r
     !@through\r
   \r
   model: () ->\r
-    Manifest.item_name_to_model @model_name\r
+    Manifest.item_name_to_model @item_name\r
   \r
index 7e472c0..c5d5d23 100644 (file)
@@ -14,7 +14,7 @@ class Manifest.ModelModule.Attribute extends ManifestBase.NameValues
     if @values['source']\r
       @source = ManifestBase.load_type_args this, @values, 'source', Manifest.ModelModule.AttributeModule.SourceFactory\r
   \r
-  model_name: () ->\r
-    @parent.name\r
+  item_name: () ->\r
+    @parent.item_name()\r
   \r
 class Manifest.ModelModule.AttributeModule\r
index ef80ffa..f063d5e 100644 (file)
@@ -2,12 +2,10 @@ class Manifest.ModelModule.AttributeModule.SourceModule.Base extends ManifestBas
   \r
   set_default: () ->\r
     super()\r
-    @args['item_name'] ||= @parent.item_name  # not parent.name. follow singularized name\r
     \r
   init: () ->\r
     super()\r
-    @item_name = @args['item_name']\r
   \r
-  model_name: () ->\r
-    @parent.model_name\r
+  item_name: () ->\r
+    @parent.item_name()\r
 \r
index a8076d5..328f58c 100644 (file)
@@ -2,15 +2,15 @@ class Manifest.ModelModule.AttributeModule.SourceModule.ModelSource extends Mani
   \r
   set_default: () ->\r
     super()\r
-    @args['resource_model_name'] ||= (@parent.name.replace('_id', ''))\r
-    @args['resource_list_name'] ||= 'select_items'\r
-    @args['select_item_name'] ||= @model_name + '_' + @parent.name.replace('_id', '') + '_items'\r
+    @args['resource_item_name'] ||= (@parent.name.replace('_id', ''))\r
+    @args['resource_action_name'] ||= 'select_items'\r
+    @args['select_item_name'] ||= @item_name() + '_' + @parent.name.replace('_id', '') + '_items'\r
     @args['caption_name'] ||= 'caption'\r
     \r
   init: () ->\r
     super()\r
-    @resource_model_name = @args['resource_model_name']\r
-    @resource_list_name = @args['resource_list_name']\r
+    @resource_item_name = @args['resource_item_name']\r
+    @resource_action_name = @args['resource_action_name']\r
     @select_item_name = @args['select_item_name']\r
     @caption_name = @args['caption_name']\r
   \r
diff --git a/app/assets/javascripts/manifest/model/list.js.coffee b/app/assets/javascripts/manifest/model/list.js.coffee
deleted file mode 100644 (file)
index b68a315..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-class Manifest.ModelModule.List extends ManifestBase.Values\r
-  \r
-  set_default: () ->\r
-    super()\r
-    @values['default_page_size'] ||= 25\r
-    @values['max_page_size'] ||= 100\r
-    \r
-  init: () ->\r
-    super()\r
-    @default_page_size = @values['default_page_size']\r
-    @max_page_size = @values['max_page_size']\r
-  \r
index 2207d6e..4dd8ee8 100644 (file)
@@ -25,7 +25,8 @@ class Peta.Item extends Backbone.Model
     'Name'\r
   \r
   @plural: () ->\r
-    'Names'\r
+    table_name = Manifest.manifest().pluralize @item_name()\r
+    Pettanr.camelize(table_name)\r
   \r
   @class_name: () ->\r
     @singular()\r
index 65a2d07..4a7a0a3 100644 (file)
@@ -123,7 +123,9 @@ class Pettanr
       @set_model()\r
       @my_list_model = Manifest.manifest().models[@my_action.item_name]\r
       @my_list_model_class = @my_list_model.classify()\r
-      @list = Locmare.ListGroup.list(@my_action.item_name, @my_action.list_name)\r
+      @list = Locmare.ListGroup.list(\r
+        @my_action.path_name(), @my_action.name, @operators, @params\r
+      )\r
     \r
     set_show: () ->\r
       @set_model()\r
@@ -132,12 +134,12 @@ class Pettanr
     filer_list: () ->\r
       @set_list()\r
       _this = this\r
-      @list.open(@operators, @params, @my_action, {}, (page_status) ->\r
+      @list.open((page_status) ->\r
         pager = new Locmare.FilerModule.DefaultPager({page_status: page_status})\r
         f = new Locmare.Filer({\r
           el: "#pettanr",\r
           item_name: _this.my_list_model_class.item_name(), \r
-          items: _this.list.models\r
+          items: _this.list.items()\r
           pager: pager, \r
           operators: _this.operators\r
         })\r
@@ -147,21 +149,17 @@ class Pettanr
     set_play: () ->\r
       @set_list()\r
       @binder_controller = Manifest.manifest().controllers[@params['controller']]\r
-      @binder_model = Manifest.manifest().models[@binder_controller.item_name]\r
+      @binder_action = @my_controller.actions[params['action']]\r
+      @binder_model = Manifest.manifest().models[@binder_action.item_name]\r
       @binder_model_class = @binder_model.classify()\r
       @item = new @binder_model_class({id: @params['id']})\r
     \r
     play_list: () ->\r
       _this = this\r
-      opt = {\r
-        id: @params['id'], \r
-        offset: @params['offset'], \r
-        count: @params['count'], \r
-        page: @params['page'], \r
-        page_size: @params['page_size']\r
-      }\r
+      @options = @params\r
+      @options['my_play'] = @item.is_own?(@operators)\r
       @item.fetch({cache: true}).done ->\r
-        _this.list.open(_this.operators, opt, _this.my_action, {}, (page_status) ->\r
+        _this.list.open((page_status) ->\r
           console.log _this.list.models\r
         )\r
         false\r
index 6c1396a..bcccf83 100644 (file)
@@ -1,5 +1,6 @@
 $ ->\r
   manifest =  {\r
+    inflectors: window.inflectors,\r
     items: window.items,\r
     controllers: window.controllers,\r
     models: window.models,\r
index 7754d28..0e01995 100644 (file)
@@ -1,7 +1,6 @@
 #マニフェスト\r
 @controllers = {\r
   folders: {\r
-    item_name: 'folder',\r
     actions: {\r
       root: {\r
         type: 'show',\r
@@ -9,7 +8,6 @@
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public',\r
           param_id: 'none',\r
         },\r
       },\r
@@ -22,7 +20,7 @@
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public',\r
+          action_name: 'index',\r
         },\r
       },\r
       new: {\r
     },\r
   },\r
   scrolls: {\r
-    item_name: 'scroll',\r
     actions: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public',\r
           param_id: 'none',\r
         },\r
       },\r
       play: {\r
         type: 'list',\r
         args: {\r
-          item_name: 'scroll_panel',\r
-          list_name: 'by_scroll',\r
+          alias: 'scroll_panels.by_scroll',\r
           order: 't',\r
-          direction: 'asc'\r
+          direction: 1\r
         },\r
       },\r
       show: {\r
@@ -73,7 +68,7 @@
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public',\r
+          action_name: 'index',\r
         },\r
       },\r
       count_by_author: {\r
     },\r
   },\r
   scroll_panels: {\r
-    item_name: 'scroll_panel',\r
     actions: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public',\r
           param_id: 'none',\r
         },\r
       },\r
           param_id: 'suffix',\r
         },\r
       },\r
-      play: {\r
-        type: 'list',\r
-        args: {\r
-        },\r
-      },\r
       show: {\r
         type: 'show',\r
       },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public',\r
+          action_name: 'index',\r
         },\r
       },\r
       count_by_panel: {\r
       count_by_author: {\r
         type: 'count',\r
       },\r
-      count_play: {\r
-        type: 'count',\r
-      },\r
       new: {\r
         type: 'new',\r
       },\r
     },\r
   },\r
   comics: {\r
-    item_name: 'comic',\r
     actions: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public',\r
           param_id: 'none',\r
         },\r
       },\r
       play: {\r
         type: 'list',\r
         args: {\r
-          item_name: 'comic_story',\r
-          list_name: 'play',\r
+          alias: 'comic_stories.by_comic',\r
+          order: 't',\r
+          direction: 1\r
         },\r
       },\r
       show: {\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public',\r
+          action_name: 'index',\r
         },\r
       },\r
       count_by_story: {\r
     },\r
   },\r
   comic_stories: {\r
-    item_name: 'comic_story',\r
     actions: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public',\r
           param_id: 'none',\r
         },\r
       },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public',\r
+          action_name: 'index',\r
         },\r
       },\r
       count_by_comic: {\r
     },\r
   },\r
   stories: {\r
-    item_name: 'story',\r
     actions: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public',\r
           param_id: 'none',\r
         },\r
       },\r
       play: {\r
         type: 'list',\r
         args: {\r
-          item_name: 'story_sheet',\r
-          list_name: 'play',\r
+          alias: 'story_sheets.by_story',\r
+          order: 't',\r
+          direction: 1\r
         },\r
       },\r
       show: {\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public',\r
+          action_name: 'index',\r
         },\r
       },\r
       count_by_comic: {\r
     },\r
   },\r
   story_sheets: {\r
-    item_name: 'story_sheet',\r
     actions: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public',\r
           param_id: 'none',\r
         },\r
       },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public',\r
+          action_name: 'index',\r
         },\r
       },\r
       count_by_story: {\r
     },\r
   },\r
   sheets: {\r
-    item_name: 'sheet',\r
     actions: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public',\r
           param_id: 'none',\r
         },\r
       },\r
       play: {\r
         type: 'list',\r
         args: {\r
-          item_name: 'sheet_panel',\r
-          list_name: 'play',\r
+          alias: 'sheet_panels.by_sheet',\r
+          order: 't',\r
+          direction: 1\r
         },\r
       },\r
       show: {\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public',\r
+          action_name: 'index',\r
         },\r
       },\r
       count_by_story: {\r
     },\r
   },\r
   sheet_panels: {\r
-    item_name: 'sheet_panel',\r
     actions: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public',\r
           param_id: 'none',\r
         },\r
       },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public',\r
+          action_name: 'index',\r
         },\r
       },\r
       count_by_sheet: {\r
     },\r
   },\r
   panels: {\r
-    item_name: 'panel',\r
     actions: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public',\r
           param_id: 'none',\r
         },\r
       },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public',\r
+          action_name: 'index',\r
         },\r
       },\r
       count_by_scroll: {\r
     },\r
   },\r
   panel_pictures: {\r
-    item_name: 'panel_picture',\r
     actions: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public',\r
           param_id: 'none',\r
         },\r
       },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public',\r
+          action_name: 'index',\r
         },\r
       },\r
       count_by_panel: {\r
     },\r
   },\r
   speech_balloons: {\r
-    item_name: 'speech_balloon',\r
     actions: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public',\r
           param_id: 'none',\r
         },\r
       },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public',\r
+          action_name: 'index',\r
         },\r
       },\r
       count_by_panel: {\r
     },\r
   },\r
   speeches: {\r
-    item_name: 'speech',\r
     actions: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public',\r
           param_id: 'none',\r
         },\r
       },\r
           param_id: 'suffix',\r
         },\r
       },\r
+      by_speech_balloon_template: {\r
+        type: 'list',\r
+        args: {\r
+          param_id: 'suffix',\r
+        },\r
+      },\r
+      by_writing_format: {\r
+        type: 'list',\r
+        args: {\r
+          param_id: 'suffix',\r
+        },\r
+      },\r
       show: {\r
         type: 'show',\r
       },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public',\r
+          action_name: 'index',\r
         },\r
       },\r
       count_by_author: {\r
         type: 'count',\r
       },\r
+      count_by_speech_balloon: {\r
+        type: 'count',\r
+      },\r
+      count_by_speech_balloon_template: {\r
+        type: 'count',\r
+      },\r
+      count_by_writing_format: {\r
+        type: 'count',\r
+      },\r
       new: {\r
         type: 'new',\r
       },\r
     },\r
   },\r
   balloons: {\r
-    item_name: 'balloon',\r
     actions: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public',\r
           param_id: 'none',\r
         },\r
       },\r
           param_id: 'suffix',\r
         },\r
       },\r
+      by_speech_balloon_template: {\r
+        type: 'list',\r
+        args: {\r
+          param_id: 'suffix',\r
+        },\r
+      },\r
+      by_system_picture: {\r
+        type: 'list',\r
+        args: {\r
+          param_id: 'suffix',\r
+        },\r
+      },\r
       show: {\r
         type: 'show',\r
       },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public',\r
+          action_name: 'index',\r
         },\r
       },\r
       count_by_author: {\r
         type: 'count',\r
       },\r
+      count_by_speech_balloon: {\r
+        type: 'count',\r
+      },\r
+      count_by_speech_balloon_template: {\r
+        type: 'count',\r
+      },\r
+      count_by_system_picture: {\r
+        type: 'count',\r
+      },\r
       new: {\r
         type: 'new',\r
       },\r
     },\r
   },\r
   ground_pictures: {\r
-    item_name: 'ground_picture',\r
     actions: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public',\r
           param_id: 'none',\r
         },\r
       },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public',\r
+          action_name: 'index',\r
         },\r
       },\r
       count_by_panel: {\r
     },\r
   },\r
   ground_colors: {\r
-    item_name: 'ground_color',\r
     actions: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public',\r
           param_id: 'none',\r
         },\r
       },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public',\r
+          action_name: 'index',\r
         },\r
       },\r
       count_by_panel: {\r
     },\r
   },\r
   original_pictures: {\r
-    item_name: 'original_picture',\r
     actions: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'private',\r
           param_id: 'none',\r
         },\r
       },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'private',\r
+          action_name: 'index',\r
         },\r
       },\r
       new: {\r
     },\r
   },\r
   pictures: {\r
-    item_name: 'picture',\r
     actions: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public',\r
           param_id: 'none',\r
         },\r
       },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public',\r
+          action_name: 'index',\r
         },\r
       },\r
       count_by_artist: {\r
     },\r
   },\r
   resource_pictures: {\r
-    item_name: 'resource_picture',\r
     actions: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public',\r
           param_id: 'none',\r
         },\r
       },\r
+      by_original_picture: {\r
+        type: 'list',\r
+        args: {\r
+          param_id: 'suffix',\r
+        },\r
+      },\r
       by_license_group: {\r
         type: 'list',\r
         args: {\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public',\r
+          action_name: 'index',\r
         },\r
       },\r
+      count_by_original_picture: {\r
+        type: 'count',\r
+      },\r
       count_by_license_group: {\r
         type: 'count',\r
       },\r
     },\r
   },\r
   speech_balloon_templates: {\r
-    item_name: 'speech_balloon_template',\r
     actions: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public',\r
           param_id: 'none',\r
         },\r
       },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public',\r
+          action_name: 'index',\r
         },\r
       },\r
       count_by_panel: {\r
     },\r
   },\r
   writing_formats: {\r
-    item_name: 'writing_format',\r
     actions: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public',\r
           param_id: 'none',\r
         },\r
       },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public',\r
+          action_name: 'index',\r
         },\r
       },\r
       count_by_system_picture: {\r
     },\r
   },\r
   license_groups: {\r
-    item_name: 'license_group',\r
     actions: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public',\r
           param_id: 'none',\r
         },\r
       },\r
+      by_resource_picture: {\r
+        type: 'list',\r
+        args: {\r
+          param_id: 'suffix',\r
+        },\r
+      },\r
       show: {\r
         type: 'show',\r
       },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public',\r
+          action_name: 'index',\r
         },\r
       },\r
+      count_by_resource_picture: {\r
+        type: 'count',\r
+      },\r
       new: {\r
         type: 'new',\r
       },\r
     },\r
   },\r
   licenses: {\r
-    item_name: 'license',\r
     actions: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public',\r
           param_id: 'none',\r
         },\r
       },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public',\r
+          action_name: 'index',\r
         },\r
       },\r
       count_by_license_group: {\r
     },\r
   },\r
   authors: {\r
-    item_name: 'author',\r
     actions: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public',\r
           param_id: 'none',\r
         },\r
       },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public',\r
+          action_name: 'index',\r
         },\r
       },\r
       new: {\r
     },\r
   },\r
   artists: {\r
-    item_name: 'artist',\r
     actions: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public',\r
           param_id: 'none',\r
         },\r
       },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public',\r
+          action_name: 'index',\r
         },\r
       },\r
       new: {\r
     },\r
   },\r
   system_pictures: {\r
-    item_name: 'system_picture',\r
     actions: {\r
       index: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'public',\r
           param_id: 'none',\r
         },\r
       },\r
       count: {\r
         type: 'count',\r
         args: {\r
-          list_name: 'public',\r
+          action_name: 'index',\r
         },\r
       },\r
     },\r
         type: 'list',\r
         args: {\r
           item_name: 'scroll',\r
-          list_name: 'private',\r
           param_id: 'none',\r
           counter_name: 'scrolls_count',\r
         },\r
         type: 'list',\r
         args: {\r
           item_name: 'scroll_panel',\r
-          list_name: 'private',\r
           param_id: 'none',\r
           counter_name: 'scroll_panels_count',\r
         },\r
         type: 'list',\r
         args: {\r
           item_name: 'comic',\r
-          list_name: 'private',\r
           param_id: 'none',\r
           counter_name: 'comics_count',\r
         },\r
         type: 'list',\r
         args: {\r
           item_name: 'comic_story',\r
-          list_name: 'private',\r
           param_id: 'none',\r
           counter_name: 'comic_stories_count',\r
         },\r
         type: 'list',\r
         args: {\r
           item_name: 'story',\r
-          list_name: 'private',\r
           param_id: 'none',\r
           counter_name: 'stories_count',\r
         },\r
         type: 'list',\r
         args: {\r
           item_name: 'story_sheet',\r
-          list_name: 'private',\r
           param_id: 'none',\r
           counter_name: 'story_sheets_count',\r
         },\r
         type: 'list',\r
         args: {\r
           item_name: 'sheet',\r
-          list_name: 'private',\r
           param_id: 'none',\r
           counter_name: 'sheets_count',\r
         },\r
         type: 'list',\r
         args: {\r
           item_name: 'sheet_panel',\r
-          list_name: 'private',\r
           param_id: 'none',\r
           counter_name: 'sheet_panels_count',\r
         },\r
         type: 'list',\r
         args: {\r
           item_name: 'panel',\r
-          list_name: 'private',\r
           param_id: 'none',\r
           counter_name: 'panels_count',\r
         },\r
         type: 'list',\r
         args: {\r
           item_name: 'panel_picture',\r
-          list_name: 'private',\r
           param_id: 'none',\r
           counter_name: 'panel_pictures_count',\r
         },\r
         type: 'list',\r
         args: {\r
           item_name: 'speech_balloon',\r
-          list_name: 'private',\r
           param_id: 'none',\r
           counter_name: 'speech_balloons_count',\r
         },\r
         type: 'list',\r
         args: {\r
           item_name: 'speech',\r
-          list_name: 'private',\r
           param_id: 'none',\r
           counter_name: 'speeches_count',\r
         },\r
         type: 'list',\r
         args: {\r
           item_name: 'balloon',\r
-          list_name: 'private',\r
           param_id: 'none',\r
           counter_name: 'balloons_count',\r
         },\r
         type: 'list',\r
         args: {\r
           item_name: 'ground_picture',\r
-          list_name: 'private',\r
           param_id: 'none',\r
           counter_name: 'ground_pictures_count',\r
         },\r
         type: 'list',\r
         args: {\r
           item_name: 'ground_color',\r
-          list_name: 'private',\r
           param_id: 'none',\r
           counter_name: 'ground_colors_count',\r
         },\r
         type: 'list',\r
         args: {\r
           item_name: 'original_picture',\r
-          list_name: 'private',\r
           param_id: 'none',\r
           counter_name: 'count',\r
         },\r
         type: 'list',\r
         args: {\r
           item_name: 'resource_picture',\r
-          list_name: 'private',\r
           param_id: 'none',\r
           counter_name: 'resource_pictures_count',\r
         },\r
         type: 'count',\r
         args: {\r
           item_name: 'scroll',\r
-          list_name: 'private',\r
           param_id: 'none',\r
         },\r
       },\r
         type: 'count',\r
         args: {\r
           item_name: 'scroll_panel',\r
-          list_name: 'private',\r
           param_id: 'none',\r
         },\r
       },\r
         type: 'count',\r
         args: {\r
           item_name: 'comic',\r
-          list_name: 'private',\r
           param_id: 'none',\r
         },\r
       },\r
         type: 'count',\r
         args: {\r
           item_name: 'comic_story',\r
-          list_name: 'private',\r
           param_id: 'none',\r
         },\r
       },\r
diff --git a/app/assets/javascripts/work/inflectors.js.coffee.erb b/app/assets/javascripts/work/inflectors.js.coffee.erb
new file mode 100644 (file)
index 0000000..9157610
--- /dev/null
@@ -0,0 +1,32 @@
+#マニフェスト\r
+@inflectors = {\r
+  folder: 'folders',\r
+  scroll: 'scrolls',\r
+  scroll_panel: 'scroll_panels',\r
+  comic: 'comics',\r
+  comic_story: 'comic_stories',\r
+  story: 'stories',\r
+  story_sheet: 'story_sheets',\r
+  sheet: 'sheets',\r
+  sheet_panel: 'sheet_panels',\r
+  panel: 'panels',\r
+  panel_picture: 'panel_pictures',\r
+  speech_balloon: 'speech_balloons',\r
+  speech: 'speeches',\r
+  balloon: 'balloons',\r
+  ground_picture: 'ground_pictures',\r
+  ground_color: 'ground_colors',\r
+  original_picture: 'original_pictures',\r
+  picture: 'pictures',\r
+  resource_picture: 'resource_pictures',\r
+  original_picture_license_group: 'original_picture_license_groups'\r
+  original_picture_license: 'original_picture_licenses'\r
+  speech_balloon_template: 'speech_balloon_templates',\r
+  writing_format: 'writing_formats',\r
+  license_group: 'license_groups',\r
+  license: 'licenses',\r
+  author: 'authors',\r
+  artist: 'artists',\r
+  system_picture: 'system_pictures',\r
+  home: 'home',\r
+}\r
index 34ccc52..d6e911b 100644 (file)
@@ -10,8 +10,8 @@
   scroll_panel: {\r
     type: 'leaf',\r
     args: {\r
-      parent_model_name: 'scroll',\r
-      destination_model_name: 'panel',\r
+      parent_item_name: 'scroll',\r
+      destination_item_name: 'panel',\r
     },\r
   },\r
   comic: {\r
@@ -22,8 +22,8 @@
   comic_story: {\r
     type: 'leaf',\r
     args: {\r
-      parent_model_name: 'comic',\r
-      destination_model_name: 'story',\r
+      parent_item_name: 'comic',\r
+      destination_item_name: 'story',\r
     },\r
   },\r
   story: {\r
@@ -34,8 +34,8 @@
   story_sheet: {\r
     type: 'leaf',\r
     args: {\r
-      parent_model_name: 'story',\r
-      destination_model_name: 'sheet',\r
+      parent_item_name: 'story',\r
+      destination_item_name: 'sheet',\r
     },\r
   },\r
   sheet: {\r
@@ -46,7 +46,7 @@
   sheet_panel: {\r
     type: 'element',\r
     args: {\r
-      parent_model_name: 'sheet',\r
+      parent_item_name: 'sheet',\r
     },\r
   },\r
   panel: {\r
   panel_picture: {\r
     type: 'element',\r
     args: {\r
-      parent_model_name: 'panel',\r
+      parent_item_name: 'panel',\r
     },\r
   },\r
   speech_balloon: {\r
     type: 'element',\r
     args: {\r
-      parent_model_name: 'panel',\r
+      parent_item_name: 'panel',\r
       boost: {\r
         speech_balloon_template: {\r
           extend_model_class_name: 'SpeechBalloon',\r
@@ -75,7 +75,7 @@
   balloon: {\r
     type: 'element',\r
     args: {\r
-      parent_model_name: 'speech_balloon',\r
+      parent_item_name: 'speech_balloon',\r
       boost: {\r
         speech_balloon_template: {\r
           extend_model_class_name: 'Balloon',\r
@@ -87,7 +87,7 @@
   speech: {\r
     type: 'element',\r
     args: {\r
-      parent_model_name: 'speech_balloon',\r
+      parent_item_name: 'speech_balloon',\r
       boost: {\r
         writing_format: {\r
           level: 'read',\r
   ground_picture: {\r
     type: 'element',\r
     args: {\r
-      parent_model_name: 'panel',\r
+      parent_item_name: 'panel',\r
     },\r
   },\r
   ground_color: {\r
     type: 'element',\r
     args: {\r
-      parent_model_name: 'panel',\r
+      parent_item_name: 'panel',\r
     },\r
   },\r
   original_picture: {\r
   license: {\r
     type: 'system_resource',\r
     args: {\r
-      parent_model_name: 'license_group',\r
+      parent_item_name: 'license_group',\r
       boost: {\r
         license_group: {\r
           extend_model_class_name: 'License',\r
index 8684661..1712ae6 100644 (file)
@@ -1,20 +1,17 @@
 #マニフェスト\r
 @list_groups = {\r
-  folder: {\r
+  folders: {\r
     lists: {\r
-      public: {\r
+      index: {\r
         type: 'public',\r
       },\r
     },\r
   },\r
-  scroll: {\r
+  scrolls: {\r
     lists: {\r
-      public: {\r
+      index: {\r
         type: 'public',\r
       },\r
-      private: {\r
-        type: 'private',\r
-      },\r
       by_author: {\r
         type: 'filter',\r
       },\r
           through: 'scroll_panels',\r
         },\r
       },\r
+      play: {\r
+        type: 'play',\r
+      },\r
     },\r
   },\r
-  scroll_panel: {\r
+  scroll_panels: {\r
     lists: {\r
-      public: {\r
+      index: {\r
         type: 'public',\r
       },\r
-      private: {\r
-        type: 'private',\r
-      },\r
-      play: {\r
-        type: 'play',\r
-        args: {\r
-          filter_item_name: 'scroll',\r
-          filter_model_name: 'scroll_panel',\r
-          filter_key: 'scroll_id',\r
-          order: {\r
-            type: 'method',\r
-          }\r
-        },\r
-      },\r
       by_scroll: {\r
         type: 'filter',\r
       },\r
       },\r
     },\r
   },\r
-  comic: {\r
+  comics: {\r
     lists: {\r
-      public: {\r
+      index: {\r
         type: 'public',\r
       },\r
-      private: {\r
-        type: 'private',\r
-      },\r
       by_author: {\r
         type: 'filter',\r
       },\r
           through: 'comic_stories',\r
         },\r
       },\r
+      play: {\r
+        type: 'play',\r
+      },\r
     },\r
   },\r
-  comic_story: {\r
+  comic_stories: {\r
     lists: {\r
-      public: {\r
+      index: {\r
         type: 'public',\r
       },\r
-      private: {\r
-        type: 'private',\r
-      },\r
-      play: {\r
-        type: 'play',\r
-        args: {\r
-          filter_item_name: 'comic',\r
-          filter_model_name: 'comic_story',\r
-          filter_key: 'comic_id',\r
-          order: {\r
-            type: 'method',\r
-          }\r
-        },\r
-      },\r
       by_comic: {\r
         type: 'filter',\r
       },\r
       },\r
     },\r
   },\r
-  story: {\r
+  stories: {\r
     lists: {\r
-      public: {\r
+      index: {\r
         type: 'public',\r
       },\r
-      private: {\r
-        type: 'private',\r
-      },\r
       by_comic: {\r
         type: 'through_filter',\r
         args: {\r
       by_author: {\r
         type: 'filter',\r
       },\r
+      play: {\r
+        type: 'play',\r
+      },\r
     },\r
   },\r
-  story_sheet: {\r
+  story_sheets: {\r
     lists: {\r
-      public: {\r
+      index: {\r
         type: 'public',\r
       },\r
-      private: {\r
-        type: 'private',\r
-      },\r
-      play: {\r
-        type: 'play',\r
-        args: {\r
-          filter_item_name: 'story',\r
-          filter_model_name: 'story_sheet',\r
-          filter_key: 'story_id',\r
-          order: {\r
-            type: 'method',\r
-          }\r
-        },\r
-      },\r
       by_story: {\r
         type: 'filter',\r
       },\r
       },\r
     },\r
   },\r
-  sheet: {\r
+  sheets: {\r
     lists: {\r
-      public: {\r
+      index: {\r
         type: 'public',\r
       },\r
-      private: {\r
-        type: 'private',\r
-      },\r
       by_story: {\r
         type: 'through_filter',\r
         args: {\r
       by_author: {\r
         type: 'filter',\r
       },\r
+      play: {\r
+        type: 'play',\r
+      },\r
     },\r
   },\r
-  sheet_panel: {\r
+  sheet_panels: {\r
     lists: {\r
-      public: {\r
+      index: {\r
         type: 'public',\r
       },\r
-      private: {\r
-        type: 'private',\r
-      },\r
-      play: {\r
-        type: 'play',\r
-        args: {\r
-          filter_item_name: 'sheet',\r
-          filter_model_name: 'sheet_panel',\r
-          filter_key: 'sheet_id',\r
-        },\r
-      },\r
       by_sheet: {\r
         type: 'filter',\r
       },\r
       },\r
     },\r
   },\r
-  panel: {\r
+  panels: {\r
     lists: {\r
-      public: {\r
+      index: {\r
         type: 'public',\r
       },\r
-      private: {\r
-        type: 'private',\r
-      },\r
       by_scroll: {\r
         type: 'through_filter',\r
         args: {\r
       },\r
     },\r
   },\r
-  panel_picture: {\r
+  panel_pictures: {\r
     lists: {\r
-      public: {\r
+      index: {\r
         type: 'public',\r
       },\r
-      private: {\r
-        type: 'private',\r
-      },\r
       by_panel: {\r
         type: 'filter',\r
       },\r
       },\r
     },\r
   },\r
-  speech_balloon: {\r
+  speech_balloons: {\r
     lists: {\r
-      public: {\r
+      index: {\r
         type: 'public',\r
       },\r
-      private: {\r
-        type: 'private',\r
-      },\r
       by_panel: {\r
         type: 'filter',\r
       },\r
       },\r
     },\r
   },\r
-  speech: {\r
+  speeches: {\r
     lists: {\r
-      public: {\r
+      index: {\r
         type: 'public',\r
       },\r
-      private: {\r
-        type: 'private',\r
-      },\r
-      by_panel: {\r
-        type: 'filter',\r
-      },\r
       by_speech_balloon: {\r
         type: 'filter',\r
       },\r
       },\r
     },\r
   },\r
-  balloon: {\r
+  balloons: {\r
     lists: {\r
-      public: {\r
+      index: {\r
         type: 'public',\r
       },\r
-      private: {\r
-        type: 'private',\r
-      },\r
       by_speech_balloon: {\r
         type: 'filter',\r
       },\r
       },\r
     },\r
   },\r
-  ground_picture: {\r
+  ground_pictures: {\r
     lists: {\r
-      public: {\r
+      index: {\r
         type: 'public',\r
       },\r
-      private: {\r
-        type: 'private',\r
-      },\r
       by_panel: {\r
         type: 'filter',\r
       },\r
       },\r
     },\r
   },\r
-  ground_color: {\r
+  ground_colors: {\r
     lists: {\r
-      public: {\r
+      index: {\r
         type: 'public',\r
       },\r
-      private: {\r
-        type: 'private',\r
-      },\r
       by_panel: {\r
         type: 'filter',\r
       },\r
       },\r
     },\r
   },\r
-  original_picture: {\r
+  original_pictures: {\r
     lists: {\r
-      private: {\r
+      index: {\r
         type: 'private',\r
       },\r
     },\r
   },\r
-  picture: {\r
+  pictures: {\r
     lists: {\r
-      public: {\r
+      index: {\r
         type: 'public',\r
       },\r
       by_artist: {\r
       },\r
     },\r
   },\r
-  resource_picture: {\r
+  resource_pictures: {\r
     lists: {\r
-      public: {\r
+      index: {\r
         type: 'public',\r
       },\r
-      private: {\r
-        type: 'private',\r
-      },\r
       by_original_picture: {\r
         type: 'filter',\r
       },\r
       },\r
     },\r
   },\r
-  speech_balloon_template: {\r
+  speech_balloon_templates: {\r
     lists: {\r
-      public: {\r
+      index: {\r
         type: 'public',\r
       },\r
       by_panel: {\r
       by_system_picture: {\r
         type: 'filter',\r
       },\r
-      select_items: {\r
-        type: 'system_resource',\r
-      },\r
     },\r
   },\r
-  writing_format: {\r
+  writing_formats: {\r
     lists: {\r
-      public: {\r
+      index: {\r
         type: 'public',\r
       },\r
-      select_items: {\r
-        type: 'system_resource',\r
-      },\r
       by_system_picture: {\r
         type: 'filter',\r
       },\r
     },\r
   },\r
-  license_group: {\r
+  license_groups: {\r
     lists: {\r
-      public: {\r
+      index: {\r
         type: 'public',\r
       },\r
       by_resource_picture: {\r
         type: 'filter',\r
       },\r
-      select_items: {\r
-        type: 'system_resource',\r
-      },\r
     },\r
   },\r
-  license: {\r
+  licenses: {\r
     lists: {\r
-      public: {\r
+      index: {\r
         type: 'public',\r
       },\r
       by_license_group: {\r
       },\r
     },\r
   },\r
-  author: {\r
+  authors: {\r
     lists: {\r
-      public: {\r
+      index: {\r
         type: 'public',\r
       },\r
     },\r
   },\r
-  artist: {\r
+  artists: {\r
     lists: {\r
-      public: {\r
+      index: {\r
         type: 'public',\r
       },\r
     },\r
   },\r
-  system_picture: {\r
+  system_pictures: {\r
     lists: {\r
-      public: {\r
+      index: {\r
         type: 'public',\r
       },\r
     },\r
   },\r
+  home: {\r
+    lists: {\r
+      scrolls: {\r
+        type: 'private',\r
+      },\r
+      scroll_panels: {\r
+        type: 'private',\r
+      },\r
+      comics: {\r
+        type: 'private',\r
+      },\r
+      comic_stories: {\r
+        type: 'private',\r
+      },\r
+      stories: {\r
+        type: 'private',\r
+      },\r
+      story_sheets: {\r
+        type: 'private',\r
+      },\r
+      sheets: {\r
+        type: 'private',\r
+      },\r
+      sheet_panels: {\r
+        type: 'private',\r
+      },\r
+      panels: {\r
+        type: 'private',\r
+      },\r
+      panel_pictures: {\r
+        type: 'private',\r
+      },\r
+      speech_balloons: {\r
+        type: 'private',\r
+      },\r
+      speeches: {\r
+        type: 'private',\r
+      },\r
+      balloons: {\r
+        type: 'private',\r
+      },\r
+      ground_pictures: {\r
+        type: 'private',\r
+      },\r
+      ground_colors: {\r
+        type: 'private',\r
+      },\r
+      original_pictures: {\r
+        type: 'private',\r
+      },\r
+      resource_pictures: {\r
+        type: 'private',\r
+      },\r
+    },\r
+  },\r
 }\r
index 03a4112..4fc7776 100644 (file)
@@ -1,7 +1,6 @@
 #マニフェスト\r
 @models = {\r
   folder: {\r
-    table_name: 'folders',\r
     associations: {\r
       belongs_to: {\r
       },\r
@@ -66,7 +65,6 @@
     },\r
   },\r
   scroll: {\r
-    table_name: 'scrolls',\r
     associations: {\r
       belongs_to: {\r
         author: {\r
     },\r
   },\r
   scroll_panel: {\r
-    table_name: 'scroll_panels',\r
     associations: {\r
       belongs_to: {\r
         panel: {\r
     },\r
   },\r
   comic: {\r
-    table_name: 'comics',\r
     associations: {\r
       belongs_to: {\r
         author: {\r
     },\r
   },\r
   comic_story: {\r
-    table_name: 'comic_stories',\r
     associations: {\r
       belongs_to: {\r
         comic: {\r
     },\r
   },\r
   story: {\r
-    table_name: 'stories',\r
     associations: {\r
       belongs_to: {\r
         author: {\r
     },\r
   },\r
   story_sheet: {\r
-    table_name: 'story_sheets',\r
     associations: {\r
       belongs_to: {\r
         story: {\r
     },\r
   },\r
   sheet: {\r
-    table_name: 'sheets',\r
     associations: {\r
       belongs_to: {\r
         author: {\r
     },\r
   },\r
   sheet_panel: {\r
-    table_name: 'sheet_panels',\r
     associations: {\r
       belongs_to: {\r
         sheet: {\r
     },\r
   },\r
   panel: {\r
-    table_name: 'panels',\r
     associations: {\r
       belongs_to: {\r
         author: {\r
     },\r
   },\r
   panel_picture: {\r
-    table_name: 'panel_pictures',\r
     associations: {\r
       belongs_to: {\r
         panel: {\r
     },\r
   },\r
   speech_balloon: {\r
-    table_name: 'speech_balloons',\r
     associations: {\r
       belongs_to: {\r
         panel: {\r
     },\r
   }, \r
   balloon: {\r
-    table_name: 'balloons',\r
     associations: {\r
       belongs_to: {\r
         speech_balloon: {\r
     },\r
   },\r
   speech: {\r
-    table_name: 'speeches',\r
     associations: {\r
       belongs_to: {\r
         speech_balloon: {\r
     },\r
   },\r
   ground_picture: {\r
-    table_name: 'ground_pictures',\r
     associations: {\r
       belongs_to: {\r
         panel: {\r
     },\r
   },\r
   ground_color: {\r
-    table_name: 'ground_colors',\r
     associations: {\r
       belongs_to: {\r
         panel: {\r
     },\r
   },\r
   original_picture: {\r
-    table_name: 'original_pictures',\r
     associations: {\r
       belongs_to: {\r
         artist: {\r
     },\r
   },\r
   picture: {\r
-    table_name: 'pictures',\r
     associations: {\r
       belongs_to: {\r
         license: {\r
     }\r
   },\r
   resource_picture: {\r
-    table_name: 'resource_pictures',\r
     associations: {\r
       belongs_to: {\r
         original_picture: {\r
     },\r
   },\r
   original_picture_license_group: {\r
-    table_name: 'original_picture_license_groups',\r
     associations: {\r
       belongs_to: {\r
         original_picture: {\r
     },\r
   },\r
   original_picture_license: {\r
-    table_name: 'original_picture_licenses',\r
     associations: {\r
       belongs_to: {\r
         original_picture: {\r
         source: {\r
           type: 'filter',\r
           args: {\r
-            resource_list_name: 'by_license_group',\r
+            resource_action_name: 'by_license_group',\r
             filter_column_name: 'license_group_id',\r
           },\r
         },\r
     },\r
   },\r
   speech_balloon_template: {\r
-    table_name: 'speech_balloon_templates',\r
     associations: {\r
       belongs_to: {\r
         system_picture: {\r
     },\r
   },\r
   writing_format: {\r
-    table_name: 'writing_formats',\r
     associations: {\r
       belongs_to: {\r
         system_picture: {\r
     },\r
   },\r
   license_group: {\r
-    table_name: 'license_groups',\r
     associations: {\r
       belongs_to: {\r
       },\r
     },\r
   },\r
   license: {\r
-    table_name: 'licenses',\r
     associations: {\r
       belongs_to: {\r
         license_group: {\r
     },\r
   },\r
   author: {\r
-    table_name: 'authors',\r
     associations: {\r
       belongs_to: {\r
       },\r
     },\r
   },\r
   artist: {\r
-    table_name: 'artists',\r
     associations: {\r
       belongs_to: {\r
       },\r
     },\r
   },\r
   system_picture: {\r
-    table_name: 'system_pictures',\r
     associations: {\r
       belongs_to: {\r
       },\r
index 45746b6..3e7de53 100644 (file)
         'speech_balloon_template',\r
       ],\r
       has_one: [\r
-        'balloon.by_speech_balloon',\r
-        'speech.by_speech_balloon',\r
+        'balloons.by_speech_balloon',\r
+        'speeches.by_speech_balloon',\r
       ],\r
     }, \r
   },\r
         'artist',\r
       ],\r
       has_one: [\r
-        'resource_picture.by_original_picture',\r
       ],\r
     }, \r
   },\r
index bbdd2e8..8fe618b 100644 (file)
@@ -114,14 +114,12 @@ class ApplicationController < ActionController::Base
     set_model
     @my_list_model = Manifest.manifest.models[@my_action.item_name]
     @my_list_model_class = @my_list_model.classify
-    @list = Locmare::ListGroup.list @my_action.item_name, @my_action.list_name
+    @list = Locmare::ListGroup.list @my_controller.name, @my_action.action_name, @operators, params
   end
   
   def filer_list
     set_list
-    list_result = @list.open(@operators, 
-      {:id => params[:id], :page => params[:page], :page_size => params[:page_size]}
-    )
+    list_result = @list.open(@operators)
     @items = list_result.items 
     respond_to do |format|
       format.html {
@@ -144,17 +142,16 @@ class ApplicationController < ActionController::Base
   def set_play
     set_list
     @binder_controller = Manifest.manifest.controllers[params[:controller].to_s]
-    @binder_model = Manifest.manifest.models[@binder_controller.item_name]
+    @binder_action = @my_controller.actions[params[:action].to_s]
+    @binder_model = Manifest.manifest.models[@binder_action.item_name]
     @binder_model_class = @binder_model.classify
     @item = @binder_model_class.show(params[:id], @operators)
   end
   
   def play_list
-    @options = {:id => params[:id], :my_play => @item.own?(@operators), 
-      :offset => params[:offset], :count => params[:count], 
-      :page => params[:page], :page_size => params[:page_size]
-    }
-    list_result = @list.open(@operators, @options)
+    @options = params
+    @options[:my_play] = @item.own?(@operators)
+    list_result = @list.open(@operators)
     @items = list_result.items 
     @count = list_result.count
     @pager = list_result.paginate
@@ -396,7 +393,7 @@ class ApplicationController < ActionController::Base
   
   def list_count
     set_list
-    j = {:count => @list.count(@operators, {:id => params[:id]})}
+    j = {:count => @list.count()}
     respond_to do |format|
       format.json { render json: j.to_json }
     end
@@ -421,9 +418,9 @@ class ApplicationController < ActionController::Base
     }
   end
   
-  def assist_items 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})
+  def assist_items controller_name, list_name
+    list = Locmare::ListGroup.list controller_name, list_name, @operators, {:id => @item.id, :page => 1, :page_size => 5}
+    list_result = list.open(@operators)
     list_result.items
   end
   
index 917f7dc..82145f1 100644 (file)
@@ -7,10 +7,6 @@ class ArtistsController < ApplicationController
     before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
     before_filter :authenticate_artist, :only => [:edit, :update, :destroy]
   end
-
-  def self.model
-    Artist
-  end
   
   def index
     filer_list
index f45feb6..2a3e90d 100644 (file)
@@ -8,10 +8,6 @@ class AuthorsController < ApplicationController
     before_filter :authenticate_author, :only => [:edit, :update]
   end
 
-  def self.model
-    Author
-  end
-  
   def index
     filer_list
   end
index 12da158..6a5637e 100644 (file)
@@ -4,16 +4,14 @@ class BalloonsController < ApplicationController
     before_filter :authenticate_author, :only => [:new, :edit, :create, :update, :destroy]
   else
     before_filter :authenticate_reader, :only => [
-      :index, :show, :by_author, :by_speech_balloon, :count, :count_by_author
+      :index, :show, :count, 
+      :by_author, :by_speech_balloon, :by_speech_balloon_template, :by_system_picture, 
+      :count_by_author, :count_by_speech_balloon, :count_by_speech_balloon_template, :count_by_system_picture
     ]
     before_filter :authenticate_user, :only => [:new, :edit, :create, :update, :destroy]
     before_filter :authenticate_author, :only => [:new, :edit, :create, :update, :destroy]
   end
   
-  def self.model
-    Balloon
-  end
-  
   def index
     filer_list
   end
@@ -26,6 +24,14 @@ class BalloonsController < ApplicationController
     filer_list
   end
   
+  def by_speech_balloon_template
+    filer_list
+  end
+  
+  def by_system_picture
+    filer_list
+  end
+  
   def show_html_format format
     format.html {
       @item.boosts 'post'
@@ -50,6 +56,18 @@ class BalloonsController < ApplicationController
     list_count
   end
   
+  def count_by_speech_balloon
+    list_count
+  end
+  
+  def count_by_speech_balloon_template
+    list_count
+  end
+  
+  def count_by_system_picture
+    list_count
+  end
+  
   def new
     form_new
   end
index e79195d..cbb596d 100644 (file)
@@ -9,10 +9,6 @@ class ComicStoriesController < ApplicationController
     before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
     before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
   end
-
-  def self.model
-    ComicStory
-  end
   
   def index
     filer_list
index 3ef277e..975288b 100644 (file)
@@ -9,10 +9,6 @@ class ComicsController < ApplicationController
     before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
     before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
   end
-
-  def self.model
-    Comic
-  end
   
   def index
     filer_list
@@ -28,10 +24,11 @@ class ComicsController < ApplicationController
   
   def show_html_format format
     format.html {
-      play_list = Locmare::ListGroup.list 'comic_story', 'play'
-      @play_count = play_list.count(@operators, 
+      play_list = Locmare::ListGroup.list(
+        'comic_stories', 'by_comic', @operators, 
         {:id => @item.id, :my_play => @item.own?(@operators)}
       )
+      @play_count = play_list.count(@operators)
     }
   end
   
@@ -47,18 +44,19 @@ class ComicsController < ApplicationController
   end
   
   def play
-    @item = self.class.model.show(params[:id], @operators)
     set_play
-    @items = @list.items(@operators, 
-      {:id => params[:id], :my_play => @item.own?(@operators)},
-      0, -1 # no limit
+    @list = Locmare::ListGroup.list(
+      @my_controller.name, 
+      @my_action.name, @operators, 
+      {:id => @item.id, :offset => 0, :limit => -1}# no limit
     )
-    @count = @items.count
+    @items = @list.items(@operators)
+    @count = @list.count @operators
     # no pager
     respond_to do |format|
       format.html {
         if @item.own? @operators
-          @new_story_items = assist_items('story', 'private')
+          @new_story_items = assist_items('home', 'stories')
         end
       }
       format.json { render json: @items.to_json }
index e05e3db..02e2ab2 100644 (file)
@@ -6,10 +6,6 @@ class FoldersController < ApplicationController
     before_filter :authenticate_admin, :only => [:new, :create, :edit, :update, :destroy]
   end
   
-  def self.model
-    Folder
-  end
-  
   def root
     set_model
     @item = Folder.root
@@ -38,7 +34,7 @@ class FoldersController < ApplicationController
   
   def children_html_format format
     format.html {
-      @filer = Locmare::Filer.new self.class.model.item_name, @item.children, nil, :none, @operators
+      @filer = Locmare::Filer.new Folder.item_name, @item.children, nil, :none, @operators
       render :action => :show
     }
   end
@@ -46,7 +42,7 @@ class FoldersController < ApplicationController
   def children_json_format format
     format.json {
       @items = @item.children
-      render json: @items.to_json(self.class.model.list_json_opt)
+      render json: @items.to_json(Folder.list_json_opt)
     }
   end
   
index 168bda3..78c03b4 100644 (file)
@@ -9,10 +9,6 @@ class GroundColorsController < ApplicationController
     before_filter :authenticate_user, :only => []
     before_filter :authenticate_author, :only => []
   end
-
-  def self.model
-    GroundColor
-  end
   
   def index
     filer_list
index 7d5fb1c..05d3d5e 100644 (file)
@@ -10,10 +10,6 @@ class GroundPicturesController < ApplicationController
     before_filter :authenticate_author, :only => []
   end
   
-  def self.model
-    GroundPicture
-  end
-  
   def index
     filer_list
   end
index b6a2353..7c852cf 100644 (file)
@@ -1,11 +1,18 @@
 class LicenseGroupsController < ApplicationController
+  if Manifest.manifest.magic_numbers['run_mode'] == 0
+  else
+    before_filter :authenticate_reader, :only => [
+      :by_resource_picture, 
+      :count_by_resource_picture, 
+    ]
+  end
   before_filter :authenticate_admin, :only => [:new, :create, :edit, :update, :destroy]
   
-  def self.model
-    LicenseGroup
+  def index
+    filer_list
   end
   
-  def index
+  def by_resource_picture
     filer_list
   end
   
@@ -28,6 +35,10 @@ class LicenseGroupsController < ApplicationController
     list_count
   end
   
+  def count_by_resource_picture
+    list_count
+  end
+  
   def new
     form_new
   end
index dc31794..f47a145 100644 (file)
@@ -3,10 +3,6 @@ class LicensesController < ApplicationController
     :by_license_group, :by_system_picture, :count_by_license_group, :count_by_system_picture
   ]
   before_filter :authenticate_admin, :only => [:new, :create, :edit, :update, :destroy]
-
-  def self.model
-    License
-  end
   
   def index
     filer_list
index 135492c..92a5ab8 100644 (file)
@@ -4,10 +4,6 @@ class OriginalPicturesController < ApplicationController
   before_filter :authenticate_user, :only => [:index, :new, :edit, :create, :update, :destroy]
   before_filter :authenticate_artist, :only => [:index, :new, :edit, :create, :update, :destroy]
   
-  def self.model
-    OriginalPicture
-  end
-  
   def index
     filer_list
   end
index 09d1f54..5c666e0 100644 (file)
@@ -10,10 +10,6 @@ class PanelPicturesController < ApplicationController
     before_filter :authenticate_author, :only => []
   end
   
-  def self.model
-    PanelPicture
-  end
-  
   def index
     filer_list
   end
index 8d4b05e..2589851 100644 (file)
@@ -10,15 +10,10 @@ class PanelsController < ApplicationController
     before_filter :authenticate_author, :only => [:new, :edit, :create, :update, :destroy, :catch]
   end
   
-  def self.model
-    Panel
-  end
   private
   def panel_list
     set_list
-    list_result = @list.open(@operators, 
-      {:id => params[:id], :page => params[:page], :page_size => params[:page_size]}
-    )
+    list_result = @list.open(@operators)
     @items = list_result.items 
     @pager = list_result.paginate
     respond_to do |format|
@@ -56,8 +51,8 @@ class PanelsController < ApplicationController
   def show_html_format format
     format.html {
       if @operators.author
-        @new_scroll_items = assist_items('scroll', 'private')
-        @fresh_scroll_items = assist_items('scroll_panel', 'private').map {|sp| sp.scroll}
+        @new_scroll_items = assist_items('home', 'scrolls')
+        @fresh_scroll_items = assist_items('home', 'scroll_panels').map {|sp| sp.scroll}
       end
     }
   end
@@ -155,7 +150,7 @@ class PanelsController < ApplicationController
   
   def update
     @item = Panel.edit(params[:id], @operators)
-    @item.boost
+    @item.boosts 'post'
     jsn = nil
     if params[:json]
       jsn = JSON.parse(params[:json])
index 0847917..497aba6 100644 (file)
@@ -9,10 +9,6 @@ class PicturesController < ApplicationController
   end
   before_filter :authenticate_admin, :only => [:index, :by_artist, :count, :count_by_artist]
   
-  def self.model
-    Picture
-  end
-  
   def index
     filer_list
   end
index a0847fe..e2ee9dd 100644 (file)
@@ -4,20 +4,22 @@ class ResourcePicturesController < ApplicationController
     before_filter :authenticate_artist, :only => [:new, :create, :update, :destroy]
   else
     before_filter :authenticate_resource_reader, :only => [
-      :index, :show, :credit, :by_license_group, :by_license, :by_artist, :count, :count_by_license_group, :count_by_license, :count_by_artist
+      :index, :show, :credit, :count, 
+      :by_original_picture, :by_license_group, :by_license, :by_artist, 
+      :count_by_original_picture, :count_by_license_group, :count_by_license, :count_by_artist
     ]
     before_filter :authenticate_user, :only => [:new, :create, :update, :destroy]
     before_filter :authenticate_artist, :only => [:new, :create, :update, :destroy]
   end
-
-  def self.model
-    ResourcePicture
-  end
   
   def index
     filer_list
   end
   
+  def by_original_picture
+    filer_list
+  end
+  
   def by_license_group
     filer_list
   end
@@ -61,6 +63,10 @@ class ResourcePicturesController < ApplicationController
     list_count
   end
   
+  def count_by_original_picture
+    list_count
+  end
+  
   def count_by_license_group
     list_count
   end
index dc94d9b..21d4d14 100644 (file)
@@ -9,10 +9,6 @@ class ScrollPanelsController < ApplicationController
     before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
     before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
   end
-
-  def self.model
-    ScrollPanel
-  end
   
   def index
     filer_list
index 6e459b7..3c88b60 100644 (file)
@@ -10,10 +10,6 @@ class ScrollsController < ApplicationController
     before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
   end
   
-  def self.model
-    Scroll
-  end
-  
   def index
     filer_list
   end
@@ -28,10 +24,11 @@ class ScrollsController < ApplicationController
   
   def show_html_format format
     format.html {
-      play_list = Locmare::ListGroup.list 'scroll_panel', 'play'
-      @play_count = play_list.count(@operators, 
+      play_list = Locmare::ListGroup.list(
+        'scroll_panels', 'by_scroll', @operators, 
         {:id => @item.id, :my_play => @item.own?(@operators)}
       )
+      @play_count = play_list.count(@operators)
     }
   end
   
@@ -50,8 +47,8 @@ class ScrollsController < ApplicationController
     respond_to do |format|
       format.html {
         if @item.own? @operators
-          @fresh_panel_items = assist_items('panel', 'public')
-          @new_panel_items = assist_items('panel', 'private')
+          @fresh_panel_items = assist_items('panels', 'index')
+          @new_panel_items = assist_items('home', 'panels')
         end
       }
       format.json { render json: @items.to_json }
index c2f1c78..703f409 100644 (file)
@@ -9,10 +9,6 @@ class SheetPanelsController < ApplicationController
     before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
     before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
   end
-
-  def self.model
-    SheetPanel
-  end
   
   def index
     filer_list
index ec3dfc9..8564d06 100644 (file)
@@ -9,10 +9,6 @@ class SheetsController < ApplicationController
     before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
     before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
   end
-
-  def self.model
-    Sheet
-  end
   
   def index
     filer_list
@@ -33,10 +29,10 @@ class SheetsController < ApplicationController
   def show_html_format format
     format.html {
       if @operators.author
-        @new_panel_items = assist_items('panel', 'private')
+        @new_panel_items = assist_items('home', 'panels')
         
-        @new_story_items = assist_items('story', 'private')
-        @fresh_story_items = assist_items('story_sheet', 'private').map {|ss| ss.story}
+        @new_story_items = assist_items('home', 'stories')
+        @fresh_story_items = assist_items('home', 'story_sheets').map {|ss| ss.story}
       end
     }
   end
@@ -53,9 +49,7 @@ class SheetsController < ApplicationController
   def play
     @item = self.class.model.show(params[:id], @operators)
     set_play
-    list_result = @list.open(@operators, 
-      {:id => params[:id]}
-    )
+    list_result = @list.open(@operators, params[:id])
     @items = list_result.items 
     respond_to do |format|
       format.html {
index 96f337d..0b2d024 100644 (file)
@@ -8,10 +8,6 @@ class SpeechBalloonTemplatesController < ApplicationController
     before_filter :authenticate_user, :only => []
   end
   before_filter :authenticate_admin, :only => [:new, :create, :edit, :update, :destroy]
-
-  def self.model
-    SpeechBalloonTemplate
-  end
   
   def index
     filer_list
index 688d8cd..1d1a523 100644 (file)
@@ -10,10 +10,6 @@ class SpeechBalloonsController < ApplicationController
     before_filter :authenticate_author, :only => []
   end
   
-  def self.model
-    SpeechBalloon
-  end
-  
   def index
     filer_list
   end
index 658f270..601444d 100644 (file)
@@ -4,16 +4,14 @@ class SpeechesController < ApplicationController
     before_filter :authenticate_author, :only => [:new, :edit, :create, :update, :destroy]
   else
     before_filter :authenticate_reader, :only => [
-      :index, :show, :by_author, :by_speech_balloon, :count, :count_by_author
+      :index, :show, :count, 
+      :by_author, :by_speech_balloon, :by_speech_balloon_template, :by_writing_format, 
+      :count_by_author, :count_by_speech_balloon, :count_by_speech_balloon_template, :count_by_writing_format
     ]
     before_filter :authenticate_user, :only => [:new, :edit, :create, :update, :destroy]
     before_filter :authenticate_author, :only => [:new, :edit, :create, :update, :destroy]
   end
   before_filter :authenticate_admin!, :only => []
-
-  def self.model
-    Speech
-  end
   
   def index
     filer_list
@@ -27,6 +25,14 @@ class SpeechesController < ApplicationController
     filer_list
   end
   
+  def by_speech_balloon_template
+    filer_list
+  end
+  
+  def by_writing_format
+    filer_list
+  end
+  
   def show_html_format format
     format.html {
       @item.boosts 'post'
@@ -51,6 +57,18 @@ class SpeechesController < ApplicationController
     list_count
   end
   
+  def count_by_speech_balloon
+    list_count
+  end
+  
+  def count_by_speech_balloon_template
+    list_count
+  end
+  
+  def count_by_writing_format
+    list_count
+  end
+  
   def new
     form_new
   end
index 976ec15..6e473f1 100644 (file)
@@ -9,10 +9,6 @@ class StoriesController < ApplicationController
     before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
     before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
   end
-
-  def self.model
-    Story
-  end
   
   def index
     filer_list
@@ -32,10 +28,11 @@ class StoriesController < ApplicationController
   
   def show_html_format format
     format.html {
-      play_list = Locmare::ListGroup.list 'story_sheet', 'play'
-      @play_count = play_list.count(@operators, 
+      play_list = Locmare::ListGroup.list(
+        'story_sheets', 'by_story', @operators, 
         {:id => @item.id, :my_play => @item.own?(@operators)}
       )
+      @play_count = play_list.count(@operators)
     }
   end
   
@@ -53,17 +50,18 @@ class StoriesController < ApplicationController
     params[:count] = nil
     params[:page] ||= 1
     params[:page_size] = 1
-    @item = self.class.model.show(params[:id], @operators)
     set_play
-    play_list
-    @sort_items = @list.items(@operators
-      {:id => params[:id], :my_play => @item.own?(@operators)},
-      0, -1 # no limit
+    @list = Locmare::ListGroup.list(
+      @my_controller.name
+      @my_action.name, @operators, 
+      {:id => @item.id, :offset => 0, :limit => -1}# no limit
     )
+    @items = @list.items(@operators)
+    @count = @list.count @operators
     respond_to do |format|
       format.html {
         if @item.own? @operators
-          @new_sheet_items = assist_items('sheet', 'private')
+          @new_sheet_items = assist_items('home', 'sheets')
         end
       }
       format.json { render json: @items.to_json }
index b3b076e..c1b74e0 100644 (file)
@@ -9,10 +9,6 @@ class StorySheetsController < ApplicationController
     before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
     before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
   end
-
-  def self.model
-    StorySheet
-  end
   
   def index
     filer_list
index ffb75de..a0175e1 100644 (file)
@@ -9,10 +9,6 @@ class SystemPicturesController < ApplicationController
   end
   before_filter :authenticate_admin!, :only => []
   
-  def self.model
-    SystemPicture
-  end
-  
   def index
     filer_list
   end
index 078566b..a6efeb6 100644 (file)
@@ -7,10 +7,6 @@ class WritingFormatsController < ApplicationController
   end
   before_filter :authenticate_admin, :only => [:new, :create, :edit, :update, :destroy]
   
-  def self.model
-    WritingFormat
-  end
-  
   def index
     filer_list
   end
index a0bbb0b..7060fb2 100644 (file)
@@ -30,10 +30,14 @@ def self.list
   self.enable_list
 end
 
-  def self.enable_list
-    WritingFormat.find(:all).delete_if {|wf|
-      wf.enable? == false
-    }
+  def self.enable_list include_available = false
+    r = WritingFormat.find(:all)
+    unless include_available
+      r.delete_if {|wf|
+        wf.enable? == false
+      }
+    end
+    r
   end
   
   def self.show_opt
index 5aedbfd..7f2af7d 100644 (file)
@@ -28,7 +28,7 @@
   <h3 id="editor"><%= t('editor') -%></h3>
   <p id="notice"><%= notice %></p>
   
-  <% @sort_items.each do |story_sheet| %>
+  <% @items.each do |story_sheet| %>
     <% if story_sheet.sheet -%>
       <div>
         <% @items.each do |ss| %>
diff --git a/app/views/system/_filer.html.erb b/app/views/system/_filer.html.erb
deleted file mode 100644 (file)
index d55070d..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-<div>
-  <%= filer.model.model_name.human %>
-</div>
-<ul class="filer">
-  <li id="" class="filer-head filer-head-<%= filer.model_name -%>">
-    <div id="" class="filer-head-symbol">
-      symbol
-    </div>
-    <% if filer.caption.visible? %>
-      <div id="" class="filer-head-caption">
-        caption
-      </div>
-    <% end %>
-    <% if filer.summary.visible? %>
-      <div id="" class="filer-head-summary">
-        summary
-      </div>
-    <% end %>
-    <div id="" class="filer-head-icon">
-      icon
-    </div>
-    <div id="" class="filer-head-date">
-      date
-    </div>
-    <% if filer.edit.visible? %>
-      <div id="" class="filer-head-edit">
-        edit
-      </div>
-    <% end %>
-  </li>
-  <% filer.file_items.each do |file_item| %>
-    <li id="" class="filer-item filer-item-<%= filer.model_name -%>">
-      <div id="" class="filer-item-symbol">
-        <%= file_item.symbol self %>
-      </div>
-      <% if filer.caption.visible? %>
-        <div id="" class="filer-item-caption">
-          <%= file_item.caption self %>
-        </div>
-      <% end %>
-      <% if filer.summary.visible? %>
-        <div id="" class="filer-item-summary">
-          <%= file_item.summary self %>
-        </div>
-      <% end %>
-      <div id="" class="filer-item-icon">
-        <%= file_item.icon self %>
-      </div>
-      <div id="" class="filer-item-date">
-        <%= file_item.date self %>
-      </div>
-      <% if filer.edit.visible? %>
-        <div id="" class="filer-item-edit">
-          <%= file_item.edit self %>
-        </div>
-      <% end %>
-    </li>
-  <% end %>
-</ul>
-<div class="row_break">
-</div>
-<% if filer.paginate %>
-  <%= paginate(filer.paginate) %>
-<% end %>
diff --git a/app/views/system/_jfiler.html.erb b/app/views/system/_jfiler.html.erb
deleted file mode 100644 (file)
index d424432..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-<script type="text/template" id="jfiler_template">
-<div>
-  <&= filer.header &>
-</div>
-<ul class="filer">
-  <li id="" class="filer-head filer-head-<&= filer.model_name() &>">
-    <div id="" class="filer-head-symbol">
-      symbol
-    </div>
-    <& if (filer.caption.visible()) { &>
-      <div id="" class="filer-head-caption">
-        caption
-      </div>
-    <& } &>
-    <& if (filer.summary.visible()) { &>
-      <div id="" class="filer-head-summary">
-        summary
-      </div>
-    <& } &>
-    <div id="" class="filer-head-icon">
-      icon
-    </div>
-    <div id="" class="filer-head-date">
-      date
-    </div>
-    <& if (filer.edit.visible()) { &>
-      <div id="" class="filer-head-edit">
-        edit
-      </div>
-    <& } &>
-  </li>
-  <& _.each(filer.file_items, function(file_item) { &>
-    <li id="" class="filer-item filer-item-<&= filer.model_name() &>">
-      <div id="" class="filer-item-symbol">
-        <&= file_item.symbol() &>
-      </div>
-      <& if (filer.caption.visible()) { &>
-        <div id="" class="filer-item-caption">
-          <&= file_item.caption() &>
-        </div>
-      <& } &>
-      <& if (filer.summary.visible()) { &>
-        <div id="" class="filer-item-summary">
-          <&= file_item.summary() &>
-        </div>
-      <& } &>
-      <div id="" class="filer-item-icon">
-        <&= file_item.icon() &>
-      </div>
-      <div id="" class="filer-item-date">
-        <&= file_item.date() &>
-      </div>
-      <& if (filer.edit.visible()) { &>
-        <div id="" class="filer-item-edit">
-          <&= file_item.edit() &>
-        </div>
-      <& } &>
-    </li>
-  <& }); &>
-</ul>
-<div class="row_break">
-</div>
-<& if (filer.paginate()) { &>
-  <&= filer.paginate &>
-<& } &>
-</script>
diff --git a/app/views/system/filer.html.erb b/app/views/system/filer.html.erb
deleted file mode 100644 (file)
index 44d2ecb..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<%= render 'system/filer', {:filer => filer} %>
index 899a1fe..51a7126 100644 (file)
@@ -1 +1 @@
-<%= link_to tag(:img, :src => item_column.icon_file_name, :width => item_column.icon_size, :height => item_column.icon_size), polymorphic_path(item_column.item, :format => :prof) %>
+<%= link_to tag(:img, :src => item_column.icon_file_name, :width => item_column.icon_size, :height => item_column.icon_size), item_column.url %>
index 7f54721..9c41be6 100644 (file)
@@ -1,4 +1,4 @@
-<span class="r-wrap" style="display: none;" <%= raw helper.field.element.tag_attr -%>>
+<span class="r-wrap" style="display: none;" <%= raw helper.field.item.tag_attr -%>>
   <button class="r-down" value="0"><</button>
   <button class="r-up" value="0">></button>
   <button class="r-reset" value="0">reset</button>
index fcec3a3..9ff0603 100644 (file)
@@ -1,4 +1,4 @@
 <%= select_tag tag.form_field_name, 
-  options_for_select(tag.source_by_model? ? tag.items : t_select_items(tag.items), :selected => tag.value.to_s), 
+  options_for_select(tag.source_by_filter? ? tag.items : t_select_items(tag.items), :selected => tag.value.to_s), 
   tag.options 
 %>
index f402cab..aa3d186 100644 (file)
@@ -251,6 +251,7 @@ ja:
         md5: MD5
         published_at: 公開
         stopped_at: 停止
+        uploaded_at: 投稿
         created_at: 作成
         updated_at: 更新
       picture:
index 159255f..c15a692 100644 (file)
@@ -290,7 +290,12 @@ Pettanr::Application.routes.draw do
     member do
       get :by_author
       get :by_speech_balloon
+      get :by_speech_balloon_template
+      get :by_system_picture
       get :count_by_author
+      get :count_by_speech_balloon
+      get :count_by_speech_balloon_template
+      get :count_by_system_picture
       get :edit
       put :update
     end
@@ -304,7 +309,13 @@ Pettanr::Application.routes.draw do
     member do
       get :by_author
       get :by_speech_balloon
+      get :by_author
+      get :by_speech_balloon_template
+      get :by_writing_format
       get :count_by_author
+      get :count_by_speech_balloon
+      get :count_by_speech_balloon_template
+      get :count_by_writing_format
       get :edit
       put :update
     end
@@ -388,9 +399,11 @@ Pettanr::Application.routes.draw do
       get :count
     end
     member do
+      get :by_original_picture
       get :by_license_group
       get :by_license
       get :by_artist
+      get :count_by_original_picture
       get :count_by_license_group
       get :count_by_license
       get :count_by_artist
@@ -438,10 +451,8 @@ Pettanr::Application.routes.draw do
       post :create
     end
     member do
-      get :resource_pictures
-      get :resource_pictures_count
-      get :licenses
-      get :licenses_count
+      get :by_resource_picture
+      get :count_by_resource_picture
       put :update
       delete :destroy
     end
index b7d7196..c048efc 100644 (file)
@@ -32,11 +32,6 @@ module LocalManifest
               @action_name = @args['action_name']
             end
             
-            def action_path
-              a = @action_name == 'show' ? '' : @action_name + '/'
-              '/' + self.filer.item_class.path_name + '/' + a
-            end
-            
           end
           
           class NoneLink < BaseLink
index bb25f56..ed5b906 100644 (file)
@@ -32,11 +32,6 @@ module LocalManifest
               @action_name = @args['action_name']
             end
             
-            def action_path
-              a = @action_name == 'show' ? '' : @action_name + '/'
-              '/' + self.filer.item_class.path_name + '/' + a
-            end
-            
           end
           
           class NoneLink < BaseLink
index 83c59d3..bd9efa9 100644 (file)
@@ -37,7 +37,7 @@ module LocalManifest
         @name
       end
       
-      def model_name
+      def item_name
         form_name
       end
       
@@ -47,27 +47,5 @@ module LocalManifest
       
     end
     
-    class ElementField < Field
-    end
-    
-    class PartField < Field
-      attr :part_name
-      
-      def set_default
-        super
-        @values['part_name'] ||= @values['model_name']
-      end
-      
-      def init
-        super
-        @part_name = @values['part_name']
-      end
-      
-      def form_field_name
-        @model_name + '[' + @model_name + '_attributes][' + @column_name + ']'
-      end
-      
-    end
-    
   end
 end
index b260f73..61ec558 100644 (file)
@@ -23,7 +23,7 @@ module LocalManifest
             @parent.name
           end
           
-          def model_name
+          def item_name
             self.form_name
           end
           
index 22fd1ee..93f1f07 100644 (file)
@@ -5,20 +5,22 @@ module LocalManifest
   class ListGroup < ManifestBase::Base
     include ListGroupModule
     
-    attr :item_name, :lists
+    attr :lists
     
     def set_default
       super
-      @json['item_name'] ||= @name
       @json['lists'] ||= {}
     end
     
     def init
       super
-      @item_name = @json['item_name']
       @lists = ManifestBase.load_type_name_args self, @json, 'lists', ListFactory
     end
     
+    def controller_name
+      @name
+    end
+    
   end
   
 end
index 4fc88f7..d0a0c41 100644 (file)
@@ -1,52 +1,47 @@
 ManifestBase.require_modules "local_manifest/list_group/list/", 
-  %w|where includes order|
+  %w|where includes|
 
 module LocalManifest
   module ListGroupModule
     module ListModule
       class Base < ManifestBase::TypeNameArgs
-        attr :model_manifest, :model_list_manifest, :model, 
-          :where, :includes, :order
+        attr :where, :includes
         
         def set_default
           super
           @args['where'] ||= {}
           @args['includes'] ||= {}
-          @args['order'] ||= {}
         end
         
         def init
           super
           @where = ManifestBase.load_type_args self, @args, 'where', WhereFactory
           @includes = ManifestBase.load_type_args self, @args, 'includes', IncludeFactory
-          @order = ManifestBase.load_type_args self, @args, 'order', OrderFactory
-          
-          @model_manifest = ::Manifest.manifest.models[self.item_name]
-          @model_list_manifest = @model_manifest.list
-          @model = ::Manifest.item_name_to_model self.item_name
         end
         
-        def has_id?
-          @type =~ /filter/
+        def model_manifest
+          ::Manifest.manifest.models[self.item_name]
         end
         
-        # url format 
-        # true: /path/id/action 
-        # nil: /path/action/id
-        def pre_id?
-          if @name =~ /^by_/
-            false
-          else
-            true
-          end
+        def model
+          ::Manifest.item_name_to_model self.item_name
+        end
+        
+        def item_name
+          self.action_manifest.item_name
+        end
+        
+        def action_manifest
+          c = ::Manifest.manifest.controllers[self.controller_name]
+          c.actions[self.action_name]
         end
         
         def action_name
-          ''
+          @name
         end
         
-        def item_name
-          @parent.item_name
+        def controller_name
+          @parent.controller_name
         end
         
         def list_group
index fdfe55f..8b219ec 100644 (file)
@@ -16,10 +16,6 @@ module LocalManifest
           @filter_key = @args['filter_key']
         end
         
-        def action_name
-          @name
-        end
-        
       end
     end
   end
diff --git a/lib/local_manifest/list_group/list/order.rb b/lib/local_manifest/list_group/list/order.rb
deleted file mode 100644 (file)
index b006bdb..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-ManifestBase.require_modules "local_manifest/list_group/list/order/", 
-  %w|base method auto|
-
-module LocalManifest
-  module ListGroupModule
-    module ListModule
-      class OrderFactory < ManifestBase::Factory
-        include OrderModule
-        
-        def self.types
-          {
-            'method' => OrderMethod, 'auto' => OrderAuto
-          }
-        end
-        
-        def self.default_type
-          'auto'
-        end
-        
-      end
-    end
-  end
-end
diff --git a/lib/local_manifest/list_group/list/order/auto.rb b/lib/local_manifest/list_group/list/order/auto.rb
deleted file mode 100644 (file)
index 6edd54b..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-module LocalManifest
-  module ListGroupModule
-    module ListModule
-      module OrderModule
-        class OrderAuto < Base
-          def set_default
-            super
-          end
-          
-          def init
-            super
-          end
-          
-          def order
-            'list_order'
-          end
-          
-        end
-      end
-    end
-  end
-end
diff --git a/lib/local_manifest/list_group/list/order/base.rb b/lib/local_manifest/list_group/list/order/base.rb
deleted file mode 100644 (file)
index fa1a60a..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-module LocalManifest
-  module ListGroupModule
-    module ListModule
-      module OrderModule
-        class Base < ManifestBase::TypeArgs
-          
-          def set_default
-            super
-          end
-          
-          def init
-            super
-          end
-          
-          def item_name
-            @parent.item_name
-          end
-          
-          def list_name
-            @parent.name
-          end
-          
-          def model
-            @parent.model
-          end
-          
-        end
-        
-      end
-    end
-  end
-end
diff --git a/lib/local_manifest/list_group/list/order/method.rb b/lib/local_manifest/list_group/list/order/method.rb
deleted file mode 100644 (file)
index 1dba6b4..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-module LocalManifest
-  module ListGroupModule
-    module ListModule
-      module OrderModule
-        class OrderMethod < Base
-          attr :method_name
-          
-          def set_default
-            super
-            @args['method_name'] ||= @parent.name + '_list_order'
-          end
-          
-          def init
-            super
-            @method_name = @args['method_name']
-          end
-          
-          def order
-            @method_name
-          end
-          
-        end
-        
-      end
-    end
-  end
-end
index 4f6e102..bdc688b 100644 (file)
@@ -16,78 +16,6 @@ module LocalManifest
           @filter_key = @args['filter_key']
         end
         
-        def action_name
-          @name
-        end
-        
-=begin
-        def set_default
-          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 offset cnt, prm = nil
-          offset = prm.to_i
-          offset = cnt - 1 if offset >= cnt
-          offset = cnt - offset.abs if offset < 0
-          offset = 0 if offset < 0
-          offset
-        end
-        
-        def limit prm
-          prm ||= @default_page_size
-          count = prm.to_i
-          count = @max_page_size if count > @max_page_size
-          count = @default_page_size if count < 1
-          count
-        end
-        
-        def items filter_item
-          c  = @count || self.count(filter_item)
-          o  = self.offset c, @offset
-          l  = self.limit @count
-          @model.where(self.where(filter_item)).includes(self.includes).order(self.order).offset(o).limit(l)
-        end
-        
-        def prev_offset filter_item
-          c  = @count || self.count(filter_item)
-          o  = self.offset c, @offset
-          l  = self.limit @count
-          if o > 0
-            if o - l < 0
-              0
-            else
-              o - l
-            end
-          else
-            nil
-          end
-        end
-        
-        def next_offset filter_item
-          c  = @count || self.count(filter_item)
-          o  = self.offset c, @offset
-          l  = self.limit @count
-          if o + l > c
-            nil
-          else
-            o + l
-          end
-        end
-=end
-        
       end
     end
   end
index 0e520dd..8567824 100644 (file)
@@ -2,7 +2,7 @@ module LocalManifest
   module ProfilerModule
     module AssociationModule
       class BelongsTo < ManifestBase::Names
-        attr :model_name
+        attr :item_name
         
         def set_default
           super
@@ -10,11 +10,11 @@ module LocalManifest
         
         def init
           super
-          @model_name = @name
+          @item_name = @name
         end
         
         def model
-          ::Manifest::item_name_to_model @model_name
+          ::Manifest::item_name_to_model @item_name
         end
         
         def association_name
index 2a23989..ed971a4 100644 (file)
@@ -2,7 +2,7 @@ module LocalManifest
   module ProfilerModule
     module AssociationModule
       class HasMany < ManifestBase::Names
-        attr :model_name, :list_name, :table_name
+        attr :controller_name, :item_name, :action_name
         
         def set_default
           super
@@ -11,26 +11,22 @@ module LocalManifest
         def init
           super
           if list_manifest = self.profiler.lists[@name]
-            @model_name = list_manifest.model_name
-            @list_name = list_manifest.list_name
+            @controller_name = list_manifest.controller_name
+            @action_name = list_manifest.action_name
           else
             n = @name.split '.'
             if n.size > 1
-              @table_name = n[0]
-              @model_name = @table_name.singularize
-              @list_name = n[1]
+              @controller_name = n[0]
+              @action_name = n[1]
             else
               ManifestBase::alert_undefined_message 'list', self.module_message
             end
           end
         end
         
-        def list
-          Locmare::ListGroup.list @model_name, @list_name
-        end
-        
         def model
-          ::Manifest::item_name_to_model @model_name
+          item_name = Manifest.manifest.controllers[@controller_name].actions[@action_name].item_name
+          ::Manifest::item_name_to_model item_name
         end
         
         def association_name
index f0bdf82..a9039bb 100644 (file)
@@ -2,7 +2,7 @@ module LocalManifest
   module ProfilerModule
     module AssociationModule
       class HasOne < ManifestBase::Names
-        attr :model_name, :list_name, :list
+        attr :controller_name, :item_name, :action_name
         
         def set_default
           super
@@ -11,25 +11,22 @@ module LocalManifest
         def init
           super
           if list_manifest = self.profiler.lists[@name]
-            @model_name = @parent.model_name
-            @list_name = @parent.list_name
+            @controller_name = list_manifest.controller_name
+            @action_name = list_manifest.action_name
           else
             n = @name.split '.'
             if n.size > 1
-              @model_name = n[0]
-              @list_name = n[1]
+              @controller_name = n[0]
+              @action_name = n[1]
             else
               ManifestBase::alert_undefined_message 'list', self.module_message
             end
           end
         end
         
-        def list
-          Locmare::ListGroup.list @model_name, @list_name
-        end
-        
         def model
-          ::Manifest::item_name_to_model @model_name
+          item_name = Manifest.manifest.controllers[@controller_name].actions[@action_name].item_name
+          ::Manifest::item_name_to_model item_name
         end
         
         def association_name
index 5b9c0a5..a97e0a1 100644 (file)
@@ -1,16 +1,16 @@
 module LocalManifest
   module ProfilerModule
     class List < ManifestBase::NameValues
-      attr :model_name, :list_name
+      attr :controller_name, :action_name
       
       def set_default
-        ManifestBase::alert_undefined_message "model_name", self.module_message unless @json['model_name']
-        ManifestBase::alert_undefined_message "list_name", self.module_message unless @json['list_name']
+        ManifestBase::alert_undefined_message "controller_name", self.module_message unless @json['controller_name']
+        ManifestBase::alert_undefined_message "action_name", self.module_message unless @json['action_name']
       end
       
       def init
-        @model_name = @json['model_name']
-        @list_name = @json['list_name']
+        @controller_name = @json['controller_name']
+        @action_name = @json['action_name']
       end
       
       def profiler_name
index 6dda2ab..8fef236 100644 (file)
@@ -23,7 +23,7 @@ module Locmare
       Manifest.manifest.system_resources.templates[@manifest.template_name]
     end
     
-    def model_name
+    def item_name
       self.template_path_name + '_' + @manifest.item_name_for_extend_model
     end
     
index 54dfcb4..0e75bb1 100644 (file)
@@ -23,7 +23,9 @@ module Locmare
                 class ActionLink < BaseLink
                   
                   def url
-                    @link_manifest.action_path + @item.id.to_s
+                    controller_manifest = @item.class.my_controller
+                    action_manifest = controller_manifest.actions[@link_manifest.action_name]
+                    action_manifest.url({'id' => @item.id.to_s})
                   end
                   
                 end
index e1efb8e..eceb344 100644 (file)
@@ -69,6 +69,12 @@ module Locmare
                 Manifest.manifest.magic_numbers['thumbnail_width']
               end
               
+              def url
+                controller_manifest = @item.class.my_controller
+                action_manifest = controller_manifest.actions['show']
+                action_manifest.url({'id' => @item.id.to_s, 'format' => 'prof'})
+              end
+              
             end
             
             class None < Base
index dba6389..58bc49d 100644 (file)
@@ -23,7 +23,9 @@ module Locmare
                 class ActionLink < BaseLink
                   
                   def url
-                    @link_manifest.action_path + @item.id.to_s
+                    controller_manifest = @item.class.my_controller
+                    action_manifest = controller_manifest.actions[@link_manifest.action_name]
+                    action_manifest.url({'id' => @item.id.to_s})
                   end
                 end
                 
index 041854a..c663f01 100644 (file)
@@ -80,7 +80,7 @@ module Locmare
           nil
         end
         if boost_name and extend_model # field is extend setting AND template has a extend model
-          extend_form_name = @item.boosters[boost_name].model_name
+          extend_form_name = @item.boosters[boost_name].item_name
           extend_item = @item.boosters[boost_name].extend_item
           @fields[field_name] = ExtendForm.new self, extend_form_name, extend_item, @mounted, @operators, field_name
         else
index 990b2eb..ecb9ea2 100644 (file)
@@ -14,7 +14,7 @@ module Locmare
         @field_manifest.helpers.each {|helper_name, helper_manifest|
           @helpers[helper_name] = HelperFactory.factory self, helper_manifest
         }
-        @options = {'data-model' => @field_manifest.model_name}
+        @options = {'data-model' => @field_manifest.item_name}
       end
       
       def mounted
index 3d10dd7..9265701 100644 (file)
@@ -30,8 +30,8 @@ module Locmare
             self.form.item
           end
           
-          def model_name
-            @label_manifest.model_name
+          def item_name
+            @label_manifest.item_name
           end
           
           def column_name
@@ -74,7 +74,7 @@ module Locmare
           end
           
           def label_name
-            'activerecord.attributes.' + self.model_name + '.' +  self.column_name
+            'activerecord.attributes.' + self.item_name + '.' +  self.column_name
           end
           
         end
index a83f839..c3797a4 100644 (file)
@@ -42,14 +42,6 @@ module Locmare
             self.form.item
           end
           
-          def model_name
-            @tag_manifest.model_name
-          end
-          
-          def column_name
-            @tag_manifest.column_name
-          end
-          
           def template_dir
             self.form.template_dir + 'tag/'
           end
index f3a629e..4e38f37 100644 (file)
@@ -8,7 +8,7 @@ module Locmare
           end
           
           def model_manifest
-            ::Manifest.manifest.models[@field.field_manifest.model_name]
+            ::Manifest.manifest.models[@field.field_manifest.item_name]
           end
           
           def model_attribute_manifest
@@ -20,13 +20,19 @@ module Locmare
           end
           
           def items
-            if self.source_by_model?
-              resource_model_name = self.model_attribute_manifest.source.resource_model_name
-              resource_list_name = self.model_attribute_manifest.source.resource_list_name
+            if self.source_by_filter?
+              resource_item_name = self.model_attribute_manifest.source.resource_item_name
+              resource_action_name = self.model_attribute_manifest.source.resource_action_name
               filter_column_name = self.model_attribute_manifest.source.filter_column_name
               filter_id = self.form.item.attributes[filter_column_name]
-              list = Locmare::ListGroup.list resource_model_name, resource_list_name
-              list.items(nil, {:id => filter_id}, 
+              resource_controller_name = ::Manifest.manifest.models[resource_item_name].classify.table_name
+              list = Locmare::ListGroup.list(
+                resource_controller_name, 
+                resource_action_name, 
+                self.form.operators, 
+                {:id => filter_id}
+              )
+              list.items(nil, 
                 0, -1 # no limit
               ).map {|i| [i.caption, i.id] }
             else
@@ -34,7 +40,7 @@ module Locmare
             end
           end
           
-          def source_by_model?
+          def source_by_filter?
             case self.model_attribute_manifest.source.type
             when 'filter'
               true
index e208938..eae27aa 100644 (file)
@@ -18,10 +18,19 @@ module Locmare
       }
     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
+    def self.list controller_name, action_name, operators, options = {}
+      controller_manifest = Manifest.manifest.controllers[controller_name]
+      action_manifest = controller_manifest.actions[action_name]
+      if action_manifest.alias
+        options['order'] ||= action_manifest.order
+        options['direction'] ||= action_manifest.direction
+        alias_action = action_manifest.alias_action
+        ::Locmare::ListGroup.list alias_action.path_name, alias_action.name, operators, options
+      else
+        list_group_manifest = LocalManifest.manifest.list_groups[controller_name]
+        list_manifest = list_group_manifest.lists[action_name]
+        self.types[list_manifest.type].new controller_name, action_name, operators, options
+      end
     end
     
   end
index bde05f1..7c900a0 100644 (file)
@@ -4,82 +4,145 @@ module Locmare
       class ListResult
         attr :list, :items, :count, :paginate
         
-        def initialize list, items, count, paginate, operators, options
+        def initialize list, items, count, paginate, operators
           @list = list
           @items = items
           @count = count  # total count
           @paginate = paginate
           @operators = operators
-          @options = options
         end
         
         def path
-          if list_manifest.has_id?
-            filter_item_id = @options[:id]
-            if list_manifest.pre_id?
-              '/' + list_manifest.model.path_name + '/' + filter_item_id.to_s + '/' + list_manifest.action_name
-            else
-              '/' + list_manifest.model.path_name + '/' + list_manifest.action_name + '/' + filter_item_id.to_s
-            end
-          else
-            '/' + list_manifest.model.path_name + '/' + list_manifest.action_name
-          end
-        end
-        
-        def list_manifest
-          @list.list_manifest
+          @list.action_manifest.url @list.options
         end
         
       end
       
-      attr :item_name, :list_name, 
-        :model_manifest, :model_list_manifest, :list_manifest, :model, 
-        :default_page_size, :max_page_size
-      def initialize item_name, list_name
-        @item_name = item_name
+      attr :list_group_name, :list_name, :options, :item_name, 
+        :controller_manifest, :action_manifest, :list_manifest, :model,
+        :count
+      def initialize list_group_name, list_name, operators, options = {}
+        @list_group_name = list_group_name
         @list_name = list_name
-        self.init
-      end
-      
-      def init
-        @list_group_manifest = LocalManifest.manifest.list_groups[@item_name]
+        @operators = operators
+        @options = options
+        
+        @list_group_manifest = LocalManifest.manifest.list_groups[@list_group_name]
         @list_manifest = @list_group_manifest.lists[@list_name]
         @where = @list_manifest.where
         @includes = @list_manifest.includes
-        @order = @list_manifest.order
-        @model_manifest = ::Manifest.manifest.models[@item_name]
-        @model_list_manifest = @model_manifest.list
+        
+        @controller_name = @list_group_name
+        @action_name = @list_name
+        @controller_manifest = ::Manifest.manifest.controllers[@controller_name]
+        @action_manifest = @controller_manifest.actions[@action_name]
+        @item_name = @action_manifest.item_name
         @model = ::Manifest.item_name_to_model @item_name
         @table_name = @model.table_name
+        self.init
+      end
+      
+      def init
+        self.set_count
+        self.set_offset
+        self.set_limit
       end
       
       def model_name
         @model.model_name
       end
       
-      def model_manifest
-        @model.model_manifest
+      def set_offset
+        if prm = @options['offset'] || @options[:offset]
+          @offset = prm.to_i
+          @offset = @count - 1 if @offset >= @count
+          @offset = @count - @offset.abs if @offset < 0
+          @offset = 0 if @offset < 0
+          offset
+        else
+          @offset = (self.fixed_page - 1) * self.fixed_page_size
+        end
+        @offset
+      end
+      
+      def limit?
+        self.max_page_size > 0
+      end
+      
+      def unlimit?
+        !limit?
       end
       
-      def page_number prm = nil
-        page = prm.to_i
+      def fixed_page
+        page = self.opt_page.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
+      def fixed_page_size
+        page_size = self.opt_page_size || self.default_page_size
+        page_size = self.max_page_size if self.limit? and (page_size > self.max_page_size)
         page_size
       end
       
+      def set_limit
+        prm = self.opt_page_size || self.opt_count
+        @limit = prm.to_i
+        if self.max_page_size > 0
+          @limit = self.max_page_size if @limit > self.max_page_size
+        else  # unlimited api
+          @limit = @count if @limit > @count
+        end
+        @limit = self.default_page_size if @limit < 1
+        @limit
+      end
+      
+      def opt_page
+        n = @options['page'] || @options[:page]
+        n ? n.to_i : nil
+      end
+      
+      def opt_page_size
+        n = @options['page_size'] || @options[:page_size]
+        n ? n.to_i : nil
+      end
+      
+      def opt_count
+        n = @options['count'] || @options[:count]
+        n ? n.to_i : nil
+      end
+      
       def default_page_size
-        @model_list_manifest.default_page_size
+        @action_manifest.default_page_size
       end
       
       def max_page_size
-        @model_list_manifest.max_page_size
+        @action_manifest.max_page_size
+      end
+      
+      def order
+        order = @options['order'] || @options[:order] || @action_manifest.order
+        order = 'updated_at' unless ::Manifest.manifest.models[@item_name].attributes[order]
+        @table_name + '.' + order
+      end
+      
+      def direction
+        direction = @options['direction'] || @options[:direction] || @action_manifest.direction
+        if direction < 0
+          'desc'
+        elsif direction > 0
+          'asc'
+        else
+          ''
+        end
+      end
+      
+      def filter_id
+        @options['id'] || @options[:id]
+      end
+      
+      def order_by
+        self.order + ' ' + self.direction
       end
       
       def base_where_condition
@@ -97,21 +160,27 @@ module Locmare
         @includes.includes
       end
       
-      def order
-        @model.__send__ @order.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)
+      def items
+        @model.where(
+          self.where_condition
+        ).includes(
+          self.include_hash
+        ).order(
+          self.order_by
+        ).offset(@offset).limit(@limit)
       end
       
-      def count operators, options
-        @model.where(self.where_condition).includes(self.include_hash).count
+      def set_count
+        @count = @model.where(
+          self.where_condition
+        ).includes(
+          self.include_hash
+        ).count
       end
       
-      def paginate count, page, page_size
+      def paginate count
         c = count ? count.to_i : 0
-        Kaminari.paginate_array(Array.new(c, nil)).page(page).per(page_size)
+        Kaminari.paginate_array(Array.new(c, nil)).page(self.fixed_page).per(self.fixed_page_size)
       end
       
       def boost_manifests
@@ -129,15 +198,15 @@ module Locmare
         end
       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, page, page_size
+      def open operators
+        items = self.items
+        pg = if limit?
+          self.paginate @count
+        else
+          nil
+        end
         self.boost items
-        ListResult.new self, items, count, pg, operators, options
+        ListResult.new self, items, @count, pg, @operators
       end
       
     end
index 4f98930..1e8d69c 100644 (file)
@@ -4,17 +4,17 @@ module Locmare
       attr :filter_key, :filter_item_name
       
       def init
-        super
         @filter_key = @list_manifest.filter_key
         @filter_item_name = @list_manifest.filter_item_name
         @filter_model = ::Manifest.manifest.models[@filter_item_name].classify
         @filter_table_name = @filter_model.table_name
+        super
       end
       
-      def where_condition filter_item_id
+      def where_condition
         w = self.base_where_condition
         w += ' and ' unless w.blank?
-        [w + @table_name + '.' + @filter_key + ' = ?', filter_item_id] 
+        [w + @table_name + '.' + @filter_key + ' = ?', self.filter_id] 
       end
       
       def include_hash
@@ -23,29 +23,37 @@ module Locmare
         w
       end
       
-      def visible? item_id, operators
+      def visible?
         r = nil
         begin
-          r = @filter_model.show(item_id, operators)
+          r = @filter_model.show(self.filter_id, @operators)
         rescue ActiveRecord::RecordNotFound, ActiveRecord::Forbidden
           r = false
         end
         r
       end
       
-      def items operators, options, offset, page_size
-        filter_item_id = options[:id]
-        if self.visible? filter_item_id, operators
-          @model.where(self.where_condition(filter_item_id)).includes(self.include_hash).order(self.order).offset(offset).limit(page_size)
+      def items
+        if self.visible?
+          @model.where(
+            self.where_condition
+          ).includes(
+            self.include_hash
+          ).order(
+            self.order_by
+          ).offset(@offset).limit(@limit)
         else
           []
         end
       end
       
-      def count operators, options
-        filter_item_id = options[:id]
-        if self.visible? filter_item_id, operators
-          @model.where(self.where_condition(filter_item_id)).includes(self.include_hash).count
+      def count
+        if self.visible?
+          @model.where(
+            self.where_condition
+          ).includes(
+            self.include_hash
+          ).count
         else
           0
         end
index ece86ac..c86a453 100644 (file)
@@ -7,10 +7,10 @@ module Locmare
         @filter_table_name = ::Manifest.manifest.models[@filter_item_name].classify.table_name
       end
       
-      def where_condition filter_item_id
+      def where_condition
         w = self.base_where_condition
         w += ' and ' unless w.blank?
-        [w + @filter_table_name + '.id' + ' = ?', filter_item_id] 
+        [w + @filter_table_name + '.id' + ' = ?', self.filter_id] 
       end
       
       def include_hash
index 1394a17..3b05203 100644 (file)
@@ -6,7 +6,7 @@ module Locmare
         super
       end
       
-      def where_condition operators
+      def where_condition
         owner_model = if @model.element?
           @model.root_model
         else
@@ -14,20 +14,29 @@ module Locmare
         end
         case owner_model.owner_type
         when :author
-          operator = operators.author
+          operator = @operators.author
         when :artist
-          operator = operators.artist
+          operator = @operators.artist
         end
         [owner_model.table_name + '.' + owner_model.owner_type.to_s + '_id = ?', operator.id]
       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)
+      def items
+        @model.where(
+          self.where_condition
+        ).includes(
+          self.include_hash
+        ).order(
+          self.order_by
+        ).offset(@offset).limit(@limit)
       end
       
-      def count operators, options
-        filter_item_id = options[:id]
-        @model.where(self.where_condition(operators)).includes(self.include_hash).count
+      def count
+        @model.where(
+          self.where_condition
+        ).includes(
+          self.include_hash
+        ).count
       end
       
     end
index 9259827..11f55c0 100644 (file)
@@ -6,10 +6,6 @@ module Locmare
         super
       end
       
-      def order
-        @model.list_order
-      end
-      
     end
     
   end
index 9cc0343..5f88884 100644 (file)
@@ -6,7 +6,7 @@ module Locmare
         super
       end
       
-      def items operators, options, offset, page_size
+      def items
         # enable_list does not work when configured auto load in development.rb
         # auto loader undefing MODEL at reload manifest file
         @model.enable_list
index d0317d4..16d0fc2 100644 (file)
@@ -4,18 +4,18 @@ module Locmare
       attr :through
       
       def init
-        super
         @through = @list_manifest.through
+        super
       end
       
       def include_hash
         {@through => {@filter_item_name => {}} }
       end
       
-      def where_condition filter_item_id
+      def where_condition
         w = self.base_where_condition
         w += ' and ' unless w.blank?
-        [w + @filter_table_name + '.id' + ' = ?', filter_item_id] 
+        [w + @filter_table_name + '.id' + ' = ?', self.filter_id] 
       end
       
     end
index f7d680e..a40cf36 100644 (file)
@@ -35,7 +35,7 @@ module Locmare
         end
         
         def model_belongs_to_manifest
-          self.model_manifest.associations.belongs_to[@belongs_to_manifest.model_name]
+          self.model_manifest.associations.belongs_to[@belongs_to_manifest.item_name]
         end
         
         def profiler
index 030d06d..62cfbce 100644 (file)
@@ -17,7 +17,13 @@ module Locmare
         end
         
         def filer
-          list_result = @has_many_manifest.list.open(self.profiler.operators, {:id => self.item.id, :page => 1, :page_size => 3})
+          list = ::Locmare::ListGroup.list(
+            @has_many_manifest.controller_name, 
+            @has_many_manifest.action_name, 
+            self.profiler.operators, 
+            {:id => self.item.id, :page => 1, :page_size => 3}
+          )
+          list_result = list.open(self.profiler.operators)
           items = list_result.items
           ::Locmare::Filer.new self.has_many_model.item_name, items, list_result, :more, self.profiler.operators
         end
index 326c1ec..954554c 100644 (file)
@@ -17,7 +17,13 @@ module Locmare
         end
         
         def filer
-          list_result = @has_one_manifest.list.open(self.profiler.operators, {:id => self.item.id})
+          list = ::Locmare::ListGroup.list(
+            @has_one_manifest.controller_name, 
+            @has_one_manifest.action_name, 
+            self.profiler.operators, 
+            {:id => self.item.id}
+          )
+          list_result = list.open(self.profiler.operators)
           items = list_result.items 
           ::Locmare::Filer.new self.has_one_model.item_name, items, nil, :none, self.profiler.operators
         end
index c86927f..1c6b155 100644 (file)
@@ -24,7 +24,7 @@ module Locmare
         end
         
         def extend_settings
-          self.template_model_profiler.extend_settings[self.booster.model_name]
+          self.template_model_profiler.extend_settings[self.booster.item_name]
         end
         
         def template_model_profiler
index 678d6d6..a2d55b0 100644 (file)
@@ -4,17 +4,15 @@ ManifestBase.require_modules "manifest/controller/",
 module Manifest
   class Controller < ManifestBase::Base
     include ControllerModule
-    attr :item_name, :actions
+    attr :actions
     
     def set_default
       super
-      @json['item_name'] ||= ::Manifest.singularize(@name)
       @json['actions'] ||= {}
     end
     
     def init
       super
-      @item_name = @json['item_name']
       @actions = ManifestBase.load_type_name_args self, @json, 'actions', ActionFactory
     end
     
index a832b22..e7488e5 100644 (file)
@@ -2,16 +2,70 @@ module Manifest
   module ControllerModule
     module ActionModule
       class Base < ManifestBase::TypeNameArgs
-        attr :item_name
+        attr :param_id, :item_name, :action_name
         
         def set_default
           super
-          @args['item_name'] ||= self.parent.item_name  # not parent.name. follow singularized name
+          @args['item_name'] ||= ::Manifest.manifest.singularize(@parent.name)
+          @args['param_id'] ||= 'prefix'
         end
         
         def init
           super
+          @action_name = @name
           @item_name = @args['item_name']
+          @param_id = @args['param_id']
+        end
+        
+        def path_name
+          ::Manifest.manifest.pluralize(@item_name)
+        end
+        
+        def encode_query params
+          q = []
+          q.push('page=' + params['page'].to_s) if params['page']
+          q.push('page_size=' + params['page_size'].to_s) if params['page_size']
+          if q.length > 0
+            '?' + q.join('&')
+          else
+            ''
+          end
+        end
+        
+        def encode_url params = {}
+          controller_name = '/' + self.path_name
+          c = controller_name
+          a = if @name == 'index' or @name == 'show' or @name == 'destroy'
+            ''
+          else
+            '/' + @name
+          end
+          pf = params['format'] || params[:format]
+          # f = if params['format']   # json request? so bad. html request as get rest api
+          f = if pf == 'prof'
+            '.' + params['format'].to_s
+          else
+            ''
+          end
+          pid = params['id'] || params[:id]
+          i = if pid
+            '/' + params['id'].to_s
+          else
+            ''
+          end
+          q = self.encode_query(params)
+          case @param_id
+          when 'prefix'
+            c + i + a + f + q
+          when 'suffix'
+            c + a + i + f + q
+          else
+            c + a + f + q
+          end
+        end
+        
+        def url params
+          self.encode_url(params)
         end
         
       end
index dd7a0f2..189d69e 100644 (file)
@@ -2,16 +2,16 @@ module Manifest
   module ControllerModule
     module ActionModule
       class ActionCount < Base
-        attr :list_name
+        attr :alias
         
         def set_default
           super
-          @args['list_name'] ||= @name.gsub(/^count_/, '')
+          @args['action_name'] ||= @name.gsub(/^count_/, '')
         end
         
         def init
           super
-          @list_name = @args['list_name']
+          @action_name = @args['action_name']
         end
         
       end
index 4ce8f67..0475a49 100644 (file)
@@ -2,16 +2,42 @@ module Manifest
   module ControllerModule
     module ActionModule
       class ActionList < Base
-        attr :list_name
+        attr :alias, :order, :direction, :default_page_size, :max_page_size
         
         def set_default
           super
-          @args['list_name'] ||= @name
+          @args['direction'] ||= -1
+          @args['default_page_size'] ||= 25
+          @args['max_page_size'] ||= 100
         end
         
         def init
           super
-          @list_name = @args['list_name']
+          @alias = @args['alias']
+          @order = @args['order'] || 'updated_at'
+          @direction = @args['direction'].to_i
+          @default_page_size = @args['default_page_size']
+          @max_page_size = @args['max_page_size']
+          @counter_name = if @args['counter_name']
+            @args['counter_name']
+          else
+            if @name == 'index'
+              'count'
+            else
+              'count_' + @name
+            end
+          end
+        end
+        
+        def alias_action
+          s = @alias.split('.')
+          c = ::Manifest.manifest.controllers[s[0]]
+          c.actions[s[1]]
+        end
+        
+        def counter_url params
+          action_manifest = @parent.actions[@counter_name]
+          self.encode_url(params)
         end
         
       end
index d92cfd6..4ace4e2 100644 (file)
@@ -5,7 +5,7 @@ module Manifest
   module ItemModule
     class BasePeta < ManifestBase::TypeNameArgs
       
-      attr :boost ,:parent_model_name
+      attr :boost ,:parent_item_name
       
       def set_default
         super
@@ -14,12 +14,12 @@ module Manifest
       
       def init
         super
-        @parent_model_name = nil  # init at leaf, element
+        @parent_item_name = nil  # init at leaf, element
         @boost = ManifestBase.load_name_values self, @args, 'boost', Boost
       end
       
       def element?
-        @parent_model_name != nil
+        @parent_item_name != nil
       end
       
       def find_boost_name column_name
index 9a4ed72..f532db5 100644 (file)
@@ -1,16 +1,16 @@
 module Manifest
   module ItemModule
     class ElementPeta < BasePeta
-      attr :parent_model_name
+      attr :parent_item_name
       
       def set_default
         super
-        ManifestBase.alert_undefined_message 'parent_model_name', self.module_message unless @args['parent_model_name']
+        ManifestBase.alert_undefined_message 'parent_item_name', self.module_message unless @args['parent_item_name']
       end
       
       def init
         super
-        @parent_model_name = @args['parent_model_name']
+        @parent_item_name = @args['parent_item_name']
       end
       
     end
index c78e9cb..0e4723f 100644 (file)
@@ -1,17 +1,17 @@
 module Manifest
   module ItemModule
     class LeafPeta < BasePeta
-      attr :parent_model_name, :destination_model_name
+      attr :parent_item_name, :destination_item_name
       
       def set_default
         super
-        ManifestBase.alert_undefined_message 'parent_model_name', self.module_message unless @args['parent_model_name']
+        ManifestBase.alert_undefined_message 'parent_item_name', self.module_message unless @args['parent_item_name']
       end
       
       def init
         super
-        @parent_model_name = @args['parent_model_name']
-        @destination_model_name = @args['destination_model_name']
+        @parent_item_name = @args['parent_item_name']
+        @destination_item_name = @args['destination_item_name']
       end
       
     end
index 1108921..1fc9df7 100644 (file)
@@ -2,7 +2,8 @@ module Manifest
   class Manifest
     cattr_accessor :manifest
     attr :system_resources, :magic_numbers,
-      :items, :controllers, :models, :module_names
+      :items, :controllers, :models, :module_names, 
+      :inflectors, :singulars, :plurals
     # call me before load routes.rb
     # routes.rb needs engine_resources manifest in system_resources
     # ex. it's adding license_groups routes
@@ -16,6 +17,13 @@ module Manifest
     def init
       # managers can't initialize before load  application.rb
       return unless defined? ::Pettanr
+      @inflectors = @global_json['inflectors']
+      @item_names = {}
+      @table_names = {}
+      @inflectors.each do |item_name, table_name|
+        @item_names[item_name] = table_name  # monkey copy
+        @table_names[table_name] = item_name
+      end
       @items = ManifestBase.load_type_name_args(self, @global_json, 'items', ItemFactory)
       @controllers = Controller.load(self, @global_json, 'controllers')
       @models = Model.load(self, @global_json, 'models')
@@ -33,6 +41,16 @@ module Manifest
       end
     end
     
+    # table_name to item_name
+    def singularize table_name
+      @table_names[table_name]
+    end
+    
+    # item_name to table_name
+    def pluralize item_name
+      @item_names[item_name]
+    end
+    
   end
   
   module ModuleMethods
@@ -48,14 +66,6 @@ module Manifest
       item_name.classify.constantize
     end
     
-    def singularize name
-      name.singularize
-    end
-    
-    def pluralize name
-      name.pluralize
-    end
-    
   end
 
   extend ModuleMethods
index 90059f7..2606b62 100644 (file)
@@ -1,17 +1,17 @@
 ManifestBase.require_modules "manifest/model/", 
-  %w|attribute association list|
+  %w|attribute association|
 
 module Manifest
   class Model < ManifestBase::Base
     include ModelModule
     
-    attr :attributes, :associations, :list
+    attr :attributes, :associations, :table_name
     
     def set_default
       super
+      @json['table_name'] ||= ::Manifest.manifest.pluralize(@name)
       @json['attributes'] ||= {}
       @json['associations'] ||= {}
-      @json['list'] ||= {}
       @json['attributes']['id'] = {
         'type' => 'number',
         'primary_key' => 1,
@@ -29,12 +29,12 @@ module Manifest
     
     def init
       super
+      @table_name = @json['table_name']
       @attributes = ManifestBase.load_name_values self, @json, 'attributes', Attribute
       @associations = ManifestBase.load_value self, @json, 'associations', Association
-      @list = ManifestBase.load_value self, @json, 'list', List
     end
     
-    def model_name
+    def item_name
       @name
     end
     
@@ -42,10 +42,6 @@ module Manifest
       ::Manifest.item_name_to_model @name
     end
     
-    def table_name
-      self.classify.table_name
-    end
-    
     def valid_encode_columns
       r = []
       @attributes.each {|attribute_name, attribute|
@@ -61,7 +57,7 @@ module Manifest
       false
     end
     
-    def content_model
+    def content_model?
       return true if self.owner_type
       false
     end
@@ -70,7 +66,7 @@ module Manifest
       r = []
       ::Manifest.manifest.items.each {|peta_name, peta_manifest|
         next unless peta_manifest.element?
-        next unless peta_manifest.parent_model_name == @name
+        next unless peta_manifest.parent_item_name == @name
         r << ::Manifest.manifest.models[peta_name]
       }
       r
index a24cec2..36b6ae0 100644 (file)
@@ -22,17 +22,18 @@ module Manifest
         @has_one = ManifestBase.load_name_values self, @values, 'has_one', HasOne
       end
       
-      def model_name
-        @parent.name
+      def item_name
+        @parent.item_name
       end
       
       def each_parent_model
         @belongs_to.each do |name, belongs_to_manifest|
-          next unless @parent.classify.element?
-          if @parent.classify.my_peta.type == 'element'
+          pm = @parent.classify
+          next unless pm.element?
+          if pm.my_peta.type == 'element'
             next unless belongs_to_manifest.model.my_peta.type == 'root'
           end
-          if @parent.classify.my_peta.type == 'leaf'
+          if pm.my_peta.type == 'leaf'
             next unless belongs_to_manifest.model.my_peta.type == 'binder'
           end
           yield belongs_to_manifest.model
index bd96075..354cccd 100644 (file)
@@ -2,22 +2,22 @@ module Manifest
   module ModelModule
     module AssociationModule
       class BelongsTo < ManifestBase::NameValues
-        attr :id_column, :model_name
+        attr :id_column, :item_name
         
         def set_default
           super
-          @values['model_name'] ||= @name
+          @values['item_name'] ||= @name
           @values['id_column'] ||= @name + '_id' 
         end
         
         def init
           super
-          @model_name = @values['model_name']
+          @item_name = @values['item_name']
           @id_column = @values['id_column']
         end
         
         def model
-          ::Manifest.item_name_to_model @model_name
+          ::Manifest.item_name_to_model @item_name
         end
         
       end
index 8a9c7cd..3a3555a 100644 (file)
@@ -2,17 +2,17 @@ module Manifest
   module ModelModule
     module AssociationModule
       class HasMany < ManifestBase::NameValues
-        attr :model_name, :foreign_key, :through
+        attr :foreign_key, :through, :item_name
         
         def set_default
           super
-          @values['model_name'] ||= ::Manifest.singularize @name
-          @values['foreign_key'] ||= @parent.model_name + '_id'
+          @values['item_name'] ||= ::Manifest.manifest.singularize(@name)
+          @values['foreign_key'] ||= @parent.item_name + '_id'
         end
         
         def init
           super
-          @model_name = @values['model_name']
+          @item_name = @values['item_name']
           @foreign_key = @values['foreign_key']
           @through = @values['through']
         end
@@ -22,7 +22,7 @@ module Manifest
         end
         
         def model
-          ::Manifest.item_name_to_model @model_name
+          ::Manifest.item_name_to_model @item_name
         end
         
       end
index a85d39c..e85b019 100644 (file)
@@ -2,17 +2,17 @@ module Manifest
   module ModelModule
     module AssociationModule
       class HasOne < ManifestBase::NameValues
-        attr :model_name, :foreign_key
+        attr :item_name, :foreign_key
         
         def set_default
           super
-          @values['model_name'] ||= @name
-          @values['foreign_key'] ||= @parent.model_name + '_id'
+          @values['item_name'] ||= @name
+          @values['foreign_key'] ||= @parent.item_name + '_id'
         end
         
         def init
           super
-          @model_name = @values['model_name']
+          @item_name = @values['item_name']
           @foreign_key = @values['foreign_key']
         end
         
@@ -21,7 +21,7 @@ module Manifest
         end
         
         def model
-          ::Manifest.item_name_to_model @model_name
+          ::Manifest.item_name_to_model @item_name
         end
         
       end
index eaceb58..e9df9b0 100644 (file)
@@ -25,8 +25,8 @@ module Manifest
         end
       end
       
-      def model_name
-        @parent.name
+      def item_name
+        @parent.item_name
       end
       
     end
index a57bbdb..ce94a50 100644 (file)
@@ -12,8 +12,8 @@ module Manifest
             super
           end
           
-          def model_name
-            @parent.model_name
+          def item_name
+            @parent.item_name
           end
           
         end
index 36eb6aa..ea70de2 100644 (file)
@@ -3,21 +3,21 @@ module Manifest
     module AttributeModule
       module SourceModule
         class ModelSource < Base
-          attr :resource_model_name, :resource_list_name, 
+          attr :resource_item_name, :resource_action_name, 
             :select_item_name, :caption_name
           
           def set_default
             super
-            @args['resource_model_name'] ||= (@parent.name.gsub('_id', ''))
-            @args['resource_list_name'] ||= 'select_items'
-            @args['select_item_name'] ||= self.model_name + '_' + @parent.name.gsub('_id', '') + '_items'
+            @args['resource_item_name'] ||= (@parent.name.gsub('_id', ''))
+            @args['resource_action_name'] ||= 'index'
+            @args['select_item_name'] ||= self.item_name + '_' + @parent.name.gsub('_id', '') + '_items'
             @args['caption_name'] ||= 'caption'
           end
           
           def init
             super
-            @resource_model_name = @args['resource_model_name']
-            @resource_list_name = @args['resource_list_name']
+            @resource_item_name = @args['resource_item_name']
+            @resource_action_name = @args['resource_action_name']
             @select_item_name = @args['select_item_name']
             @caption_name = @args['caption_name']
           end
diff --git a/lib/manifest/model/list.rb b/lib/manifest/model/list.rb
deleted file mode 100644 (file)
index b41d921..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-module Manifest
-  module ModelModule
-    class List < ManifestBase::Values
-      attr :default_page_size, :max_page_size
-      
-      def set_default
-        super
-        @values['default_page_size'] ||= 25
-        @values['max_page_size'] ||= 100
-      end
-      
-      def init
-        super
-        @default_page_size = @values['default_page_size']
-        @max_page_size = @values['max_page_size']
-      end
-      
-    end
-    
-  end
-end
index 8d5eea2..b765146 100644 (file)
@@ -35,16 +35,22 @@ module Manifest
           source_manifest = attribute_manifest.source
           next unless source_manifest
           next unless source_manifest.type == 'model'
-          resource_model_name = source_manifest.resource_model_name
-          resource_list_name = source_manifest.resource_list_name
+          resource_item_name = source_manifest.resource_item_name
+          resource_action_name = source_manifest.resource_action_name
           caption = source_manifest.caption_name
+          resource_controller_name = ::Manifest.manifest.pluralize(resource_item_name)
           begin
-            list = Locmare::ListGroup.list resource_model_name, resource_list_name
-            r = list.open nil, {}
+            list = Locmare::ListGroup.list(
+              resource_controller_name, 
+              resource_action_name, 
+              nil, 
+              {}  # set no limit options
+            )
+            r = list.open nil
             @select_items[source_manifest.select_item_name] = 
               r.items.map {|item| [item.attributes[caption], item.id]}
           rescue
-            puts 'skip store select_items:' + resource_model_name + '.' + resource_list_name
+            puts 'skip store select_items:' + resource_item_name + '.' + resource_action_name
           end
         }
       }
index 5ded097..5ff3f9b 100644 (file)
@@ -8,7 +8,7 @@ module Peta
       super
       return nil if self._skip_load?
       # Class Methods
-      ct = self.my_manifest.content_model
+      ct = self.my_manifest.content_model?
       define_singleton_method("content?") do 
         ct
       end
index 35be5f6..cf0bd70 100644 (file)
@@ -8,11 +8,11 @@ module Peta
       super
       return nil if self._skip_load?
       # Class Methods
-      pm = Manifest.manifest.models[self.my_peta.parent_model_name].classify
+      pm = Manifest.manifest.models[self.my_peta.parent_item_name].classify
       define_singleton_method("parent_model") do 
         pm
       end
-      pfk = self.my_peta.parent_model_name + '_id'
+      pfk = self.my_peta.parent_item_name + '_id'
       define_singleton_method("parent_key") do 
         pfk
       end
@@ -38,11 +38,11 @@ module Peta
     # Instance Methods
     
     def root
-      pm = self.__send__ self.class.parent_model.item_name
-      if pm.class.element?
-        pm.root
+      pi = self.__send__ self.class.parent_model.item_name
+      if pi.class.element?
+        pi.root
       else
-        pm
+        pi
       end
     end
     
index db22a10..0dadd32 100644 (file)
@@ -37,7 +37,6 @@ module Peta
     
     # ClassMethods
     # class_name
-    # table_name
     
     before_validation :valid_encode
     
@@ -61,13 +60,20 @@ module Peta
     end
     
     def self.plural
-      self.singular.pluralize
+      table_name = Manifest.manifest.pluralize self.item_name
+      table_name.camelize
     end
     
     def self.item_name
       self.singular.underscore
     end
     
+    # self.model_name
+    # => "PanelPicture"
+    
+    # self.table_name
+    # => "panel_picture"
+    
     def self.item?
       true
     end
@@ -89,7 +95,7 @@ module Peta
     end
     
     def self.path_name with_engine = false
-      self.plural.underscore
+      self.table_name
     end
     
     def self.pickup_item_name
@@ -112,10 +118,6 @@ module Peta
       ''
     end
     
-    def self.list_order
-      self.table_name + '.updated_at desc'
-    end
-    
     def self.list_opt
       {}
     end
@@ -279,6 +281,10 @@ module Peta
       r
     end
     
+    def tag_attr column = nil, opt = {}
+      self.tag_attributes(column, opt).to_attr
+    end
+    
     def field_tag_attributes column_name, opt = {}
       self.tag_attributes(column_name, opt).merge(
         {'data-column_name' => column_name}
index 51ea19c..6d987c6 100644 (file)
@@ -8,20 +8,20 @@ module Peta
       super
       return nil if self._skip_load?
       # Class Methods
-      pm = Manifest.manifest.models[self.my_peta.parent_model_name].classify
+      pm = Manifest.manifest.models[self.my_peta.parent_item_name].classify
       define_singleton_method("parent_model") do 
         pm
       end
-      destm = Manifest.manifest.models[self.my_peta.destination_model_name].classify
+      destm = Manifest.manifest.models[self.my_peta.destination_item_name].classify
       define_singleton_method("destination_model") do 
         destm
       end
-      pfk = self.my_peta.parent_model_name + '_id'
+      pfk = self.my_peta.parent_item_name + '_id'
       define_singleton_method("binder_key") do 
         pfk
       end
-      dest_key = if self.my_peta.destination_model_name
-        self.my_peta.destination_model_name + '_id'
+      dest_key = if self.my_peta.destination_item_name
+        self.my_peta.destination_item_name + '_id'
       else
         nil
       end
index 790af74..e8da658 100644 (file)
@@ -1,20 +1,17 @@
 {\r
   "list_groups": {\r
-    "folder": {\r
+    "folders": {\r
       "lists": {\r
-        "public": {\r
+        "index": {\r
           "type": "public"\r
         }\r
       }\r
     },\r
-    "scroll": {\r
+    "scrolls": {\r
       "lists": {\r
-        "public": {\r
+        "index": {\r
           "type": "public"\r
         },\r
-        "private": {\r
-          "type": "private"\r
-        },\r
         "by_author": {\r
           "type": "filter"\r
         },\r
           "args": {\r
             "through": "scroll_panels"\r
           }\r
+        },\r
+        "play": {\r
+          "type": "play"\r
         }\r
       }\r
     },\r
-    "scroll_panel": {\r
+    "scroll_panels": {\r
       "lists": {\r
-        "public": {\r
+        "index": {\r
           "type": "public"\r
         },\r
-        "private": {\r
-          "type": "private"\r
-        },\r
-        "play": {\r
-          "type": "play",\r
-          "args": {\r
-            "filter_item_name": "scroll",\r
-            "filter_model_name": "scroll_panel",\r
-            "filter_key": "scroll_id",\r
-            "order": {\r
-              "type": "method"\r
-            }\r
-          }\r
-        },\r
         "by_scroll": {\r
           "type": "filter"\r
         },\r
         }\r
       }\r
     },\r
-    "comic": {\r
+    "comics": {\r
       "lists": {\r
-        "public": {\r
+        "index": {\r
           "type": "public"\r
         },\r
-        "private": {\r
-          "type": "private"\r
-        },\r
         "by_author": {\r
           "type": "filter"\r
         },\r
           "args": {\r
             "through": "comic_stories"\r
           }\r
+        },\r
+        "play": {\r
+          "type": "play"\r
         }\r
       }\r
     },\r
-    "comic_story": {\r
+    "comic_stories": {\r
       "lists": {\r
-        "public": {\r
+        "index": {\r
           "type": "public"\r
         },\r
-        "private": {\r
-          "type": "private"\r
-        },\r
-        "play": {\r
-          "type": "play",\r
-          "args": {\r
-            "filter_item_name": "comic",\r
-            "filter_model_name": "comic_story",\r
-            "filter_key": "comic_id",\r
-            "order": {\r
-              "type": "method"\r
-            }\r
-          }\r
-        },\r
         "by_comic": {\r
           "type": "filter"\r
         },\r
         }\r
       }\r
     },\r
-    "story": {\r
+    "stories": {\r
       "lists": {\r
-        "public": {\r
+        "index": {\r
           "type": "public"\r
         },\r
-        "private": {\r
-          "type": "private"\r
-        },\r
         "by_comic": {\r
           "type": "through_filter",\r
           "args": {\r
         },\r
         "by_author": {\r
           "type": "filter"\r
+        },\r
+        "play": {\r
+          "type": "play"\r
         }\r
       }\r
     },\r
-    "story_sheet": {\r
+    "story_sheets": {\r
       "lists": {\r
-        "public": {\r
+        "index": {\r
           "type": "public"\r
         },\r
-        "private": {\r
-          "type": "private"\r
-        },\r
-        "play": {\r
-          "type": "play",\r
-          "args": {\r
-            "filter_item_name": "story",\r
-            "filter_model_name": "story_sheet",\r
-            "filter_key": "story_id",\r
-            "order": {\r
-              "type": "method"\r
-            }\r
-          }\r
-        },\r
         "by_story": {\r
           "type": "filter"\r
         },\r
         }\r
       }\r
     },\r
-    "sheet": {\r
+    "sheets": {\r
       "lists": {\r
-        "public": {\r
+        "index": {\r
           "type": "public"\r
         },\r
-        "private": {\r
-          "type": "private"\r
-        },\r
         "by_story": {\r
           "type": "through_filter",\r
           "args": {\r
         },\r
         "by_author": {\r
           "type": "filter"\r
+        },\r
+        "play": {\r
+          "type": "play"\r
         }\r
       }\r
     },\r
-    "sheet_panel": {\r
+    "sheet_panels": {\r
       "lists": {\r
-        "public": {\r
+        "index": {\r
           "type": "public"\r
         },\r
-        "private": {\r
-          "type": "private"\r
-        },\r
-        "play": {\r
-          "type": "play",\r
-          "args": {\r
-            "filter_item_name": "sheet",\r
-            "filter_model_name": "sheet_panel",\r
-            "filter_key": "sheet_id"\r
-          }\r
-        },\r
         "by_sheet": {\r
           "type": "filter"\r
         },\r
         }\r
       }\r
     },\r
-    "panel": {\r
+    "panels": {\r
       "lists": {\r
-        "public": {\r
+        "index": {\r
           "type": "public"\r
         },\r
-        "private": {\r
-          "type": "private"\r
-        },\r
         "by_scroll": {\r
           "type": "through_filter",\r
           "args": {\r
         }\r
       }\r
     },\r
-    "panel_picture": {\r
+    "panel_pictures": {\r
       "lists": {\r
-        "public": {\r
+        "index": {\r
           "type": "public"\r
         },\r
-        "private": {\r
-          "type": "private"\r
-        },\r
         "by_panel": {\r
           "type": "filter"\r
         },\r
         }\r
       }\r
     },\r
-    "speech_balloon": {\r
+    "speech_balloons": {\r
       "lists": {\r
-        "public": {\r
+        "index": {\r
           "type": "public"\r
         },\r
-        "private": {\r
-          "type": "private"\r
-        },\r
         "by_panel": {\r
           "type": "filter"\r
         },\r
         }\r
       }\r
     },\r
-    "speech": {\r
+    "speeches": {\r
       "lists": {\r
-        "public": {\r
+        "index": {\r
           "type": "public"\r
         },\r
-        "private": {\r
-          "type": "private"\r
-        },\r
-        "by_panel": {\r
-          "type": "filter"\r
-        },\r
         "by_speech_balloon": {\r
           "type": "filter"\r
         },\r
         }\r
       }\r
     },\r
-    "balloon": {\r
+    "balloons": {\r
       "lists": {\r
-        "public": {\r
+        "index": {\r
           "type": "public"\r
         },\r
-        "private": {\r
-          "type": "private"\r
-        },\r
         "by_speech_balloon": {\r
           "type": "filter"\r
         },\r
         }\r
       }\r
     },\r
-    "ground_picture": {\r
+    "ground_pictures": {\r
       "lists": {\r
-        "public": {\r
+        "index": {\r
           "type": "public"\r
         },\r
-        "private": {\r
-          "type": "private"\r
-        },\r
         "by_panel": {\r
           "type": "filter"\r
         },\r
         }\r
       }\r
     },\r
-    "ground_color": {\r
+    "ground_colors": {\r
       "lists": {\r
-        "public": {\r
+        "index": {\r
           "type": "public"\r
         },\r
-        "private": {\r
-          "type": "private"\r
-        },\r
         "by_panel": {\r
           "type": "filter"\r
         },\r
         }\r
       }\r
     },\r
-    "original_picture": {\r
+    "original_pictures": {\r
       "lists": {\r
-        "private": {\r
+        "index": {\r
           "type": "private"\r
         }\r
       }\r
     },\r
-    "picture": {\r
+    "pictures": {\r
       "lists": {\r
-        "public": {\r
+        "index": {\r
           "type": "public"\r
         },\r
         "by_artist": {\r
         }\r
       }\r
     },\r
-    "resource_picture": {\r
+    "resource_pictures": {\r
       "lists": {\r
-        "public": {\r
+        "index": {\r
           "type": "public"\r
         },\r
-        "private": {\r
-          "type": "private"\r
-        },\r
         "by_original_picture": {\r
           "type": "filter"\r
         },\r
         }\r
       }\r
     },\r
-    "speech_balloon_template": {\r
+    "speech_balloon_templates": {\r
       "lists": {\r
-        "public": {\r
+        "index": {\r
           "type": "public"\r
         },\r
         "by_panel": {\r
         },\r
         "by_system_picture": {\r
           "type": "filter"\r
-        },\r
-        "select_items": {\r
-          "type": "system_resource"\r
         }\r
       }\r
     },\r
-    "writing_format": {\r
+    "writing_formats": {\r
       "lists": {\r
-        "public": {\r
+        "index": {\r
           "type": "public"\r
         },\r
-        "select_items": {\r
-          "type": "system_resource"\r
-        },\r
         "by_system_picture": {\r
           "type": "filter"\r
         }\r
       }\r
     },\r
-    "license_group": {\r
+    "license_groups": {\r
       "lists": {\r
-        "public": {\r
+        "index": {\r
           "type": "public"\r
         },\r
         "by_resource_picture": {\r
           "type": "filter"\r
-        },\r
-        "select_items": {\r
-          "type": "system_resource"\r
         }\r
       }\r
     },\r
-    "license": {\r
+    "licenses": {\r
       "lists": {\r
-        "public": {\r
+        "index": {\r
           "type": "public"\r
         },\r
         "by_license_group": {\r
         }\r
       }\r
     },\r
-    "author": {\r
+    "authors": {\r
       "lists": {\r
-        "public": {\r
+        "index": {\r
           "type": "public"\r
         }\r
       }\r
     },\r
-    "artist": {\r
+    "artists": {\r
       "lists": {\r
-        "public": {\r
+        "index": {\r
           "type": "public"\r
         }\r
       }\r
     },\r
-    "system_picture": {\r
+    "system_pictures": {\r
       "lists": {\r
-        "public": {\r
+        "index": {\r
           "type": "public"\r
         }\r
       }\r
+    },\r
+    "home": {\r
+      "lists": {\r
+        "scrolls": {\r
+          "type": "private"\r
+        },\r
+        "scroll_panels": {\r
+          "type": "private"\r
+        },\r
+        "comics": {\r
+          "type": "private"\r
+        },\r
+        "comic_stories": {\r
+          "type": "private"\r
+        },\r
+        "stories": {\r
+          "type": "private"\r
+        },\r
+        "story_sheets": {\r
+          "type": "private"\r
+        },\r
+        "sheets": {\r
+          "type": "private"\r
+        },\r
+        "sheet_panels": {\r
+          "type": "private"\r
+        },\r
+        "panels": {\r
+          "type": "private"\r
+        },\r
+        "panel_pictures": {\r
+          "type": "private"\r
+        },\r
+        "speech_balloons": {\r
+          "type": "private"\r
+        },\r
+        "speeches": {\r
+          "type": "private"\r
+        },\r
+        "balloons": {\r
+          "type": "private"\r
+        },\r
+        "ground_pictures": {\r
+          "type": "private"\r
+        },\r
+        "ground_colors": {\r
+          "type": "private"\r
+        },\r
+        "original_pictures": {\r
+          "type": "private"\r
+        },\r
+        "resource_pictures": {\r
+          "type": "private"\r
+        }\r
+      }\r
     }\r
   },\r
   "profilers": {\r
           "speech_balloon_template"\r
         ],\r
         "has_one": [\r
-          "balloon.by_speech_balloon",\r
-          "speech.by_speech_balloon"\r
+          "balloons.by_speech_balloon",\r
+          "speeches.by_speech_balloon"\r
         ]\r
       }\r
     },\r
         "belongs_to": [\r
           "artist"\r
         ],\r
-        "has_one": [\r
-          "resource_picture.by_original_picture"\r
-        ]\r
+        "has_one": []\r
       }\r
     },\r
     "picture": {\r
index 2aeb845..fdb3624 100644 (file)
@@ -1,4 +1,35 @@
 {\r
+  "inflectors": {\r
+    "folder": "folders",\r
+    "scroll": "scrolls",\r
+    "scroll_panel": "scroll_panels",\r
+    "comic": "comics",\r
+    "comic_story": "comic_stories",\r
+    "story": "stories",\r
+    "story_sheet": "story_sheets",\r
+    "sheet": "sheets",\r
+    "sheet_panel": "sheet_panels",\r
+    "panel": "panels",\r
+    "panel_picture": "panel_pictures",\r
+    "speech_balloon": "speech_balloons",\r
+    "speech": "speeches",\r
+    "balloon": "balloons",\r
+    "ground_picture": "ground_pictures",\r
+    "ground_color": "ground_colors",\r
+    "original_picture": "original_pictures",\r
+    "picture": "pictures",\r
+    "resource_picture": "resource_pictures",\r
+    "original_picture_license_group": "original_picture_license_groups",\r
+    "original_picture_license": "original_picture_licenses",\r
+    "speech_balloon_template": "speech_balloon_templates",\r
+    "writing_format": "writing_formats",\r
+    "license_group": "license_groups",\r
+    "license": "licenses",\r
+    "author": "authors",\r
+    "artist": "artists",\r
+    "system_picture": "system_pictures",\r
+    "home": "home"\r
+  },\r
   "items": {\r
     "folder": {},\r
     "scroll": {\r
@@ -8,8 +39,8 @@
     "scroll_panel": {\r
       "type": "leaf",\r
       "args": {\r
-        "parent_model_name": "scroll",\r
-        "destination_model_name": "panel"\r
+        "parent_item_name": "scroll",\r
+        "destination_item_name": "panel"\r
       }\r
     },\r
     "comic": {\r
@@ -19,8 +50,8 @@
     "comic_story": {\r
       "type": "leaf",\r
       "args": {\r
-        "parent_model_name": "comic",\r
-        "destination_model_name": "story"\r
+        "parent_item_name": "comic",\r
+        "destination_item_name": "story"\r
       }\r
     },\r
     "story": {\r
@@ -30,8 +61,8 @@
     "story_sheet": {\r
       "type": "leaf",\r
       "args": {\r
-        "parent_model_name": "story",\r
-        "destination_model_name": "sheet"\r
+        "parent_item_name": "story",\r
+        "destination_item_name": "sheet"\r
       }\r
     },\r
     "sheet": {\r
@@ -41,7 +72,7 @@
     "sheet_panel": {\r
       "type": "element",\r
       "args": {\r
-        "parent_model_name": "sheet"\r
+        "parent_item_name": "sheet"\r
       }\r
     },\r
     "panel": {\r
     "panel_picture": {\r
       "type": "element",\r
       "args": {\r
-        "parent_model_name": "panel"\r
+        "parent_item_name": "panel"\r
       }\r
     },\r
     "speech_balloon": {\r
       "type": "element",\r
       "args": {\r
-        "parent_model_name": "panel",\r
+        "parent_item_name": "panel",\r
         "boost": {\r
           "speech_balloon_template": {\r
             "extend_model_class_name": "SpeechBalloon",\r
     "balloon": {\r
       "type": "element",\r
       "args": {\r
-        "parent_model_name": "speech_balloon",\r
+        "parent_item_name": "speech_balloon",\r
         "boost": {\r
           "speech_balloon_template": {\r
             "extend_model_class_name": "Balloon",\r
     "speech": {\r
       "type": "element",\r
       "args": {\r
-        "parent_model_name": "speech_balloon",\r
+        "parent_item_name": "speech_balloon",\r
         "boost": {\r
           "writing_format": {\r
             "level": "read",\r
     "ground_picture": {\r
       "type": "element",\r
       "args": {\r
-        "parent_model_name": "panel"\r
+        "parent_item_name": "panel"\r
       }\r
     },\r
     "ground_color": {\r
       "type": "element",\r
       "args": {\r
-        "parent_model_name": "panel"\r
+        "parent_item_name": "panel"\r
       }\r
     },\r
     "original_picture": {\r
     "license": {\r
       "type": "system_resource",\r
       "args": {\r
-        "parent_model_name": "license_group",\r
+        "parent_item_name": "license_group",\r
         "boost": {\r
           "license_group": {\r
             "extend_model_class_name": "License",\r
   },\r
   "controllers": {\r
     "folders": {\r
-      "item_name": "folder",\r
       "actions": {\r
         "root": {\r
           "type": "show"\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public",\r
             "param_id": "none"\r
           }\r
         },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public"\r
+            "action_name": "index"\r
           }\r
         },\r
         "new": {\r
       }\r
     },\r
     "scrolls": {\r
-      "item_name": "scroll",\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public",\r
             "param_id": "none"\r
           }\r
         },\r
         "play": {\r
           "type": "list",\r
           "args": {\r
-            "item_name": "scroll_panel",\r
-            "list_name": "play"\r
+            "alias": "scroll_panels.by_scroll",\r
+            "order": "t",\r
+            "direction": 1\r
           }\r
         },\r
         "show": {\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public"\r
+            "action_name": "index"\r
           }\r
         },\r
         "count_by_author": {\r
         "count_by_panel": {\r
           "type": "count"\r
         },\r
-        "count_play": {\r
-          "type": "count"\r
-        },\r
         "new": {\r
           "type": "new"\r
         },\r
       }\r
     },\r
     "scroll_panels": {\r
-      "item_name": "scroll_panel",\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public",\r
             "param_id": "none"\r
           }\r
         },\r
             "param_id": "suffix"\r
           }\r
         },\r
-        "play": {\r
-          "type": "list",\r
-          "args": {\r
-          }\r
-        },\r
         "show": {\r
           "type": "show"\r
         },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public"\r
+            "action_name": "index"\r
           }\r
         },\r
         "count_by_panel": {\r
         "count_by_author": {\r
           "type": "count"\r
         },\r
-        "count_play": {\r
-          "type": "count"\r
-        },\r
         "new": {\r
           "type": "new"\r
         },\r
       }\r
     },\r
     "comics": {\r
-      "item_name": "comic",\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public",\r
             "param_id": "none"\r
           }\r
         },\r
         "play": {\r
           "type": "list",\r
           "args": {\r
-            "item_name": "comic_story",\r
-            "list_name": "play"\r
+            "alias": "comic_stories.by_comic",\r
+            "order": "t",\r
+            "direction": 1\r
           }\r
         },\r
         "show": {\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public"\r
+            "action_name": "index"\r
           }\r
         },\r
         "count_by_story": {\r
       }\r
     },\r
     "comic_stories": {\r
-      "item_name": "comic_story",\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public",\r
             "param_id": "none"\r
           }\r
         },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public"\r
+            "action_name": "index"\r
           }\r
         },\r
         "count_by_comic": {\r
       }\r
     },\r
     "stories": {\r
-      "item_name": "story",\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public",\r
             "param_id": "none"\r
           }\r
         },\r
         "play": {\r
           "type": "list",\r
           "args": {\r
-            "item_name": "story_sheet",\r
-            "list_name": "play"\r
+            "alias": "story_sheets.by_story",\r
+            "order": "t",\r
+            "direction": 1\r
           }\r
         },\r
         "show": {\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public"\r
+            "action_name": "index"\r
           }\r
         },\r
         "count_by_comic": {\r
       }\r
     },\r
     "story_sheets": {\r
-      "item_name": "story_sheet",\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public",\r
             "param_id": "none"\r
           }\r
         },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public"\r
+            "action_name": "index"\r
           }\r
         },\r
         "count_by_story": {\r
       }\r
     },\r
     "sheets": {\r
-      "item_name": "sheet",\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public",\r
             "param_id": "none"\r
           }\r
         },\r
         "play": {\r
           "type": "list",\r
           "args": {\r
-            "item_name": "sheet_panel",\r
-            "list_name": "play"\r
+            "alias": "sheet_panels.by_sheet",\r
+            "order": "t",\r
+            "direction": 1\r
           }\r
         },\r
         "show": {\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public"\r
+            "action_name": "index"\r
           }\r
         },\r
         "count_by_story": {\r
       }\r
     },\r
     "sheet_panels": {\r
-      "item_name": "sheet_panel",\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public",\r
             "param_id": "none"\r
           }\r
         },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public"\r
+            "action_name": "index"\r
           }\r
         },\r
         "count_by_sheet": {\r
       }\r
     },\r
     "panels": {\r
-      "item_name": "panel",\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public",\r
             "param_id": "none"\r
           }\r
         },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public"\r
+            "action_name": "index"\r
           }\r
         },\r
         "count_by_scroll": {\r
       }\r
     },\r
     "panel_pictures": {\r
-      "item_name": "panel_picture",\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public",\r
             "param_id": "none"\r
           }\r
         },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public"\r
+            "action_name": "index"\r
           }\r
         },\r
         "count_by_panel": {\r
       }\r
     },\r
     "speech_balloons": {\r
-      "item_name": "speech_balloon",\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public",\r
             "param_id": "none"\r
           }\r
         },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public"\r
+            "action_name": "index"\r
           }\r
         },\r
         "count_by_panel": {\r
       }\r
     },\r
     "speeches": {\r
-      "item_name": "speech",\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public",\r
             "param_id": "none"\r
           }\r
         },\r
             "param_id": "suffix"\r
           }\r
         },\r
+        "by_speech_balloon_template": {\r
+          "type": "list",\r
+          "args": {\r
+            "param_id": "suffix"\r
+          }\r
+        },\r
+        "by_writing_format": {\r
+          "type": "list",\r
+          "args": {\r
+            "param_id": "suffix"\r
+          }\r
+        },\r
         "show": {\r
           "type": "show"\r
         },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public"\r
+            "action_name": "index"\r
           }\r
         },\r
         "count_by_author": {\r
           "type": "count"\r
         },\r
+        "count_by_speech_balloon": {\r
+          "type": "count"\r
+        },\r
+        "count_by_speech_balloon_template": {\r
+          "type": "count"\r
+        },\r
+        "count_by_writing_format": {\r
+          "type": "count"\r
+        },\r
         "new": {\r
           "type": "new"\r
         },\r
       }\r
     },\r
     "balloons": {\r
-      "item_name": "balloon",\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public",\r
             "param_id": "none"\r
           }\r
         },\r
             "param_id": "suffix"\r
           }\r
         },\r
+        "by_speech_balloon_template": {\r
+          "type": "list",\r
+          "args": {\r
+            "param_id": "suffix"\r
+          }\r
+        },\r
+        "by_system_picture": {\r
+          "type": "list",\r
+          "args": {\r
+            "param_id": "suffix"\r
+          }\r
+        },\r
         "show": {\r
           "type": "show"\r
         },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public"\r
+            "action_name": "index"\r
           }\r
         },\r
         "count_by_author": {\r
           "type": "count"\r
         },\r
+        "count_by_speech_balloon": {\r
+          "type": "count"\r
+        },\r
+        "count_by_speech_balloon_template": {\r
+          "type": "count"\r
+        },\r
+        "count_by_system_picture": {\r
+          "type": "count"\r
+        },\r
         "new": {\r
           "type": "new"\r
         },\r
       }\r
     },\r
     "ground_pictures": {\r
-      "item_name": "ground_picture",\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public",\r
             "param_id": "none"\r
           }\r
         },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public"\r
+            "action_name": "index"\r
           }\r
         },\r
         "count_by_panel": {\r
       }\r
     },\r
     "ground_colors": {\r
-      "item_name": "ground_color",\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public",\r
             "param_id": "none"\r
           }\r
         },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public"\r
+            "action_name": "index"\r
           }\r
         },\r
         "count_by_panel": {\r
       }\r
     },\r
     "original_pictures": {\r
-      "item_name": "original_picture",\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "private",\r
             "param_id": "none"\r
           }\r
         },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "private"\r
+            "action_name": "index"\r
           }\r
         },\r
         "new": {\r
       }\r
     },\r
     "pictures": {\r
-      "item_name": "picture",\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public",\r
             "param_id": "none"\r
           }\r
         },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public"\r
+            "action_name": "index"\r
           }\r
         },\r
         "count_by_artist": {\r
       }\r
     },\r
     "resource_pictures": {\r
-      "item_name": "resource_picture",\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public",\r
             "param_id": "none"\r
           }\r
         },\r
+        "by_original_picture": {\r
+          "type": "list",\r
+          "args": {\r
+            "param_id": "suffix"\r
+          }\r
+        },\r
         "by_license_group": {\r
           "type": "list",\r
           "args": {\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public"\r
+            "action_name": "index"\r
           }\r
         },\r
+        "count_by_original_picture": {\r
+          "type": "count"\r
+        },\r
         "count_by_license_group": {\r
           "type": "count"\r
         },\r
       }\r
     },\r
     "speech_balloon_templates": {\r
-      "item_name": "speech_balloon_template",\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public",\r
             "param_id": "none"\r
           }\r
         },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public"\r
+            "action_name": "index"\r
           }\r
         },\r
         "count_by_panel": {\r
       }\r
     },\r
     "writing_formats": {\r
-      "item_name": "writing_format",\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public",\r
             "param_id": "none"\r
           }\r
         },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public"\r
+            "action_name": "index"\r
           }\r
         },\r
         "count_by_system_picture": {\r
       }\r
     },\r
     "license_groups": {\r
-      "item_name": "license_group",\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public",\r
             "param_id": "none"\r
           }\r
         },\r
+        "by_resource_picture": {\r
+          "type": "list",\r
+          "args": {\r
+            "param_id": "suffix"\r
+          }\r
+        },\r
         "show": {\r
           "type": "show"\r
         },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public"\r
+            "action_name": "index"\r
           }\r
         },\r
+        "count_by_resource_picture": {\r
+          "type": "count"\r
+        },\r
         "new": {\r
           "type": "new"\r
         },\r
       }\r
     },\r
     "licenses": {\r
-      "item_name": "license",\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public",\r
             "param_id": "none"\r
           }\r
         },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public"\r
+            "action_name": "index"\r
           }\r
         },\r
         "count_by_license_group": {\r
       }\r
     },\r
     "authors": {\r
-      "item_name": "author",\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public",\r
             "param_id": "none"\r
           }\r
         },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public"\r
+            "action_name": "index"\r
           }\r
         },\r
         "new": {\r
       }\r
     },\r
     "artists": {\r
-      "item_name": "artist",\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public",\r
             "param_id": "none"\r
           }\r
         },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public"\r
+            "action_name": "index"\r
           }\r
         },\r
         "new": {\r
       }\r
     },\r
     "system_pictures": {\r
-      "item_name": "system_picture",\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public",\r
             "param_id": "none"\r
           }\r
         },\r
         "count": {\r
           "type": "count",\r
           "args": {\r
-            "list_name": "public"\r
+            "action_name": "index"\r
           }\r
         }\r
       }\r
           "type": "list",\r
           "args": {\r
             "item_name": "scroll",\r
-            "list_name": "private",\r
             "param_id": "none",\r
             "counter_name": "scrolls_count"\r
           }\r
           "type": "list",\r
           "args": {\r
             "item_name": "scroll_panel",\r
-            "list_name": "private",\r
             "param_id": "none",\r
             "counter_name": "scroll_panels_count"\r
           }\r
           "type": "list",\r
           "args": {\r
             "item_name": "comic",\r
-            "list_name": "private",\r
             "param_id": "none",\r
             "counter_name": "comics_count"\r
           }\r
           "type": "list",\r
           "args": {\r
             "item_name": "comic_story",\r
-            "list_name": "private",\r
             "param_id": "none",\r
             "counter_name": "comic_stories_count"\r
           }\r
           "type": "list",\r
           "args": {\r
             "item_name": "story",\r
-            "list_name": "private",\r
             "param_id": "none",\r
             "counter_name": "stories_count"\r
           }\r
           "type": "list",\r
           "args": {\r
             "item_name": "story_sheet",\r
-            "list_name": "private",\r
             "param_id": "none",\r
             "counter_name": "story_sheets_count"\r
           }\r
           "type": "list",\r
           "args": {\r
             "item_name": "sheet",\r
-            "list_name": "private",\r
             "param_id": "none",\r
             "counter_name": "sheets_count"\r
           }\r
           "type": "list",\r
           "args": {\r
             "item_name": "sheet_panel",\r
-            "list_name": "private",\r
             "param_id": "none",\r
             "counter_name": "sheet_panels_count"\r
           }\r
           "type": "list",\r
           "args": {\r
             "item_name": "panel",\r
-            "list_name": "private",\r
             "param_id": "none",\r
             "counter_name": "panels_count"\r
           }\r
           "type": "list",\r
           "args": {\r
             "item_name": "panel_picture",\r
-            "list_name": "private",\r
             "param_id": "none",\r
             "counter_name": "panel_pictures_count"\r
           }\r
           "type": "list",\r
           "args": {\r
             "item_name": "speech_balloon",\r
-            "list_name": "private",\r
             "param_id": "none",\r
             "counter_name": "speech_balloons_count"\r
           }\r
           "type": "list",\r
           "args": {\r
             "item_name": "speech",\r
-            "list_name": "private",\r
             "param_id": "none",\r
             "counter_name": "speeches_count"\r
           }\r
           "type": "list",\r
           "args": {\r
             "item_name": "balloon",\r
-            "list_name": "private",\r
             "param_id": "none",\r
             "counter_name": "balloons_count"\r
           }\r
           "type": "list",\r
           "args": {\r
             "item_name": "ground_picture",\r
-            "list_name": "private",\r
             "param_id": "none",\r
             "counter_name": "ground_pictures_count"\r
           }\r
           "type": "list",\r
           "args": {\r
             "item_name": "ground_color",\r
-            "list_name": "private",\r
             "param_id": "none",\r
             "counter_name": "ground_colors_count"\r
           }\r
           "type": "list",\r
           "args": {\r
             "item_name": "original_picture",\r
-            "list_name": "private",\r
             "param_id": "none",\r
             "counter_name": "count"\r
           }\r
           "type": "list",\r
           "args": {\r
             "item_name": "resource_picture",\r
-            "list_name": "private",\r
             "param_id": "none",\r
             "counter_name": "resource_pictures_count"\r
           }\r
           "type": "count",\r
           "args": {\r
             "item_name": "scroll",\r
-            "list_name": "private",\r
             "param_id": "none"\r
           }\r
         },\r
           "type": "count",\r
           "args": {\r
             "item_name": "scroll_panel",\r
-            "list_name": "private",\r
             "param_id": "none"\r
           }\r
         },\r
           "type": "count",\r
           "args": {\r
             "item_name": "comic",\r
-            "list_name": "private",\r
             "param_id": "none"\r
           }\r
         },\r
           "type": "count",\r
           "args": {\r
             "item_name": "comic_story",\r
-            "list_name": "private",\r
             "param_id": "none"\r
           }\r
         },\r
   },\r
   "models": {\r
     "folder": {\r
-      "table_name": "folders",\r
       "associations": {\r
         "belongs_to": {},\r
         "has_many": {}\r
       }\r
     },\r
     "scroll": {\r
-      "table_name": "scrolls",\r
       "associations": {\r
         "belongs_to": {\r
           "author": {}\r
       }\r
     },\r
     "scroll_panel": {\r
-      "table_name": "scroll_panels",\r
       "associations": {\r
         "belongs_to": {\r
           "panel": {},\r
       }\r
     },\r
     "comic": {\r
-      "table_name": "comics",\r
       "associations": {\r
         "belongs_to": {\r
           "author": {}\r
       }\r
     },\r
     "comic_story": {\r
-      "table_name": "comic_stories",\r
       "associations": {\r
         "belongs_to": {\r
           "comic": {},\r
       }\r
     },\r
     "story": {\r
-      "table_name": "stories",\r
       "associations": {\r
         "belongs_to": {\r
           "author": {}\r
       }\r
     },\r
     "story_sheet": {\r
-      "table_name": "story_sheets",\r
       "associations": {\r
         "belongs_to": {\r
           "story": {},\r
       }\r
     },\r
     "sheet": {\r
-      "table_name": "sheets",\r
       "associations": {\r
         "belongs_to": {\r
           "author": {}\r
       }\r
     },\r
     "sheet_panel": {\r
-      "table_name": "sheet_panels",\r
       "associations": {\r
         "belongs_to": {\r
           "sheet": {},\r
       }\r
     },\r
     "panel": {\r
-      "table_name": "panels",\r
       "associations": {\r
         "belongs_to": {\r
           "author": {}\r
       }\r
     },\r
     "panel_picture": {\r
-      "table_name": "panel_pictures",\r
       "associations": {\r
         "belongs_to": {\r
           "panel": {}\r
       }\r
     },\r
     "speech_balloon": {\r
-      "table_name": "speech_balloons",\r
       "associations": {\r
         "belongs_to": {\r
           "panel": {},\r
       }\r
     },\r
     "balloon": {\r
-      "table_name": "balloons",\r
       "associations": {\r
         "belongs_to": {\r
           "speech_balloon": {},\r
       }\r
     },\r
     "speech": {\r
-      "table_name": "speeches",\r
       "associations": {\r
         "belongs_to": {\r
           "speech_balloon": {},\r
       }\r
     },\r
     "ground_picture": {\r
-      "table_name": "ground_pictures",\r
       "associations": {\r
         "belongs_to": {\r
           "panel": {}\r
       }\r
     },\r
     "ground_color": {\r
-      "table_name": "ground_colors",\r
       "associations": {\r
         "belongs_to": {\r
           "panel": {}\r
       }\r
     },\r
     "original_picture": {\r
-      "table_name": "original_pictures",\r
       "associations": {\r
         "belongs_to": {\r
           "artist": {}\r
       }\r
     },\r
     "picture": {\r
-      "table_name": "pictures",\r
       "associations": {\r
         "belongs_to": {\r
           "license": {},\r
       }\r
     },\r
     "resource_picture": {\r
-      "table_name": "resource_pictures",\r
       "associations": {\r
         "belongs_to": {\r
           "original_picture": {},\r
       }\r
     },\r
     "original_picture_license_group": {\r
-      "table_name": "original_picture_license_groups",\r
       "associations": {\r
         "belongs_to": {\r
           "original_picture": {},\r
       }\r
     },\r
     "original_picture_license": {\r
-      "table_name": "original_picture_licenses",\r
       "associations": {\r
         "belongs_to": {\r
           "original_picture": {},\r
           "source": {\r
             "type": "filter",\r
             "args": {\r
-              "resource_list_name": "by_license_group",\r
+              "resource_action_name": "by_license_group",\r
               "filter_column_name": "license_group_id"\r
             }\r
           },\r
       }\r
     },\r
     "speech_balloon_template": {\r
-      "table_name": "speech_balloon_templates",\r
       "associations": {\r
         "belongs_to": {\r
           "system_picture": {}\r
       }\r
     },\r
     "writing_format": {\r
-      "table_name": "writing_formats",\r
       "associations": {\r
         "belongs_to": {\r
           "system_picture": {}\r
       }\r
     },\r
     "license_group": {\r
-      "table_name": "license_groups",\r
       "associations": {\r
         "belongs_to": {},\r
         "has_many": {\r
       }\r
     },\r
     "license": {\r
-      "table_name": "licenses",\r
       "associations": {\r
         "belongs_to": {\r
           "license_group": {},\r
       }\r
     },\r
     "author": {\r
-      "table_name": "authors",\r
       "associations": {\r
         "belongs_to": {},\r
         "has_many": {\r
       }\r
     },\r
     "artist": {\r
-      "table_name": "artists",\r
       "associations": {\r
         "belongs_to": {},\r
         "has_many": {\r
       }\r
     },\r
     "system_picture": {\r
-      "table_name": "system_pictures",\r
       "associations": {\r
         "belongs_to": {},\r
         "has_many": {\r