OSDN Git Service

fix filer
authoryasushiito <yas@pen-chan.jp>
Sat, 30 Aug 2014 07:07:05 +0000 (16:07 +0900)
committeryasushiito <yas@pen-chan.jp>
Sat, 30 Aug 2014 07:07:05 +0000 (16:07 +0900)
51 files changed:
app/assets/javascripts/ap.js
app/assets/javascripts/controllers/folders.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/locmare/filer/body/file_body.js.coffee
app/assets/javascripts/locmare/filer/body/file_body/file_item/caption/default/face/method.js.coffee
app/assets/javascripts/locmare/filer/body/file_body/file_item/icon/base.js.coffee
app/assets/javascripts/locmare/filer/body/file_body/file_item/symbol/default/face/picture.js.coffee
app/assets/javascripts/locmare/profiler.js.coffee [new file with mode: 0644]
app/assets/javascripts/locmare/profiler/association.js.coffee [new file with mode: 0644]
app/assets/javascripts/locmare/profiler/association/belongs_to.js.coffee [new file with mode: 0644]
app/assets/javascripts/locmare/profiler/association/has_many.js.coffee [new file with mode: 0644]
app/assets/javascripts/locmare/profiler/association/has_one.js.coffee [new file with mode: 0644]
app/assets/javascripts/locmare/profiler/column.js.coffee [new file with mode: 0644]
app/assets/javascripts/locmare/profiler/column/base.js.coffee [new file with mode: 0644]
app/assets/javascripts/locmare/profiler/column/date.js.coffee [new file with mode: 0644]
app/assets/javascripts/locmare/profiler/column/default.js.coffee [new file with mode: 0644]
app/assets/javascripts/locmare/profiler/column/extend.js.coffee [new file with mode: 0644]
app/assets/javascripts/locmare/profiler/column/extend/extend_column.js.coffee [new file with mode: 0644]
app/assets/javascripts/locmare/profiler/column/json.js.coffee [new file with mode: 0644]
app/assets/javascripts/locmare/profiler/column/source.js.coffee [new file with mode: 0644]
app/assets/javascripts/locmare/profiler/header.js.coffee [new file with mode: 0644]
app/assets/javascripts/main.js.coffee
app/assets/javascripts/manifest/controller/action/base.js.coffee
app/assets/javascripts/manifest/controller/action/list.js.coffee
app/assets/javascripts/manifest/manifest.js.coffee
app/assets/javascripts/manifest/model.js.coffee
app/assets/javascripts/models/balloon.js.coffee
app/assets/javascripts/models/comic.js.coffee
app/assets/javascripts/models/folder.js.coffee
app/assets/javascripts/models/ground_picture.js.coffee
app/assets/javascripts/models/license.js.coffee
app/assets/javascripts/models/license_group.js.coffee
app/assets/javascripts/models/original_picture.js.coffee
app/assets/javascripts/models/panel_picture.js.coffee
app/assets/javascripts/models/picture.js.coffee
app/assets/javascripts/models/resource_picture.js.coffee
app/assets/javascripts/models/scroll.js.coffee
app/assets/javascripts/models/speech.js.coffee
app/assets/javascripts/models/speech_balloon.js.coffee
app/assets/javascripts/models/speech_balloon_template.js.coffee
app/assets/javascripts/models/system_picture.js.coffee
app/assets/javascripts/models/writing_format.js.coffee
app/assets/javascripts/peta/item.js.coffee
app/assets/javascripts/pettanr.js.coffee
app/assets/javascripts/routes.js.coffee
app/assets/javascripts/work/controllers.js.coffee.erb
app/assets/javascripts/work/models.js.coffee.erb
app/controllers/application_controller.rb
app/controllers/folders_controller.rb
public/manifest.json

index 905c87c..b510fc2 100644 (file)
 //= require ./locmare/filer/body/file_body/file_item/edit/account
 //= require ./locmare/filer/body/file_body/file_item/edit/template
 //= require ./locmare/filer/pager
+//= require ./locmare/profiler
+//= require ./locmare/profiler/header
+//= require ./locmare/profiler/column
+//= require ./locmare/profiler/column/base
+//= require ./locmare/profiler/column/default
+//= require ./locmare/profiler/column/date
+//= require ./locmare/profiler/column/source
+//= require ./locmare/profiler/column/extend
+//= require ./locmare/profiler/column/extend/extend_column
+//= require ./locmare/profiler/column/json
+//= require ./locmare/profiler/association
+//= require ./locmare/profiler/association/belongs_to
+//= require ./locmare/profiler/association/has_many
+//= require ./locmare/profiler/association/has_one
 //= require ./peta/peta
 //= require ./peta/item
 //= require ./peta/owner
index 394af8a..6492fae 100644 (file)
@@ -4,32 +4,39 @@ class Pettanr.FoldersController extends Pettanr.AppController
     @filer_list()\r
   \r
   root: () ->\r
+    @set_model()\r
+    @item = new Pettanr.Folder.Root()\r
+    _this = this\r
+    @item.fetch({}).done () ->\r
+      _this.children_html()\r
   \r
   show_html_format: (format) -> \r
   \r
+  children_html: () -> \r
+    collection = new Pettanr.Folder.Children({id: @item.get('id')})\r
+    f = new Locmare.Filer({\r
+      item_name: 'folder', \r
+      collection: collection, \r
+      pager: null, \r
+      operators: window.operators\r
+    })\r
+    $("#pettanr").html(f.render().el)\r
+  \r
   show: () ->\r
     console.log(@params)\r
     id = @params['id']\r
-    item = new Pettanr.FolderWatch({id: id})\r
+    @item = new Pettanr.FolderWatch({id: id})\r
     _this = this\r
-    item.fetch({}).done () ->\r
-      if item.is_remote()\r
-        c = item.get('controller_name')\r
-        a = if Pettanr.is_blank(item.get('action_name'))\r
+    @item.fetch({}).done () ->\r
+      if _this.item.is_remote()\r
+        c = _this.item.get('controller_name')\r
+        a = if Pettanr.is_blank(_this.item.get('action_name'))\r
           'index'\r
         else\r
-          item.get('action_name')\r
+          _this.item.get('action_name')\r
         window.router['c_i'](c, a, '') # call action event in router for redirect\r
       else\r
-        list_result = new Pettanr.Folder.Children({id: item.id})\r
-        f = new Locmare.Filer({\r
-          item_name: 'folder', \r
-          items: [], \r
-          list_result: list_result, \r
-          pager_type: 'default', \r
-          operators: window.operators\r
-        })\r
-        $("#pettanr").html(f.render().el)\r
+        _this.children_html()\r
   \r
   count: () ->\r
   \r
index 2f1c7bb..feab10d 100644 (file)
@@ -12,13 +12,15 @@ class LocalManifest.ProfilerModule.AssociationModule.HasMany extends ManifestBas
       n = @name.split '.'\r
       if n.length > 1\r
         @table_name = n[0]\r
-        @model_name = @table_name.singularize\r
+        @item_name = Manifest.manifest().controllers[@table_name].item_name\r
+        @model_name = @item_name\r
         @list_name = n[1]\r
       else\r
-        ManifestBase::alert_undefined_message 'list', this.module_message\r
-\r
-  list: () ->\r
-    Locmare::ListGroup.list @model_name, @list_name\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
+    {model: @model(), params: params}\r
   \r
   model: () ->\r
     Manifest.item_name_to_model @model_name\r
index 3372e7a..930a7ce 100644 (file)
@@ -14,10 +14,11 @@ class LocalManifest.ProfilerModule.AssociationModule.HasOne extends ManifestBase
         @model_name = n[0]\r
         @list_name = n[1]\r
       else\r
-        ManifestBase::alert_undefined_message 'list', self.module_message\r
+        ManifestBase.alert_undefined_message 'list', @module_message\r
   \r
-  list: () ->\r
-    Locmare::ListGroup.list @model_name, @list_name\r
+  list_options: (id) ->\r
+    params = {controller: @model().table_name(), action: @list_name, id: id, page: 1, page_size: 3}\r
+    {model: @model(), params: params}\r
   \r
   model: () ->\r
     Manifest.item_name_to_model @model_name\r
index 26bb9e3..7508316 100644 (file)
@@ -5,7 +5,7 @@ class Locmare.FilerModule.BodyModule.FileBody extends Backbone.View
     @body = options.body\r
     @collection = []\r
     _this = this\r
-    c = @filer().list_result\r
+    c = @filer().collection\r
     c.fetch().done ->\r
       _this.filer().items = c.models\r
       _this.collection = _.map c.models, (item) ->\r
index 76b023e..030d596 100644 (file)
@@ -4,7 +4,11 @@ class Locmare.FilerModule.BodyModule.FileBodyModule.FileItemModule.CaptionItemCo
     super(options)\r
   \r
   render: () ->\r
-    this.$el.html(@face())\r
+    if Pettanr.is_a_string(@face())\r
+      this.$el.html(@face())\r
+    else\r
+      this.$el.html(@face().render().el)\r
+    \r
     this\r
   \r
   @template_file_name: () ->\r
index a6244ef..b1a9abd 100644 (file)
@@ -1,5 +1,8 @@
 class Locmare.FilerModule.BodyModule.FileBodyModule.FileItemModule.IconItemColumnModule.Base extends Backbone.View\r
   tagName: 'div'\r
+  events: {\r
+    'click .face': 'show'\r
+  }\r
   \r
   initialize: (options) ->\r
     @file_item = options.file_item\r
@@ -20,6 +23,11 @@ class Locmare.FilerModule.BodyModule.FileBodyModule.FileItemModule.IconItemColum
     this.$el.html(template(args))\r
     this\r
   \r
+  show: () ->\r
+    item = new Pettanr.Artist({id: 1})\r
+    item.fetch().done ->\r
+      profiler = new Locmare.Profiler({item_name: item.item_name(), item: item, operators: window.operators})\r
+  \r
   filer: () ->\r
     @file_item.filer()\r
   \r
index 11f6397..127a581 100644 (file)
@@ -3,10 +3,11 @@ class Locmare.FilerModule.BodyModule.FileBodyModule.FileItemModule.SymbolItemCol
   initialize: (options) ->\r
     super(options)\r
     _this = this\r
-    if i = @item[@method_name()]()\r
-      i.fetch().done ->\r
-        _this.picture = new Pettanr.AppHelperImg({src: i.r_url(), size: _this.icon_size()})\r
+    if @item[@method_name()]\r
+      @item[@method_name()]((pic) ->\r
+        _this.picture = pic\r
         _this.render()\r
+      )\r
     else\r
       @picture = new Pettanr.AppHelperImg({src: '/images/error.png', size: @icon_size()})\r
       _this.render()\r
diff --git a/app/assets/javascripts/locmare/profiler.js.coffee b/app/assets/javascripts/locmare/profiler.js.coffee
new file mode 100644 (file)
index 0000000..d4a6f1e
--- /dev/null
@@ -0,0 +1,36 @@
+class Locmare.Profiler extends Backbone.View\r
+  tagName: 'div'\r
+  initialize: (options) ->\r
+    @item_name = options.item_name\r
+    @item = options.item\r
+    # feasible show parsed extend data\r
+    @item.boosts 'post'\r
+    @operators = options.operators\r
+      \r
+    @profiler_manifest = LocalManifest.manifest().profilers[@item_name]\r
+    @template_dir = 'templates-profiler-'\r
+    @header = new Locmare.ProfilerModule.Header({profiler: this})\r
+    @columns = new Locmare.ProfilerModule.Column({profiler: this})\r
+    @associations = new Locmare.ProfilerModule.Association({'profiler': this, association_manifest: @profiler_manifest.associations})\r
+    @render()\r
+  \r
+  render: () ->\r
+    this.$el.html('')\r
+    this.$el.append(@header.render().el)\r
+    this.$el.append(@columns.render().el)\r
+    this.$el.append(@associations.render().el)\r
+    $("#pettanr").html(this.el)\r
+    this\r
+  \r
+  peta: () ->\r
+    Manifest.manifest().items[@item_name]\r
+  \r
+  model: () ->\r
+    Manifest.item_name_to_model @item_name\r
+  \r
+  image_dir: () ->\r
+    '/images/'\r
+  \r
+class Locmare.ProfilerModule\r
+\r
\r
diff --git a/app/assets/javascripts/locmare/profiler/association.js.coffee b/app/assets/javascripts/locmare/profiler/association.js.coffee
new file mode 100644 (file)
index 0000000..c9aa914
--- /dev/null
@@ -0,0 +1,32 @@
+class Locmare.ProfilerModule.Association extends Backbone.View\r
+  tagName: 'div'\r
+  \r
+  initialize: (options) ->\r
+    @profiler = options.profiler\r
+    @association_manifest = options.association_manifest\r
+    @belongs_to = _.map @association_manifest.belongs_to, (belongs_to_manifest) =>\r
+      new Locmare.ProfilerModule.AssociationModule.BelongsTo({association: this, belongs_to_manifest: belongs_to_manifest})\r
+    @has_many = _.map @association_manifest.has_many, (list_manifest) =>\r
+      new Locmare.ProfilerModule.AssociationModule.HasMany({association: this, has_many_manifest: list_manifest})\r
+    @has_one = _.map @association_manifest.has_one, (list_manifest) =>\r
+      new Locmare.ProfilerModule.AssociationModule.HasOne({association: this, has_one_manifest: list_manifestt})\r
+    @render\r
+  \r
+  render: () ->\r
+    _this = this\r
+    _.each @belongs_to, (f) ->\r
+      #_this.$el.append(f.render().el)\r
+    _.each @has_many, (f) ->\r
+      #_this.$el.append(f.render().el)\r
+    _.each @has_one, (f) ->\r
+      #_this.$el.append(f.render().el)\r
+    this\r
+  \r
+  item: () ->\r
+    @profiler.item\r
+  \r
+  model_manifest: () ->\r
+    Manifest.manifest().models[@profiler.item_name]\r
+  \r
+class Locmare.ProfilerModule.AssociationModule\r
+\r
diff --git a/app/assets/javascripts/locmare/profiler/association/belongs_to.js.coffee b/app/assets/javascripts/locmare/profiler/association/belongs_to.js.coffee
new file mode 100644 (file)
index 0000000..2eeb697
--- /dev/null
@@ -0,0 +1,37 @@
+class Locmare.ProfilerModule.AssociationModule.BelongsTo extends Backbone.View\r
+  tagName: 'div'\r
+  \r
+  initialize: (options) ->\r
+    @association = options.association\r
+    @belongs_to_manifest = options.belongs_to_manifest\r
+    @filer = null\r
+    m = new @parent_model({id: @parent_id()})\r
+    _this = this\r
+    m.fetch().done ->\r
+      _this.filer = new Locmare.Filer(@parent_model.item_name, r, null, @profiler().operators)\r
+      _this.render()\r
+  \r
+  render: () ->\r
+    this.$el.html('')\r
+    if @filer\r
+      this.$el.html(@filer.render().el)\r
+    this\r
+  \r
+  item: () ->\r
+    @profiler.item\r
+  \r
+  parent_model: () ->\r
+    @belongs_to_manifest.model()\r
+  \r
+  parent_id: () ->\r
+    @item().get(@model_belongs_to_manifest().id_column)\r
+  \r
+  model_manifest: () ->\r
+    Manifest.manifest().models[@profiler.item_name]\r
+  \r
+  model_belongs_to_manifest: () ->\r
+    @model_manifest().associations.belongs_to[@belongs_to_manifest.model_name]\r
+  \r
+  profiler: () ->\r
+    @association.profiler()\r
+  \r
diff --git a/app/assets/javascripts/locmare/profiler/association/has_many.js.coffee b/app/assets/javascripts/locmare/profiler/association/has_many.js.coffee
new file mode 100644 (file)
index 0000000..b6eef8b
--- /dev/null
@@ -0,0 +1,29 @@
+class Locmare.ProfilerModule.AssociationModule.HasMany extends Backbone.View\r
+  tagName: 'div'\r
+  \r
+  initialize: (options) ->\r
+    @association = options.association\r
+    @has_many_manifest = options.has_many_manifest\r
+    @filer = null\r
+    m = new Pettanr.FilerCollection({}, @has_many_manifest.list_options(@item().get('id')))\r
+    _this = this\r
+    m.fetch().done ->\r
+      items = m.models\r
+      #_this.filer = new Locmare.Filer(_this.has_many_model().item_name, items, @pager, _this.profiler().operators)\r
+      _this.render()\r
+  \r
+  render: () ->\r
+    this.$el.html('')\r
+    if @filer\r
+      this.$el.html(@filer.render().el)\r
+    this\r
+  \r
+  item: () ->\r
+    @profiler().item\r
+  \r
+  has_many_model: () ->\r
+    @has_many_manifest.model()\r
+  \r
+  profiler: () ->\r
+    @association.profiler\r
\r
diff --git a/app/assets/javascripts/locmare/profiler/association/has_one.js.coffee b/app/assets/javascripts/locmare/profiler/association/has_one.js.coffee
new file mode 100644 (file)
index 0000000..c2108e9
--- /dev/null
@@ -0,0 +1,30 @@
+class Locmare.ProfilerModule.AssociationModule.HasOne extends Backbone.View\r
+  tagName: 'div'\r
+  \r
+  initialize: (options) ->\r
+    @association = options.association\r
+    @has_one_manifest = options.has_one_manifest\r
+    @filer = null\r
+    m = new @parent_model(@parent_id())\r
+    m = new Pettanr.FilerCollection({}, @has_one_manifest.list_options(@item().get('id')))\r
+    _this = this\r
+    m.fetch().done ->\r
+      items = m.models\r
+      _this.filer = new Locmare.Filer(_this.has_one_model().item_name, items, null, _this.profiler().operators)\r
+      _this.render()\r
+  \r
+  render: () ->\r
+    this.$el.html('')\r
+    if @filer\r
+      this.$el.html(@filer.render().el)\r
+    this\r
+  \r
+  item: () ->\r
+    @profiler().item\r
+  \r
+  has_one_model: () ->\r
+    @has_one_manifest.model()\r
+  \r
+  profiler: () ->\r
+    @association.profiler\r
+  \r
diff --git a/app/assets/javascripts/locmare/profiler/column.js.coffee b/app/assets/javascripts/locmare/profiler/column.js.coffee
new file mode 100644 (file)
index 0000000..42c89bd
--- /dev/null
@@ -0,0 +1,41 @@
+class Locmare.ProfilerModule.Column extends Backbone.View\r
+  tagName: 'div'\r
+  className: 'columns'\r
+  \r
+  initialize: (options) ->\r
+    @profiler = options.profiler\r
+    @profiler_manifest = @profiler.profiler_manifest\r
+    @columns = {}\r
+    _this = this\r
+    _.each @profiler_manifest.columns, (column, name) ->\r
+      _this.columns[name] = _this.factory(_this.profiler, column)\r
+  \r
+  render: () ->\r
+    _this = this\r
+    this.$el.html('')\r
+    _.each @sorted_columns(), (column) ->\r
+      _this.$el.append(column.render().el)\r
+    this\r
+  \r
+  types: () ->\r
+    {\r
+      default: Locmare.ProfilerModule.ColumnModule.Default, \r
+      date: Locmare.ProfilerModule.ColumnModule.Date, \r
+      source: Locmare.ProfilerModule.ColumnModule.Source, \r
+      extend: Locmare.ProfilerModule.ColumnModule.Extend, \r
+      json: Locmare.ProfilerModule.ColumnModule.Json\r
+    }\r
+  \r
+  factory: (profiler, my_manifest) ->\r
+    type = my_manifest.type\r
+    console.log("undefined type for local view filers > #{profiler.item_name} > edit\n") if not type\r
+    my_class = @types()[type]\r
+    console.log("undefined class for local view filers > #{profiler.item_name} > edit > #{type}\n") if not my_class\r
+    new my_class({profiler: profiler,  column_manifest: my_manifest})\r
+  \r
+  sorted_columns: () ->\r
+    _.map @profiler_manifest.column_names, (column_name) =>\r
+      _this.columns[column_name]\r
+  \r
+class Locmare.ProfilerModule.ColumnModule\r
+\r
diff --git a/app/assets/javascripts/locmare/profiler/column/base.js.coffee b/app/assets/javascripts/locmare/profiler/column/base.js.coffee
new file mode 100644 (file)
index 0000000..f178148
--- /dev/null
@@ -0,0 +1,156 @@
+class Locmare.ProfilerModule.ColumnModule.Base extends Backbone.View\r
+  tagName: 'div'\r
+  className: 'column'\r
+  \r
+  initialize: (options) ->\r
+    @profiler = options.profiler\r
+    @column_manifest = options.column_manifest\r
+    @column_name = @column_manifest.name\r
+    c = @label_class()\r
+    @label = new c({column: this})\r
+    c = @value_class()\r
+    @value = new c({column: this})\r
+    c = @note_class()\r
+    @note = new c({column: this})\r
+  \r
+  render: () ->\r
+    this.$el.html('')\r
+    this.$el.append(@label.render().el)\r
+    this.$el.append(@value.render().el)\r
+    this.$el.append(@note.render().el) if @note.is_visible()\r
+    this\r
+  \r
+  item: () ->\r
+    @profiler.item\r
+  \r
+  label_class: () ->\r
+    Locmare.ProfilerModule.ColumnModule.Label\r
+  \r
+  value_class: () ->\r
+    Locmare.ProfilerModule.ColumnModule.Value\r
+  \r
+  note_class: () ->\r
+    Locmare.ProfilerModule.ColumnModule.NoteNone\r
+  \r
+class Locmare.ProfilerModule.ColumnModule.Label extends Backbone.View\r
+  tagName: 'span'\r
+  \r
+  initialize: (options) ->\r
+    @column = options.column\r
+  \r
+  render: () ->\r
+    this.$el.html(@label())\r
+    this\r
+  \r
+  label: () ->\r
+    Pettanr.AppHelper.t_a(@column.item().item_name(), @column.column_name)\r
+  \r
+class Locmare.ProfilerModule.ColumnModule.Value extends Backbone.View\r
+  tagName: 'span'\r
+  \r
+  initialize: (options) ->\r
+    @column = options.column\r
+  \r
+  render: () ->\r
+    this.$el.html(@value())\r
+    this\r
+  \r
+  value: () ->\r
+    @column.item().get(@column.column_name)\r
+  \r
+class Locmare.ProfilerModule.ColumnModule.DateValue extends Backbone.View\r
+  tagName: 'span'\r
+  \r
+  initialize: (options) ->\r
+    @column = options.column\r
+  \r
+  render: () ->\r
+    this.$el.html(@value())\r
+    this\r
+  \r
+  value: () ->\r
+    l(@column.value())\r
+  \r
+class Locmare.ProfilerModule.ColumnModule.JsonValue extends Backbone.View\r
+  tagName: 'pre'\r
+  \r
+  initialize: (options) ->\r
+    @column = options.column\r
+  \r
+  render: () ->\r
+    this.$el.html(@value())\r
+    this\r
+  \r
+  value: () ->\r
+    JSON.pretty_generate(JSON.parse(@column.value()))\r
+  \r
+class Locmare.ProfilerModule.ColumnModule.ExtendValue extends Backbone.View\r
+  tagName: 'div'\r
+  \r
+  initialize: (options) ->\r
+    @column = options.column\r
+    @columns = {}\r
+    _this = this\r
+    _.each @extend_settings().column_names, (extend_column_name) ->\r
+      extend_column_manifest = _this.extend_settings().columns[extend_column_name] || {}\r
+      _this.columns[extend_column_name] = new Locmare.ProfilerModule.ColumnModule.ExtendModule.ExtendColumn({column: _this, extend_column_name: extend_column_name, extend_column_manifest: extend_column_manifest})\r
+  \r
+  render: () ->\r
+    _this = this\r
+    this.$el.html('')\r
+    _.each @sorted_columns(), (extend_column) ->\r
+      _this.$el.append(extend_column.render().el)\r
+    this\r
+  \r
+  \r
+  extend_columns: () ->\r
+    _.map @extend_settings().column_names, (column_name) ->\r
+      @columns[column_name]\r
+  \r
+  extend_settings: () ->\r
+    @template_model_profiler().extend_settings[self.booster.model_name]\r
+  \r
+  template_model_profiler: () ->\r
+    LocalManifest.manifest.profilers[@template_model().item_name]\r
+  \r
+  template_model: () ->\r
+    @booster().template_model\r
+  \r
+  extend_item: () ->\r
+    @booster.extend_item\r
+  \r
+  booster: () ->\r
+    @column.item().boosters[@column_manifest.boost_name]\r
+  \r
+class Locmare.ProfilerModule.ColumnModule.NoteNone\r
+  \r
+  is_visible:() ->\r
+    false\r
+  \r
+class Locmare.ProfilerModule.ColumnModule.Note extends Backbone.View\r
+  tagName: 'span'\r
+  \r
+  initialize: (options) ->\r
+    @column = options.column\r
+  \r
+  render: () ->\r
+    this.$el.html(@note())\r
+    this\r
+  \r
+  note: () ->\r
+    Pettanr.AppHelper.t_selected_item(@select_item_name, @column.value())\r
+  \r
+  is_visible:() ->\r
+    true\r
+  \r
+  select_item_name: () ->\r
+    @model_attribute_source_manifest().select_item_name\r
+  \r
+  model_manifest: () ->\r
+    Manifest.manifest().models[@column.profiler().item_name]\r
+  \r
+  model_attribute_manifest: () ->\r
+    @model_manifest().attributes[@column.column_name]\r
+  \r
+  model_attribute_source_manifest: () ->\r
+    @model_attribute_manifest().source\r
diff --git a/app/assets/javascripts/locmare/profiler/column/date.js.coffee b/app/assets/javascripts/locmare/profiler/column/date.js.coffee
new file mode 100644 (file)
index 0000000..3d53f90
--- /dev/null
@@ -0,0 +1,5 @@
+class Locmare.ProfilerModule.ColumnModule.Date extends Locmare.ProfilerModule.ColumnModule.Base\r
+  \r
+  value_class: () ->\r
+    Locmare.ProfilerModule.ColumnModule.DateValue\r
+  \r
diff --git a/app/assets/javascripts/locmare/profiler/column/default.js.coffee b/app/assets/javascripts/locmare/profiler/column/default.js.coffee
new file mode 100644 (file)
index 0000000..c0ecc3a
--- /dev/null
@@ -0,0 +1,2 @@
+class Locmare.ProfilerModule.ColumnModule.Default extends Locmare.ProfilerModule.ColumnModule.Base\r
+  \r
diff --git a/app/assets/javascripts/locmare/profiler/column/extend.js.coffee b/app/assets/javascripts/locmare/profiler/column/extend.js.coffee
new file mode 100644 (file)
index 0000000..c954ac2
--- /dev/null
@@ -0,0 +1,6 @@
+class Locmare.ProfilerModule.ColumnModule.Extend extends Locmare.ProfilerModule.ColumnModule.Base\r
+  \r
+  value_class: () ->\r
+    Locmare.ProfilerModule.ColumnModule.ExtendValue\r
+\r
+class Locmare.ProfilerModule.ColumnModule.ExtendModule\r
diff --git a/app/assets/javascripts/locmare/profiler/column/extend/extend_column.js.coffee b/app/assets/javascripts/locmare/profiler/column/extend/extend_column.js.coffee
new file mode 100644 (file)
index 0000000..1a0a64e
--- /dev/null
@@ -0,0 +1,15 @@
+class Locmare.ProfilerModule.ColumnModule.ExtendModule.ExtendColumn extends Backbone.View\r
+  initialize: (options) ->\r
+    @column = options.column  # extend_column\r
+    @extend_column_name = options.extend_column_name\r
+    @extend_column_manifest = options.extend_column_manifest\r
+  \r
+  label: () ->\r
+    Pettanr.AppHelper.t_a(@extend_item().singular(), @extend_column_name)\r
+  \r
+  value: () ->\r
+    @extend_item.get(@extend_column_name)\r
+  \r
+  extend_item: () ->\r
+    @column.extend_item()\r
+  \r
diff --git a/app/assets/javascripts/locmare/profiler/column/json.js.coffee b/app/assets/javascripts/locmare/profiler/column/json.js.coffee
new file mode 100644 (file)
index 0000000..3cb319c
--- /dev/null
@@ -0,0 +1,5 @@
+class Locmare.ProfilerModule.ColumnModule.Json extends Locmare.ProfilerModule.ColumnModule.Base\r
+  \r
+  value_class: () ->\r
+    Locmare.ProfilerModule.ColumnModule.JsonValue\r
+  \r
diff --git a/app/assets/javascripts/locmare/profiler/column/source.js.coffee b/app/assets/javascripts/locmare/profiler/column/source.js.coffee
new file mode 100644 (file)
index 0000000..95d41c2
--- /dev/null
@@ -0,0 +1,5 @@
+class Locmare.ProfilerModule.ColumnModule.Source extends Locmare.ProfilerModule.ColumnModule.Base\r
+  \r
+  note_class: () ->\r
+    Locmare.ProfilerModule.ColumnModule.Note\r
+  \r
diff --git a/app/assets/javascripts/locmare/profiler/header.js.coffee b/app/assets/javascripts/locmare/profiler/header.js.coffee
new file mode 100644 (file)
index 0000000..9f0645d
--- /dev/null
@@ -0,0 +1,13 @@
+class Locmare.ProfilerModule.Header extends Backbone.View\r
+  tagName: 'div'\r
+  \r
+  initialize: (options) ->\r
+    @profiler = options.profiler\r
+  \r
+  render: () ->\r
+    #this.$el.append(@filer().render().el)\r
+    this\r
+  \r
+  filer: () ->\r
+    new Locmare.Filer(@profiler.item_name, [@profiler.item], null, @profiler.operators)\r
+  \r
index 38d2c0b..1352297 100644 (file)
@@ -22,10 +22,11 @@ $ ->
   artist.fetch({})\r
   window.operators = new Pettanr.Operator([author, artist])\r
   \r
-  list_result = new Pettanr.Folder.Root({})\r
-  new Pettanr.FilerRender('folder', list_result, 'default', window.operators)\r
+  #list_result = new Pettanr.Folder.Root({})\r
+  #new Pettanr.FilerRender('folder', list_result, 'default', window.operators)\r
   window.router = new Pettanr.Router()\r
   Backbone.history.start({pushState: true})\r
+  window.router.navigate('', true)\r
   \r
   test_router: () ->\r
     window.router.navigate('folders/98', true)\r
index 1ef6a23..a2dfa15 100644 (file)
@@ -3,9 +3,41 @@ class Manifest.ControllerModule.ActionModule.Base extends ManifestBase.TypeNameA
   set_default: () ->\r
     super()\r
     @args.item_name ||= @parent.item_name  # not parent.name. follow singularized name\r
+    @args.param_id ||= 'prefix'\r
     \r
   init: () ->\r
     super()\r
     @item_name = @args.item_name\r
+    @param_id = @args.param_id\r
+  \r
+  encode_query: (params) ->\r
+    q = []\r
+    q.push('page=' + Pettanr.to_s(params['page'])) if params['page']\r
+    q.push('page_size=' + Pettanr.to_s(params['page_size'])) if params['page_size']\r
+    if q.length > 0\r
+      '?' + q.join('&')\r
+    else\r
+      ''\r
+  \r
+  encode_url: (action_name, params) ->\r
+    c = @parent.name\r
+    a = if action_name != 'index'\r
+      '/' + action_name\r
+    else\r
+      ''\r
+    i = if params['id']\r
+      '/' + Pettanr.to_s(params['id'])\r
+    else\r
+      ''\r
+    q = @encode_query(params)\r
+    switch @param_id\r
+      when 'prefix'\r
+        c + i + a + q\r
+      when 'suffix'\r
+        c + a + i + q\r
+      else\r
+        c + a + q\r
+  \r
+  url: (params) ->\r
+    @encode_url(@name, params)\r
   \r
-\r
index 802f516..bd5aa45 100644 (file)
@@ -3,8 +3,17 @@ class Manifest.ControllerModule.ActionModule.ActionList extends Manifest.Control
   set_default: () ->\r
     super()\r
     @args.list_name ||= @name\r
+    @args.counter_name = if @name == 'index'\r
+      'count'\r
+    else\r
+      'count_'\r
     \r
   init: () ->\r
     super()\r
     @list_name = @args.list_name\r
+    @counter_name = @args.counter_name\r
+  \r
+  counter_url: (params) ->\r
+    @encode_url(@counter_name, params)\r
+    \r
   \r
index d0826de..77c1aba 100644 (file)
@@ -9,6 +9,11 @@ class Manifest
     @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
   @item_name_to_model: (item_name) ->\r
index 65e839a..bbbcc6a 100644 (file)
@@ -21,6 +21,7 @@ class Manifest.Model extends ManifestBase.Base
   \r
   init: () ->\r
     super\r
+    @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
@@ -32,7 +33,7 @@ class Manifest.Model extends ManifestBase.Base
     Manifest.item_name_to_model @name\r
   \r
   table_name: () ->\r
-    @classify.table_name\r
+    @table_name\r
   \r
   valid_encode_columns: () ->\r
     r = []\r
index 8d6c55b..1c69934 100644 (file)
@@ -1,4 +1,6 @@
 class Pettanr.Balloon extends Peta.Element\r
+  url: '/balloons/'\r
+  \r
   @singular: () ->\r
     'Balloon'\r
   \r
@@ -14,11 +16,20 @@ class Pettanr.Balloon extends Peta.Element
     r: 0\r
   } \r
   \r
+  speech_balloon: () ->\r
+    new Pettanr.SpeechBalloon({id: @get('speech_balloon_id')})\r
+  \r
   url: () ->\r
     '/system_pictures/' + @system_picture().filename()\r
   \r
-  symbol_option: () ->\r
-    @speech_balloon().speech_balloon_template().symbol_option()\r
+  symbol_option: (cb) ->\r
+    sb = @speech_balloon()\r
+    sb.fetch().done ->\r
+      sbt = sb.speech_balloon_template()\r
+      sbt.fetch().done ->\r
+        sp = sbt.system_picture()\r
+        sp.fetch().done ->\r
+          cb(sp.tmb_opt_img_tag())\r
   \r
   style: () ->\r
     {\r
index c760c13..469774c 100644 (file)
@@ -1,4 +1,6 @@
 class Pettanr.Comic extends Peta.Binder\r
+  url: '/comics/'\r
+  \r
   @singular: () ->\r
     'Comic'\r
   \r
index db39a4b..554856e 100644 (file)
@@ -42,9 +42,9 @@ class Pettanr.FolderWatch extends Pettanr.Folder
 class Pettanr.Folder.Collection extends Backbone.Collection\r
   model: Pettanr.Folder\r
   url: 'folders'\r
-class Pettanr.Folder.Root extends Backbone.Collection\r
+class Pettanr.Folder.Root extends Pettanr.Folder\r
   model: Pettanr.Folder\r
-  url: '/folders/root'\r
+  url: '/folders/root?ref=1'\r
 class Pettanr.Folder.Children extends Backbone.Collection\r
   model: Pettanr.Folder\r
   initialize: (options) ->\r
index 1a18c15..2f112d4 100644 (file)
@@ -1,4 +1,6 @@
 class Pettanr.GroundPicture extends Peta.Element\r
+  url: '/ground_pictures/'\r
+  \r
   @singular: () ->\r
     'GroundPicture'\r
   \r
@@ -16,7 +18,7 @@ class Pettanr.GroundPicture extends Peta.Element
     ['repeat', 'repeat-x', 'repeat-y', 'no-repeat']\r
   \r
   picture: () ->\r
-    @get('picture')\r
+    new Pettanr.Picture({id: @get('picture_id')})\r
   \r
   has_picture: () ->\r
     true\r
@@ -34,12 +36,15 @@ class Pettanr.GroundPicture extends Peta.Element
     @merge_opacity(r, opacity) if spot and spot != this\r
     r\r
   \r
-  tmb_opt_img_tag: () ->\r
-    wh = Pettanr.Imager.thumbnail_size(@picture().get('width'), @picture().get('height'))\r
-    {src: @picture().r_url(), width: wh[0], height: wh[1], alt: @get('caption')}\r
+  tmb_opt_img_tag: (picture) ->\r
+    wh = Pettanr.Imager.thumbnail_size(picture().get('width'), picture().get('height'))\r
+    new Pettanr.AppHelperImg({src: picture.r_url(), size: Math.abs(wh[0]), alt: @get('caption')})\r
   \r
-  symbol_option: () ->\r
-    @tmb_opt_img_tag()\r
+  symbol_option: (cb) ->\r
+    i = @picture()\r
+    _this = this\r
+    i.fetch().done ->\r
+      cb(_this.tmb_opt_img_tag(i))\r
   \r
   repeat_text: () ->\r
     Pettanr.GroundPicture.repeat_texts()[@get('repeat')]\r
index 2e18e58..62bfd0c 100644 (file)
@@ -1,4 +1,6 @@
 class Pettanr.License extends Peta.SystemResource\r
+  url: '/licenses/'\r
+  \r
   @singular: () ->\r
     'License'\r
   \r
@@ -11,11 +13,17 @@ class Pettanr.License extends Peta.SystemResource
   \r
   license_group: () ->\r
     r = new Pettanr.LicenseGroup({id: @get('license_group_id')})\r
-    r.fetch({}).done () ->\r
-      r\r
+  \r
+  system_picture: () ->\r
+    new Pettanr.SystemPicture({id: @get('system_picture_id')})\r
+  \r
+  symbol_option: (cb) ->\r
+    i = @system_picture()\r
+    i.fetch().done ->\r
+      cb(i.tmb_opt_img_tag())\r
   \r
   caption_with_group: () ->\r
-    @license_group().get('caption') + '/' + @get('caption')\r
+    new Pettanr.License.Caption({license: this, license_group: @license_group()})\r
   \r
   initialize: () ->\r
     if @id\r
@@ -24,3 +32,16 @@ class Pettanr.License extends Peta.SystemResource
 class Pettanr.License.Collection extends Backbone.Collection\r
   model: Pettanr.License\r
   url: '/licenses'\r
+\r
+class Pettanr.License.Caption extends Backbone.View\r
+  tagName: 'span'\r
+  initialize: (options) ->\r
+    @license = options.license\r
+    @license_group = options.license_group\r
+    \r
+  render: () ->\r
+    _this = this\r
+    @license_group.fetch().done ->\r
+      _this.$el.html(_this.license_group.get('caption') + '/' + _this.license.get('caption'))\r
+    this\r
+  \r
index f0d70f9..5c22091 100644 (file)
@@ -1,4 +1,6 @@
 class Pettanr.LicenseGroup extends Peta.Template\r
+  url: '/license_groups/'\r
+  \r
   @singular: () ->\r
     'LicenseGroup'\r
   \r
index bd78f92..fe1ffa9 100644 (file)
@@ -1,4 +1,6 @@
 class Pettanr.OriginalPicture extends Peta.Content\r
+  url: '/original_pictures/'\r
+  \r
   @singular: () ->\r
     'OriginalPicture'\r
   \r
@@ -29,8 +31,10 @@ class Pettanr.OriginalPicture extends Peta.Content
     wh = Pettanr.Imager.thumbnail_size(@get('width'), @get('height'))\r
     {src: @r_url(), width: wh[0], height: wh[1]}\r
   \r
-  symbol_option: () ->\r
-    @tmb_opt_img_tag()\r
+  symbol_option: (cb) ->\r
+    _this = this\r
+    this.fetch().done ->\r
+      cb(_this.tmb_opt_img_tag())\r
   \r
   revision: () ->\r
     head = @history()[0]\r
index 794797c..f8f9be3 100644 (file)
@@ -1,4 +1,6 @@
 class Pettanr.PanelPicture extends Peta.Element\r
+  url: '/panel_pictures/'\r
+  \r
   @singular: () ->\r
     'PanelPicture'\r
   \r
@@ -9,6 +11,9 @@ class Pettanr.PanelPicture extends Peta.Element
     id: null\r
   } \r
   \r
+  picture: () ->\r
+    new Pettanr.Picture({id: @get('picture_id')})\r
+  \r
   @has_picture: () ->\r
     true\r
   \r
@@ -52,12 +57,15 @@ class Pettanr.PanelPicture extends Peta.Element
       style: "#{o}"\r
     })\r
   \r
-  tmb_opt_img_tag: () ->\r
+  tmb_opt_img_tag: (picture) ->\r
     wh = Pettanr.Imager.thumbnail_size(@get('width'), @get('height'))\r
-    {src: @r_url(), width: Math.abs(wh[0]), height: Math.abs(wh[1]), alt: @get('caption')}\r
+    new Pettanr.AppHelperImg({src: picture.r_url(), size: Math.abs(wh[0]), alt: @get('caption')})\r
   \r
-  symbol_option: () ->\r
-    @picture().symbol_option()\r
+  symbol_option: (cb) ->\r
+    i = @picture()\r
+    _this = this\r
+    i.fetch().done ->\r
+      cb(_this.tmb_opt_img_tag(i))\r
   \r
   initialize: () ->\r
     if @id\r
index ed592ff..2af7542 100644 (file)
@@ -1,4 +1,6 @@
 class Pettanr.Picture extends Peta.Content\r
+  url: '/pictures/'\r
+  \r
   @singular: () ->\r
     'Picture'\r
   \r
@@ -44,7 +46,7 @@ class Pettanr.Picture extends Peta.Content
     lgn + '[' + ln + ']'\r
   \r
   symbol_option: () ->\r
-    @tmb_opt_img_tag()\r
+    this\r
   \r
   is_enable: () ->\r
     if @head().resource_picture()\r
index 2d5b454..fb2cb02 100644 (file)
@@ -1,4 +1,6 @@
 class Pettanr.ResourcePicture extends Peta.Content\r
+  url: '/resource_pictures/'\r
+  \r
   @singular: () ->\r
     'ResourcePicture'\r
   \r
@@ -40,8 +42,10 @@ class Pettanr.ResourcePicture extends Peta.Content
     ln = Pettanr.to_s(@license().get('caption'))\r
     lgn + '[' + ln + ']'\r
   \r
-  symbol_option: () ->\r
-    @tmb_opt_img_tag()\r
+  symbol_option: (cb) ->\r
+    _this = this\r
+    this.fetch().done ->\r
+      cb(_this.tmb_opt_img_tag())\r
   \r
   initialize: () ->\r
     if @id\r
@@ -49,4 +53,4 @@ class Pettanr.ResourcePicture extends Peta.Content
   \r
 class Pettanr.ResourcePicture.Collection extends Backbone.Collection\r
   model: Pettanr.ResourcePicture\r
-  url: '/resource_pictures'\r
+  url: '/resource_pictures/'\r
index 6d636bf..9447642 100644 (file)
@@ -1,5 +1,5 @@
 class Pettanr.Scroll extends Peta.Binder\r
-  url: ''\r
+  url: '/scrolls/'\r
   \r
   @singular: () ->\r
     'Scroll'\r
index 7c158fd..92b8bd4 100644 (file)
@@ -1,4 +1,6 @@
 class Pettanr.Speech extends Peta.Element\r
+  url: '/speeches/'\r
+  \r
   @singular: () ->\r
     'Speech'\r
   \r
@@ -13,11 +15,20 @@ class Pettanr.Speech extends Peta.Element
     height: 100\r
   } \r
   \r
+  speech_balloon: () ->\r
+    new Pettanr.SpeechBalloon({id: @get('speech_balloon_id')})\r
+  \r
   @text_align_texts: () -> \r
     ['left', 'left', 'right', 'center']\r
   \r
-  symbol_option: () ->\r
-    @speech_balloon().speech_balloon_template().symbol_option()\r
+  symbol_option: (cb) ->\r
+    sb = @speech_balloon()\r
+    sb.fetch().done ->\r
+      sbt = sb.speech_balloon_template()\r
+      sbt.fetch().done ->\r
+        sp = sbt.system_picture()\r
+        sp.fetch().done ->\r
+          cb(sp.tmb_opt_img_tag())\r
   \r
   outer_style: () ->\r
     {\r
index e1dc8ce..55841ef 100644 (file)
@@ -1,4 +1,6 @@
 class Pettanr.SpeechBalloon extends Peta.Element\r
+  url: '/speech_balloons/'\r
+  \r
   @singular: () ->\r
     'SpeechBalloon'\r
   \r
@@ -11,11 +13,21 @@ class Pettanr.SpeechBalloon extends Peta.Element
     t: null\r
   } \r
   \r
+  speech_balloon_template: () ->\r
+    new Pettanr.SpeechBalloonTemplate({id: @get('speech_balloon_template_id')})\r
+  \r
   @has_picture: () ->\r
     false\r
   \r
-  @symbol_option: () ->\r
-    @speech_balloon_template.symbol_option\r
+  symbol_option: (cb) ->\r
+    sbt = @speech_balloon_template()\r
+    sbt.fetch().done ->\r
+      sp = sbt.system_picture()\r
+      sp.fetch().done ->\r
+        cb(sp.tmb_opt_img_tag())\r
+  \r
+  plain_scenario: () ->\r
+    @get('caption')\r
   \r
   initialize: () ->\r
     if @id\r
index 55dafaf..d85de45 100644 (file)
@@ -14,8 +14,10 @@ class Pettanr.SpeechBalloonTemplate extends Peta.Template
   system_picture: () ->\r
     new Pettanr.SystemPicture({id: @get('system_picture_id')})\r
   \r
-  symbol_option: () ->\r
-    @system_picture()\r
+  symbol_option: (cb) ->\r
+    i = @system_picture()\r
+    i.fetch().done ->\r
+      cb(i.tmb_opt_img_tag())\r
   \r
   initialize: () ->\r
     if @id\r
index 82e60c8..1ddeced 100644 (file)
@@ -25,10 +25,12 @@ class Pettanr.SystemPicture extends Peta.SystemResource
   \r
   tmb_opt_img_tag: () ->\r
     wh = Pettanr.Imager.thumbnail_size(@get('width'), @get('height'))\r
-    {src: @r_url(), width: wh[0], height: wh[1]}\r
+    new Pettanr.AppHelperImg({src: @r_url(), size: wh[0]})\r
   \r
-  symbol_option: () ->\r
-    @tmb_opt_img_tag()\r
+  symbol_option: (cb) ->\r
+    _this = this\r
+    this.fetch().done ->\r
+      cb(_this.tmb_opt_img_tag())\r
   \r
   initialize: () ->\r
     if @id\r
index f5fb137..ca7cd7b 100644 (file)
@@ -9,6 +9,14 @@ class Pettanr.WritingFormat extends Peta.Template
     id: null\r
   } \r
   \r
+  system_picture: () ->\r
+    new Pettanr.SystemPicture({id: @get('system_picture_id')})\r
+  \r
+  symbol_option: (cb) ->\r
+    i = @system_picture()\r
+    i.fetch().done ->\r
+      cb(i.tmb_opt_img_tag())\r
+  \r
   initialize: () ->\r
     if @id\r
       @url = @url + @id\r
index 248c0e3..294ee7a 100644 (file)
@@ -74,6 +74,12 @@ class Peta.Item extends Backbone.Model
   \r
   #InstanceMethods\r
   \r
+  singular: () ->\r
+    Pettanr[@constructor.name].singular()\r
+  \r
+  plural: () ->\r
+    Pettanr[@constructor.name].plural()\r
+  \r
   item_name: () ->\r
     @my_class().item_name()\r
   \r
index e2bdc23..1de7dd2 100644 (file)
@@ -1,4 +1,6 @@
 class Pettanr\r
+  # Foo.class -> Pettanr[@constructor.name]\r
+\r
   @is_blank: (str) ->\r
     !str?.trim()\r
   \r
@@ -39,8 +41,11 @@ class Pettanr
         if l.length == 1\r
           I18n.t('activerecord.models.' + Pettanr[label].item_name())\r
         else\r
-          I18n.t('activerecord.models.attribtes.' + Pettanr[l.first].item_name() + '.' + l.last)\r
+          Pettanr.AppHelper.t_a(Pettanr[l.first].item_name(), l.last)\r
     \r
+    @t_a: (item_name, attr_name) ->\r
+      I18n.t('activerecord.attributes.' + item_name + '.' + attr_name)\r
+      \r
     @t_select_items: (items) ->\r
       _.map items, (i) ->\r
         [t(i[0]), i[1]]\r
@@ -111,53 +116,27 @@ class Pettanr
     count: () ->\r
       @get('count')\r
     \r
-  class Pettanr.Url\r
+  class Pettanr.Pager extends Backbone.View\r
     \r
-    @decode: (params) ->\r
-      \r
-    @encode: (params) ->\r
-      \r
-  class Pettanr.Pager\r
-    \r
-    initialize: (@counter) ->\r
-      @counter.fetch().done ->\r
-        \r
-      @current_page = @list_result.page\r
-      @per_page = @list_result.page_size\r
-      @total_page = (@total / @per_page) + 1\r
+    initialize: (options) ->\r
+      @action = options['action']\r
+      @params = options['params']\r
+      @current_page = @params['page']\r
+      @per_page = @params['page_size']\r
       @window_size = 3\r
-    \r
-    @by_params: (params) ->\r
-      \r
-      @page = params['page']\r
-      @page_size = params['page_size']\r
-      @counter = new Pettanr.CounterModel({}, {url: '/' + params['controller'] + i + 'count_' + a})\r
-      new Pettanr.Pager()\r
+      @counter = new Pettanr.CounterModel({}, {url: '/' + @action.counter_url(@params)})\r
+      _this = this\r
+      @counter.fetch().done ->\r
+        _this.total_page = (@total / _this.per_page) + 1\r
   \r
   class Pettanr.FilerCollection extends Backbone.Collection\r
     \r
     initialize: (models, options) ->\r
       @model = options['model']\r
-      params = options['params']\r
-      @counter = options['counter']\r
+      @action = options['action']\r
+      @params = options['params']\r
       \r
-      i = if params['id']\r
-        params['id'] + '/'\r
-      else\r
-        ''\r
-      a = if params['action'] != 'index'\r
-        params['action']\r
-      else\r
-        ''\r
-      q = []\r
-      q.push('page=' + Pettanr.to_s(@page)) if @page\r
-      q.push('page_size=' + Pettanr.to_s(@page_size)) if @page_size\r
-      qry = if q.length > 0\r
-        '?' + q.join('&')\r
-      else\r
-        ''\r
-      @url = '/' + params['controller'] + i + a + qry\r
-      @pager = new Pettanr.Pager(@counter)\r
+      @url = '/' + @action.url(@params)\r
   \r
   class Pettanr.AppController\r
     constructor: () ->\r
@@ -173,16 +152,16 @@ 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
-      @counter = new Pettanr.CounterModel({}, {url: @my_action.url(i)})\r
-      @list = new Pettanr.FilerCollection({}, {model: @my_list_model_class, counter: @counter, params: @params})\r
+      @pager = new Pettanr.Pager({action: @my_action, params: @params})\r
+      @list = new Pettanr.FilerCollection({}, {model: @my_list_model_class, action: @my_action, params: @params})\r
     \r
     filer_list: () ->\r
       @set_list()\r
       f = new Locmare.Filer({\r
         el: "#pettanr",\r
         item_name: @my_list_model_class.item_name(), \r
-        list: @list, \r
-        pager: @list.pager, \r
+        collection: @list, \r
+        pager: @pager, \r
         operators: window.operators\r
       })\r
   \r
index b0c9db1..12b333d 100644 (file)
@@ -74,11 +74,18 @@ class Pettanr.Router extends Backbone.Router
       else\r
         params['action'] = 'index'\r
       this.fire(params)\r
+    this.route('', 'home')\r
     this.route(':controller/:id/:action?*query_string', 'c_i_a')\r
     this.route(':controller/:id/:action', 'c_i_a')\r
     this.route(':controller/:id?*query_string', 'c_i')\r
     this.route(':controller/:id', 'c_i')\r
   \r
+  home: () ->\r
+    params = {}\r
+    params['controller'] = 'folders'\r
+    params['action'] = 'root'\r
+    @fire(params)\r
+  \r
   hoge: () ->\r
     names = _.map Manifest.manifest().controllers, (controller_manifest, controller_name) ->\r
       c = Pettanr[Pettanr.camelize(controller_name) + 'Controller']\r
index cbc03ff..45da9b9 100644 (file)
@@ -10,6 +10,7 @@
         type: 'list',\r
         args: {\r
           list_name: 'public',\r
+          param_id: 'none',\r
         },\r
       },\r
       show: {\r
         type: 'list',\r
         args: {\r
           list_name: 'public',\r
+          param_id: 'none',\r
         },\r
       },\r
       by_author: {\r
         type: 'list',\r
+        args: {\r
+          param_id: 'suffix',\r
+        },\r
       },\r
       by_panel: {\r
         type: 'list',\r
+        args: {\r
+          param_id: 'suffix',\r
+        },\r
       },\r
       play: {\r
         type: 'list',\r
         type: 'list',\r
         args: {\r
           list_name: 'public',\r
-          \r
+          param_id: 'none',\r
         },\r
       },\r
       by_panel: {\r
         type: 'list',\r
+        args: {\r
+          param_id: 'suffix',\r
+        },\r
       },\r
       by_scroll: {\r
         type: 'list',\r
+        args: {\r
+          param_id: 'suffix',\r
+        },\r
       },\r
       by_author: {\r
         type: 'list',\r
+        args: {\r
+          param_id: 'suffix',\r
+        },\r
       },\r
       show: {\r
         type: 'show',\r
         type: 'list',\r
         args: {\r
           list_name: 'public',\r
-          \r
+          param_id: 'none',\r
         },\r
       },\r
       by_story: {\r
         type: 'list',\r
+        args: {\r
+          param_id: 'suffix',\r
+        },\r
       },\r
       by_author: {\r
         type: 'list',\r
+        args: {\r
+          param_id: 'suffix',\r
+        },\r
       },\r
       play: {\r
         type: 'list',\r
         type: 'list',\r
         args: {\r
           list_name: 'public',\r
-          \r
+          param_id: 'none',\r
         },\r
       },\r
       by_comic: {\r
         type: 'list',\r
+        args: {\r
+          param_id: 'suffix',\r
+        },\r
       },\r
       by_story: {\r
         type: 'list',\r
+        args: {\r
+          param_id: 'suffix',\r
+        },\r
       },\r
       show: {\r
         type: 'show',\r
         type: 'list',\r
         args: {\r
           list_name: 'public',\r
-          \r
+          param_id: 'none',\r
         },\r
       },\r
       by_comic: {\r
         type: 'list',\r
+        args: {\r
+          param_id: 'suffix',\r
+        },\r
       },\r
       by_sheet: {\r
         type: 'list',\r
+        args: {\r
+          param_id: 'suffix',\r
+        },\r
       },\r
       by_author: {\r
         type: 'list',\r
+        args: {\r
+          param_id: 'suffix',\r
+        },\r
       },\r
       play: {\r
         type: 'list',\r
         type: 'list',\r
         args: {\r
           list_name: 'public',\r
-          \r
+          param_id: 'none',\r
         },\r
       },\r
       by_story: {\r
         type: 'list',\r
+        args: {\r
+          param_id: 'suffix',\r
+        },\r
       },\r
       by_sheet: {\r
         type: 'list',\r
+        args: {\r
+          param_id: 'suffix',\r
+        },\r
       },\r
       by_author: {\r
         type: 'list',\r
+        args: {\r
+          param_id: 'suffix',\r
+        },\r
       },\r
       show: {\r
         type: 'show',\r
         type: 'list',\r
         args: {\r
           list_name: 'public',\r
-          \r
+          param_id: 'none',\r
         },\r
       },\r
       by_story: {\r
         type: 'list',\r
+        args: {\r
+          param_id: 'suffix',\r
+        },\r
       },\r
       by_panel: {\r
         type: 'list',\r
+        args: {\r
+          param_id: 'suffix',\r
+        },\r
       },\r
       by_author: {\r
         type: 'list',\r
+        args: {\r
+          param_id: 'suffix',\r
+        },\r
       },\r
       play: {\r
         type: 'list',\r
         type: 'list',\r
         args: {\r
           list_name: 'public',\r
-          \r
+          param_id: 'none',\r
         },\r
       },\r
       by_sheet: {\r
         type: 'list',\r
+        args: {\r
+          param_id: 'suffix',\r
+        },\r
       },\r
       by_panel: {\r
         type: 'list',\r
+        args: {\r
+          param_id: 'suffix',\r
+        },\r
       },\r
       by_author: {\r
         type: 'list',\r
+        args: {\r
+          param_id: 'suffix',\r
+        },\r
       },\r
       show: {\r
         type: 'show',\r
         type: 'list',\r
         args: {\r
           list_name: 'public',\r
-          \r
+          param_id: 'none',\r
         },\r
       },\r
       by_scroll: {\r
         type: 'list',\r
+        args: {\r
+          param_id: 'suffix',\r
+        },\r
       },\r
       by_sheet: {\r
         type: 'list',\r
+        args: {\r
+          param_id: 'suffix',\r
+        },\r
       },\r
       by_author: {\r
         type: 'list',\r
+        args: {\r
+          param_id: 'suffix',\r
+        },\r
       },\r
       by_speech_balloon_template: {\r
         type: 'list',\r
+        args: {\r
+          param_id: 'suffix',\r
+        },\r
       },\r
       show: {\r
         type: 'show',\r
         type: 'list',\r
         args: {\r
           list_name: 'public',\r
-          \r
+          param_id: 'none',\r
         },\r
       },\r
       by_panel: {\r
         type: 'list',\r
+        args: {\r
+          param_id: 'suffix',\r
+        },\r
       },\r
       by_author: {\r
         type: 'list',\r
+        args: {\r
+          param_id: 'suffix',\r
+        },\r
       },\r
       show: {\r
         type: 'show',\r
         type: 'list',\r
         args: {\r
           list_name: 'public',\r
-          \r
+          param_id: 'none',\r
         },\r
       },\r
       by_panel: {\r
         type: 'list',\r
+        args: {\r
+          param_id: 'suffix',\r
+        },\r
       },\r
       by_author: {\r
         type: 'list',\r
+        args: {\r
+          param_id: 'suffix',\r
+        },\r
       },\r
       by_speech_balloon_template: {\r
         type: 'list',\r
+        args: {\r
+          param_id: 'suffix',\r
+        },\r
       },\r
       show: {\r
         type: 'show',\r
         type: 'list',\r
         args: {\r
           list_name: 'public',\r
-          \r
+          param_id: 'none',\r
         },\r
       },\r
       by_author: {\r
         type: 'list',\r
+        args: {\r
+          param_id: 'suffix',\r
+        },\r
       },\r
       show: {\r
         type: 'show',\r
         type: 'list',\r
         args: {\r
           list_name: 'public',\r
-          \r
+          param_id: 'none',\r
         },\r
       },\r
       by_author: {\r
         type: 'list',\r
+        args: {\r
+          param_id: 'suffix',\r
+        },\r
       },\r
       show: {\r
         type: 'show',\r
         type: 'list',\r
         args: {\r
           list_name: 'public',\r
-          \r
+          param_id: 'none',\r
         },\r
       },\r
       by_panel: {\r
         type: 'list',\r
+        args: {\r
+          param_id: 'suffix',\r
+        },\r
       },\r
       by_author: {\r
         type: 'list',\r
+        args: {\r
+          param_id: 'suffix',\r
+        },\r
       },\r
       show: {\r
         type: 'show',\r
         type: 'list',\r
         args: {\r
           list_name: 'public',\r
-          \r
+          param_id: 'none',\r
         },\r
       },\r
       by_panel: {\r
         type: 'list',\r
+        args: {\r
+          param_id: 'suffix',\r
+        },\r
       },\r
       by_author: {\r
         type: 'list',\r
+        args: {\r
+          param_id: 'suffix',\r
+        },\r
       },\r
       show: {\r
         type: 'show',\r
         type: 'list',\r
         args: {\r
           list_name: 'private',\r
+          param_id: 'none',\r
         },\r
       },\r
       show: {\r
         type: 'list',\r
         args: {\r
           list_name: 'public',\r
-          \r
+          param_id: 'none',\r
         },\r
       },\r
       by_artist: {\r
         type: 'list',\r
+        args: {\r
+          param_id: 'suffix',\r
+        },\r
       },\r
       show: {\r
         type: 'show',\r
         type: 'list',\r
         args: {\r
           list_name: 'public',\r
-          \r
+          param_id: 'none',\r
         },\r
       },\r
       by_license_group: {\r
         type: 'list',\r
+        args: {\r
+          param_id: 'suffix',\r
+        },\r
       },\r
       by_license: {\r
         type: 'list',\r
+        args: {\r
+          param_id: 'suffix',\r
+        },\r
       },\r
       by_artist: {\r
         type: 'list',\r
+        args: {\r
+          param_id: 'suffix',\r
+        },\r
       },\r
       show: {\r
         type: 'show',\r
         type: 'list',\r
         args: {\r
           list_name: 'public',\r
-          \r
+          param_id: 'none',\r
         },\r
       },\r
       by_panel: {\r
         type: 'list',\r
+        args: {\r
+          param_id: 'suffix',\r
+        },\r
       },\r
       show: {\r
         type: 'show',\r
         type: 'list',\r
         args: {\r
           list_name: 'public',\r
-          \r
+          param_id: 'none',\r
         },\r
       },\r
       by_system_picture: {\r
         type: 'list',\r
+        args: {\r
+          param_id: 'suffix',\r
+        },\r
       },\r
       show: {\r
         type: 'show',\r
         type: 'list',\r
         args: {\r
           list_name: 'public',\r
-          \r
+          param_id: 'none',\r
         },\r
       },\r
       show: {\r
         type: 'list',\r
         args: {\r
           list_name: 'public',\r
-          \r
+          param_id: 'none',\r
         },\r
       },\r
       by_license_group: {\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
         type: 'list',\r
         args: {\r
           list_name: 'public',\r
-          \r
+          param_id: 'none',\r
         },\r
       },\r
       show: {\r
         type: 'list',\r
         args: {\r
           list_name: 'public',\r
-          \r
+          param_id: 'none',\r
         },\r
       },\r
       show: {\r
         type: 'list',\r
         args: {\r
           list_name: 'public',\r
-          \r
+          param_id: 'none',\r
         },\r
       },\r
       show: {\r
         args: {\r
           item_name: 'scroll',\r
           list_name: 'private',\r
-          \r
+          param_id: 'none',\r
         },\r
       },\r
       scroll_panels: {\r
         args: {\r
           item_name: 'scroll_panel',\r
           list_name: 'private',\r
-          \r
+          param_id: 'none',\r
         },\r
       },\r
       comics: {\r
         args: {\r
           item_name: 'comic',\r
           list_name: 'private',\r
-          \r
+          param_id: 'none',\r
         },\r
       },\r
       stories: {\r
         args: {\r
           item_name: 'story',\r
           list_name: 'private',\r
-          \r
+          param_id: 'none',\r
         },\r
       },\r
       story_sheets: {\r
         args: {\r
           item_name: 'story_sheet',\r
           list_name: 'private',\r
-          \r
+          param_id: 'none',\r
         },\r
       },\r
       sheets: {\r
         args: {\r
           item_name: 'sheet',\r
           list_name: 'private',\r
-          \r
+          param_id: 'none',\r
         },\r
       },\r
       sheet_panels: {\r
         args: {\r
           item_name: 'sheet_panel',\r
           list_name: 'private',\r
-          \r
+          param_id: 'none',\r
         },\r
       },\r
       panels: {\r
         args: {\r
           item_name: 'panel',\r
           list_name: 'private',\r
-          \r
+          param_id: 'none',\r
         },\r
       },\r
       panel_pictures: {\r
         args: {\r
           item_name: 'panel_picture',\r
           list_name: 'private',\r
-          \r
+          param_id: 'none',\r
         },\r
       },\r
       speech_balloons: {\r
         args: {\r
           item_name: 'speech_balloon',\r
           list_name: 'private',\r
-          \r
+          param_id: 'none',\r
         },\r
       },\r
       speeches: {\r
         args: {\r
           item_name: 'speech',\r
           list_name: 'private',\r
-          \r
+          param_id: 'none',\r
         },\r
       },\r
       balloons: {\r
         args: {\r
           item_name: 'balloon',\r
           list_name: 'private',\r
-          \r
+          param_id: 'none',\r
         },\r
       },\r
       ground_pictures: {\r
         args: {\r
           item_name: 'ground_picture',\r
           list_name: 'private',\r
-          \r
+          param_id: 'none',\r
         },\r
       },\r
       ground_colors: {\r
         args: {\r
           item_name: 'ground_color',\r
           list_name: 'private',\r
-          \r
+          param_id: 'none',\r
         },\r
       },\r
       original_pictures: {\r
         args: {\r
           item_name: 'original_picture',\r
           list_name: 'private',\r
-          \r
+          param_id: 'none',\r
         },\r
       },\r
       resource_pictures: {\r
         args: {\r
           item_name: 'resource_picture',\r
           list_name: 'private',\r
-          \r
+          param_id: 'none',\r
         },\r
       },\r
     },\r
index ad431b0..03a4112 100644 (file)
@@ -1,6 +1,7 @@
 #マニフェスト\r
 @models = {\r
   folder: {\r
+    table_name: 'folders',\r
     associations: {\r
       belongs_to: {\r
       },\r
@@ -65,6 +66,7 @@
     },\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
     },\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 f1da1ce..42e8780 100644 (file)
@@ -165,7 +165,7 @@ class ApplicationController < ActionController::Base
   def show_prof_format format
     format.prof {
       self.formats = [:html]
-      @profiler = Locmare::Profiler.new @my_model.model_name, @item, @operators
+      @profiler = Locmare::Profiler.new @my_model.item_name, @item, @operators
       render @profiler.template_name, :locals => {
         :profiler => @profiler
       }
index e57b03b..cbf5918 100644 (file)
@@ -13,9 +13,15 @@ class FoldersController < ApplicationController
   def root
     set_model
     @item = Folder.root
-    respond_to do |format|
-      children_html_format format
-      children_json_format format
+    if params[:ref]
+      respond_to do |format|
+        show_json_format format
+      end
+    else
+      respond_to do |format|
+        children_html_format format
+        children_json_format format
+      end
     end
   end
   
index 7626f7a..df95c3d 100644 (file)
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public"\r
+            "list_name": "public",\r
+            "param_id": "none"\r
           }\r
         },\r
         "show": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public"\r
+            "list_name": "public",\r
+            "param_id": "none"\r
           }\r
         },\r
         "by_author": {\r
-          "type": "list"\r
+          "type": "list",\r
+          "args": {\r
+            "param_id": "suffix"\r
+          }\r
         },\r
         "by_panel": {\r
-          "type": "list"\r
+          "type": "list",\r
+          "args": {\r
+            "param_id": "suffix"\r
+          }\r
         },\r
         "play": {\r
           "type": "list",\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public"\r
+            "list_name": "public",\r
+            "param_id": "none"\r
           }\r
         },\r
         "by_panel": {\r
-          "type": "list"\r
+          "type": "list",\r
+          "args": {\r
+            "param_id": "suffix"\r
+          }\r
         },\r
         "by_scroll": {\r
-          "type": "list"\r
+          "type": "list",\r
+          "args": {\r
+            "param_id": "suffix"\r
+          }\r
         },\r
         "by_author": {\r
-          "type": "list"\r
+          "type": "list",\r
+          "args": {\r
+            "param_id": "suffix"\r
+          }\r
         },\r
         "show": {\r
           "type": "show"\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public"\r
+            "list_name": "public",\r
+            "param_id": "none"\r
           }\r
         },\r
         "by_story": {\r
-          "type": "list"\r
+          "type": "list",\r
+          "args": {\r
+            "param_id": "suffix"\r
+          }\r
         },\r
         "by_author": {\r
-          "type": "list"\r
+          "type": "list",\r
+          "args": {\r
+            "param_id": "suffix"\r
+          }\r
         },\r
         "play": {\r
           "type": "list",\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public"\r
+            "list_name": "public",\r
+            "param_id": "none"\r
           }\r
         },\r
         "by_comic": {\r
-          "type": "list"\r
+          "type": "list",\r
+          "args": {\r
+            "param_id": "suffix"\r
+          }\r
         },\r
         "by_story": {\r
-          "type": "list"\r
+          "type": "list",\r
+          "args": {\r
+            "param_id": "suffix"\r
+          }\r
         },\r
         "show": {\r
           "type": "show"\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public"\r
+            "list_name": "public",\r
+            "param_id": "none"\r
           }\r
         },\r
         "by_comic": {\r
-          "type": "list"\r
+          "type": "list",\r
+          "args": {\r
+            "param_id": "suffix"\r
+          }\r
         },\r
         "by_sheet": {\r
-          "type": "list"\r
+          "type": "list",\r
+          "args": {\r
+            "param_id": "suffix"\r
+          }\r
         },\r
         "by_author": {\r
-          "type": "list"\r
+          "type": "list",\r
+          "args": {\r
+            "param_id": "suffix"\r
+          }\r
         },\r
         "play": {\r
           "type": "list",\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public"\r
+            "list_name": "public",\r
+            "param_id": "none"\r
           }\r
         },\r
         "by_story": {\r
-          "type": "list"\r
+          "type": "list",\r
+          "args": {\r
+            "param_id": "suffix"\r
+          }\r
         },\r
         "by_sheet": {\r
-          "type": "list"\r
+          "type": "list",\r
+          "args": {\r
+            "param_id": "suffix"\r
+          }\r
         },\r
         "by_author": {\r
-          "type": "list"\r
+          "type": "list",\r
+          "args": {\r
+            "param_id": "suffix"\r
+          }\r
         },\r
         "show": {\r
           "type": "show"\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public"\r
+            "list_name": "public",\r
+            "param_id": "none"\r
           }\r
         },\r
         "by_story": {\r
-          "type": "list"\r
+          "type": "list",\r
+          "args": {\r
+            "param_id": "suffix"\r
+          }\r
         },\r
         "by_panel": {\r
-          "type": "list"\r
+          "type": "list",\r
+          "args": {\r
+            "param_id": "suffix"\r
+          }\r
         },\r
         "by_author": {\r
-          "type": "list"\r
+          "type": "list",\r
+          "args": {\r
+            "param_id": "suffix"\r
+          }\r
         },\r
         "play": {\r
           "type": "list",\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public"\r
+            "list_name": "public",\r
+            "param_id": "none"\r
           }\r
         },\r
         "by_sheet": {\r
-          "type": "list"\r
+          "type": "list",\r
+          "args": {\r
+            "param_id": "suffix"\r
+          }\r
         },\r
         "by_panel": {\r
-          "type": "list"\r
+          "type": "list",\r
+          "args": {\r
+            "param_id": "suffix"\r
+          }\r
         },\r
         "by_author": {\r
-          "type": "list"\r
+          "type": "list",\r
+          "args": {\r
+            "param_id": "suffix"\r
+          }\r
         },\r
         "show": {\r
           "type": "show"\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public"\r
+            "list_name": "public",\r
+            "param_id": "none"\r
           }\r
         },\r
         "by_scroll": {\r
-          "type": "list"\r
+          "type": "list",\r
+          "args": {\r
+            "param_id": "suffix"\r
+          }\r
         },\r
         "by_sheet": {\r
-          "type": "list"\r
+          "type": "list",\r
+          "args": {\r
+            "param_id": "suffix"\r
+          }\r
         },\r
         "by_author": {\r
-          "type": "list"\r
+          "type": "list",\r
+          "args": {\r
+            "param_id": "suffix"\r
+          }\r
         },\r
         "by_speech_balloon_template": {\r
-          "type": "list"\r
+          "type": "list",\r
+          "args": {\r
+            "param_id": "suffix"\r
+          }\r
         },\r
         "show": {\r
           "type": "show"\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public"\r
+            "list_name": "public",\r
+            "param_id": "none"\r
           }\r
         },\r
         "by_panel": {\r
-          "type": "list"\r
+          "type": "list",\r
+          "args": {\r
+            "param_id": "suffix"\r
+          }\r
         },\r
         "by_author": {\r
-          "type": "list"\r
+          "type": "list",\r
+          "args": {\r
+            "param_id": "suffix"\r
+          }\r
         },\r
         "show": {\r
           "type": "show"\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public"\r
+            "list_name": "public",\r
+            "param_id": "none"\r
           }\r
         },\r
         "by_panel": {\r
-          "type": "list"\r
+          "type": "list",\r
+          "args": {\r
+            "param_id": "suffix"\r
+          }\r
         },\r
         "by_author": {\r
-          "type": "list"\r
+          "type": "list",\r
+          "args": {\r
+            "param_id": "suffix"\r
+          }\r
         },\r
         "by_speech_balloon_template": {\r
-          "type": "list"\r
+          "type": "list",\r
+          "args": {\r
+            "param_id": "suffix"\r
+          }\r
         },\r
         "show": {\r
           "type": "show"\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public"\r
+            "list_name": "public",\r
+            "param_id": "none"\r
           }\r
         },\r
         "by_author": {\r
-          "type": "list"\r
+          "type": "list",\r
+          "args": {\r
+            "param_id": "suffix"\r
+          }\r
         },\r
         "show": {\r
           "type": "show"\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public"\r
+            "list_name": "public",\r
+            "param_id": "none"\r
           }\r
         },\r
         "by_author": {\r
-          "type": "list"\r
+          "type": "list",\r
+          "args": {\r
+            "param_id": "suffix"\r
+          }\r
         },\r
         "show": {\r
           "type": "show"\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public"\r
+            "list_name": "public",\r
+            "param_id": "none"\r
           }\r
         },\r
         "by_panel": {\r
-          "type": "list"\r
+          "type": "list",\r
+          "args": {\r
+            "param_id": "suffix"\r
+          }\r
         },\r
         "by_author": {\r
-          "type": "list"\r
+          "type": "list",\r
+          "args": {\r
+            "param_id": "suffix"\r
+          }\r
         },\r
         "show": {\r
           "type": "show"\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public"\r
+            "list_name": "public",\r
+            "param_id": "none"\r
           }\r
         },\r
         "by_panel": {\r
-          "type": "list"\r
+          "type": "list",\r
+          "args": {\r
+            "param_id": "suffix"\r
+          }\r
         },\r
         "by_author": {\r
-          "type": "list"\r
+          "type": "list",\r
+          "args": {\r
+            "param_id": "suffix"\r
+          }\r
         },\r
         "show": {\r
           "type": "show"\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "private"\r
+            "list_name": "private",\r
+            "param_id": "none"\r
           }\r
         },\r
         "show": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public"\r
+            "list_name": "public",\r
+            "param_id": "none"\r
           }\r
         },\r
         "by_artist": {\r
-          "type": "list"\r
+          "type": "list",\r
+          "args": {\r
+            "param_id": "suffix"\r
+          }\r
         },\r
         "show": {\r
           "type": "show"\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public"\r
+            "list_name": "public",\r
+            "param_id": "none"\r
           }\r
         },\r
         "by_license_group": {\r
-          "type": "list"\r
+          "type": "list",\r
+          "args": {\r
+            "param_id": "suffix"\r
+          }\r
         },\r
         "by_license": {\r
-          "type": "list"\r
+          "type": "list",\r
+          "args": {\r
+            "param_id": "suffix"\r
+          }\r
         },\r
         "by_artist": {\r
-          "type": "list"\r
+          "type": "list",\r
+          "args": {\r
+            "param_id": "suffix"\r
+          }\r
         },\r
         "show": {\r
           "type": "show"\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public"\r
+            "list_name": "public",\r
+            "param_id": "none"\r
           }\r
         },\r
         "by_panel": {\r
-          "type": "list"\r
+          "type": "list",\r
+          "args": {\r
+            "param_id": "suffix"\r
+          }\r
         },\r
         "show": {\r
           "type": "show"\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public"\r
+            "list_name": "public",\r
+            "param_id": "none"\r
           }\r
         },\r
         "by_system_picture": {\r
-          "type": "list"\r
+          "type": "list",\r
+          "args": {\r
+            "param_id": "suffix"\r
+          }\r
         },\r
         "show": {\r
           "type": "show"\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public"\r
+            "list_name": "public",\r
+            "param_id": "none"\r
           }\r
         },\r
         "show": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public"\r
+            "list_name": "public",\r
+            "param_id": "none"\r
           }\r
         },\r
         "by_license_group": {\r
-          "type": "list"\r
+          "type": "list",\r
+          "args": {\r
+            "param_id": "suffix"\r
+          }\r
         },\r
         "by_system_picture": {\r
-          "type": "list"\r
+          "type": "list",\r
+          "args": {\r
+            "param_id": "suffix"\r
+          }\r
         },\r
         "show": {\r
           "type": "show"\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public"\r
+            "list_name": "public",\r
+            "param_id": "none"\r
           }\r
         },\r
         "show": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public"\r
+            "list_name": "public",\r
+            "param_id": "none"\r
           }\r
         },\r
         "show": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "public"\r
+            "list_name": "public",\r
+            "param_id": "none"\r
           }\r
         },\r
         "show": {\r
           "type": "list",\r
           "args": {\r
             "item_name": "scroll",\r
-            "list_name": "private"\r
+            "list_name": "private",\r
+            "param_id": "none"\r
           }\r
         },\r
         "scroll_panels": {\r
           "type": "list",\r
           "args": {\r
             "item_name": "scroll_panel",\r
-            "list_name": "private"\r
+            "list_name": "private",\r
+            "param_id": "none"\r
           }\r
         },\r
         "comics": {\r
           "type": "list",\r
           "args": {\r
             "item_name": "comic",\r
-            "list_name": "private"\r
+            "list_name": "private",\r
+            "param_id": "none"\r
           }\r
         },\r
         "stories": {\r
           "type": "list",\r
           "args": {\r
             "item_name": "story",\r
-            "list_name": "private"\r
+            "list_name": "private",\r
+            "param_id": "none"\r
           }\r
         },\r
         "story_sheets": {\r
           "type": "list",\r
           "args": {\r
             "item_name": "story_sheet",\r
-            "list_name": "private"\r
+            "list_name": "private",\r
+            "param_id": "none"\r
           }\r
         },\r
         "sheets": {\r
           "type": "list",\r
           "args": {\r
             "item_name": "sheet",\r
-            "list_name": "private"\r
+            "list_name": "private",\r
+            "param_id": "none"\r
           }\r
         },\r
         "sheet_panels": {\r
           "type": "list",\r
           "args": {\r
             "item_name": "sheet_panel",\r
-            "list_name": "private"\r
+            "list_name": "private",\r
+            "param_id": "none"\r
           }\r
         },\r
         "panels": {\r
           "type": "list",\r
           "args": {\r
             "item_name": "panel",\r
-            "list_name": "private"\r
+            "list_name": "private",\r
+            "param_id": "none"\r
           }\r
         },\r
         "panel_pictures": {\r
           "type": "list",\r
           "args": {\r
             "item_name": "panel_picture",\r
-            "list_name": "private"\r
+            "list_name": "private",\r
+            "param_id": "none"\r
           }\r
         },\r
         "speech_balloons": {\r
           "type": "list",\r
           "args": {\r
             "item_name": "speech_balloon",\r
-            "list_name": "private"\r
+            "list_name": "private",\r
+            "param_id": "none"\r
           }\r
         },\r
         "speeches": {\r
           "type": "list",\r
           "args": {\r
             "item_name": "speech",\r
-            "list_name": "private"\r
+            "list_name": "private",\r
+            "param_id": "none"\r
           }\r
         },\r
         "balloons": {\r
           "type": "list",\r
           "args": {\r
             "item_name": "balloon",\r
-            "list_name": "private"\r
+            "list_name": "private",\r
+            "param_id": "none"\r
           }\r
         },\r
         "ground_pictures": {\r
           "type": "list",\r
           "args": {\r
             "item_name": "ground_picture",\r
-            "list_name": "private"\r
+            "list_name": "private",\r
+            "param_id": "none"\r
           }\r
         },\r
         "ground_colors": {\r
           "type": "list",\r
           "args": {\r
             "item_name": "ground_color",\r
-            "list_name": "private"\r
+            "list_name": "private",\r
+            "param_id": "none"\r
           }\r
         },\r
         "original_pictures": {\r
           "type": "list",\r
           "args": {\r
             "item_name": "original_picture",\r
-            "list_name": "private"\r
+            "list_name": "private",\r
+            "param_id": "none"\r
           }\r
         },\r
         "resource_pictures": {\r
           "type": "list",\r
           "args": {\r
             "item_name": "resource_picture",\r
-            "list_name": "private"\r
+            "list_name": "private",\r
+            "param_id": "none"\r
           }\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
       }\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