OSDN Git Service

fix filer
authoryasushiito <yas@pen-chan.jp>
Mon, 10 Feb 2014 05:03:26 +0000 (14:03 +0900)
committeryasushiito <yas@pen-chan.jp>
Mon, 10 Feb 2014 05:03:26 +0000 (14:03 +0900)
42 files changed:
app/assets/javascripts/manifest/work/controllers.js.coffee.erb
app/assets/javascripts/manifest/work/filers.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/comics_controller.rb
app/controllers/ground_colors_controller.rb
app/controllers/ground_pictures_controller.rb
app/controllers/home_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/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_controller.rb
app/controllers/system_pictures_controller.rb
app/controllers/writing_formats_controller.rb
lib/manifest/controller.rb
lib/manifest/controller/action.rb
lib/manifest/controller/action/list.rb
lib/manifest/filer/caption/default/face/face.rb
lib/manifest/list/base.rb
lib/manifest/list/filter.rb
lib/manifest/local/view/filer/body/file_body/file_item/symbol/default/face/face.rb
lib/manifest/local/view/filer/body/file_header.rb
lib/manifest/local/view/filer/body/file_header/none.rb
lib/manifest/local/view/filer/body/file_header/show.rb
lib/manifest/manifest.rb
lib/manifest/model/list/base.rb
lib/manifest/model/list/filter.rb
public/manifest.json

index 149f731..013fe6c 100644 (file)
@@ -1,6 +1,6 @@
 #マニフェスト\r
 @controllers = {\r
-  scroll: {\r
+  scrolls: {\r
     actions: {\r
       index: {\r
         type: 'list',\r
@@ -8,29 +8,11 @@
           list_name: 'public_list',\r
         },\r
       },\r
-      scroll_panels: {\r
-        type: 'list',\r
-        args: {\r
-          list_name: 'scroll_panels',\r
-        },\r
-      },\r
-      panels: {\r
-        type: 'list',\r
-        args: {\r
-          list_name: 'panels',\r
-        },\r
-      },\r
       by_author: {\r
         type: 'list',\r
-        args: {\r
-          list_name: 'by_author',\r
-        },\r
       },\r
       by_panel: {\r
         type: 'list',\r
-        args: {\r
-          list_name: 'by_panel',\r
-        },\r
       },\r
       play: {\r
         type: 'list',\r
         type: 'show',\r
         name: 'show',\r
       },\r
+      count: {\r
+        type: 'count',\r
+        args: {\r
+          list_name: 'public_list',\r
+        },\r
+      },\r
+      count_by_author: {\r
+        type: 'count',\r
+      },\r
+      count_by_panel: {\r
+        type: 'count',\r
+      },\r
     },\r
   },\r
-  scroll_panel: {\r
+  scroll_panels: {\r
     actions: {\r
       index: {\r
         type: 'list',\r
       },\r
       by_panel: {\r
         type: 'list',\r
-        args: {\r
-          list_name: 'by_panel',\r
-        },\r
       },\r
       by_scroll: {\r
         type: 'list',\r
+      },\r
+      count: {\r
+        type: 'count',\r
         args: {\r
-          list_name: 'by_scroll',\r
+          list_name: 'public_list',\r
         },\r
       },\r
+      count_by_panel: {\r
+        type: 'count',\r
+      },\r
+      count_by_scroll: {\r
+        type: 'count',\r
+      },\r
     },\r
   },\r
-  comic: {\r
+  comics: {\r
     actions: {\r
       index: {\r
         type: 'list',\r
           \r
         },\r
       },\r
-      stories: {\r
-        type: 'list',\r
-        args: {\r
-          list_name: 'stories',\r
-        },\r
-      },\r
       by_author: {\r
         type: 'list',\r
+      },\r
+      count: {\r
+        type: 'count',\r
         args: {\r
-          list_name: 'by_author',\r
+          list_name: 'public_list',\r
         },\r
       },\r
+      count_by_author: {\r
+        type: 'count',\r
+      },\r
     },\r
   },\r
-  story: {\r
+  stories: {\r
     actions: {\r
       index: {\r
         type: 'list',\r
           \r
         },\r
       },\r
-      story_sheets: {\r
-        type: 'list',\r
-        args: {\r
-          list_name: 'story_sheets',\r
-        },\r
-      },\r
-      sheets: {\r
-        type: 'list',\r
-        args: {\r
-          list_name: 'sheets',\r
-        },\r
-      },\r
       by_comic: {\r
         type: 'list',\r
-        args: {\r
-          list_name: 'by_comic',\r
-        },\r
       },\r
       by_sheet: {\r
         type: 'list',\r
-        args: {\r
-          list_name: 'by_sheet',\r
-        },\r
       },\r
       by_author: {\r
         type: 'list',\r
-        args: {\r
-          list_name: 'by_author',\r
-        },\r
       },\r
       play: {\r
         type: 'list',\r
           list_name: 'play',\r
         },\r
       },\r
+      count: {\r
+        type: 'count',\r
+        args: {\r
+          list_name: 'public_list',\r
+        },\r
+      },\r
+      by_comic: {\r
+        type: 'count',\r
+      },\r
+      by_sheet: {\r
+        type: 'count',\r
+      },\r
+      count_by_author: {\r
+        type: 'count',\r
+      },\r
     },\r
   },\r
-  story_sheet: {\r
+  story_sheets: {\r
     actions: {\r
       index: {\r
         type: 'list',\r
       },\r
       by_story: {\r
         type: 'list',\r
-        args: {\r
-          list_name: 'by_story',\r
-        },\r
       },\r
       by_sheet: {\r
         type: 'list',\r
+      },\r
+      count: {\r
+        type: 'count',\r
         args: {\r
-          list_name: 'by_sheet',\r
+          list_name: 'public_list',\r
         },\r
       },\r
+      count_by_story: {\r
+        type: 'count',\r
+      },\r
+      count_by_sheet: {\r
+        type: 'count',\r
+      },\r
     },\r
   },\r
-  sheet: {\r
+  sheets: {\r
     actions: {\r
       index: {\r
         type: 'list',\r
           \r
         },\r
       },\r
-      story_sheets: {\r
+      by_story: {\r
         type: 'list',\r
-        args: {\r
-          list_name: 'story_sheets',\r
-        },\r
       },\r
-      stories: {\r
+      by_panel: {\r
         type: 'list',\r
-        args: {\r
-          list_name: 'stories',\r
-        },\r
       },\r
-      sheet_panels: {\r
+      by_author: {\r
         type: 'list',\r
-        args: {\r
-          list_name: 'sheet_panels',\r
-        },\r
       },\r
-      panels: {\r
+      play: {\r
         type: 'list',\r
         args: {\r
-          list_name: 'panels',\r
+          list_name: 'play',\r
         },\r
       },\r
-      by_story: {\r
-        type: 'list',\r
+      count: {\r
+        type: 'count',\r
         args: {\r
-          list_name: 'by_story',\r
+          list_name: 'public_list',\r
         },\r
       },\r
-      by_panel: {\r
-        type: 'list',\r
-        args: {\r
-          list_name: 'by_panel',\r
-        },\r
+      count_by_story: {\r
+        type: 'count',\r
       },\r
-      by_author: {\r
-        type: 'list',\r
-        args: {\r
-          list_name: 'by_author',\r
-        },\r
+      count_by_panel: {\r
+        type: 'count',\r
       },\r
-      play: {\r
-        type: 'list',\r
-        args: {\r
-          list_name: 'play',\r
-        },\r
+      count_by_author: {\r
+        type: 'count',\r
       },\r
     },\r
   },\r
-  sheet_panel: {\r
+  sheet_panels: {\r
     actions: {\r
       index: {\r
         type: 'list',\r
       },\r
       by_sheet: {\r
         type: 'list',\r
-        args: {\r
-          list_name: 'by_sheet',\r
-        },\r
       },\r
       by_panel: {\r
         type: 'list',\r
+      },\r
+      count: {\r
+        type: 'count',\r
         args: {\r
-          list_name: 'by_panel',\r
+          list_name: 'public_list',\r
         },\r
       },\r
+      count_by_sheet: {\r
+        type: 'count',\r
+      },\r
+      count_by_panel: {\r
+        type: 'count',\r
+      },\r
     },\r
   },\r
-  panel: {\r
+  panels: {\r
     actions: {\r
       index: {\r
         type: 'list',\r
           \r
         },\r
       },\r
-      scroll_panels: {\r
-        type: 'list',\r
-        args: {\r
-          list_name: 'scroll_panels',\r
-        },\r
-      },\r
-      scrolls: {\r
-        type: 'list',\r
-        args: {\r
-          list_name: 'scrolls',\r
-        },\r
-      },\r
-      sheet_panels: {\r
-        type: 'list',\r
-        args: {\r
-          list_name: 'sheet_panels',\r
-        },\r
-      },\r
-      sheets: {\r
+      by_scroll: {\r
         type: 'list',\r
-        args: {\r
-          list_name: 'sheets',\r
-        },\r
       },\r
-      panel_pictures: {\r
+      by_sheet: {\r
         type: 'list',\r
-        args: {\r
-          list_name: 'panel_pictures',\r
-        },\r
       },\r
-      speech_balloons: {\r
+      by_author: {\r
         type: 'list',\r
-        args: {\r
-          list_name: 'speech_balloons',\r
-        },\r
       },\r
-      ground_pictures: {\r
+      by_speech_balloon_template: {\r
         type: 'list',\r
-        args: {\r
-          list_name: 'ground_pictures',\r
-        },\r
       },\r
-      ground_colors: {\r
-        type: 'list',\r
+      count: {\r
+        type: 'count',\r
         args: {\r
-          list_name: 'ground_colors',\r
+          list_name: 'public_list',\r
         },\r
       },\r
-      by_scroll: {\r
-        type: 'list',\r
-        args: {\r
-          list_name: 'by_scroll',\r
-        },\r
+      count_by_scroll: {\r
+        type: 'count',\r
       },\r
-      by_sheet: {\r
-        type: 'list',\r
-        args: {\r
-          list_name: 'by_sheet',\r
-        },\r
+      count_by_sheet: {\r
+        type: 'count',\r
       },\r
-      by_author: {\r
-        type: 'list',\r
-        args: {\r
-          list_name: 'by_author',\r
-        },\r
+      count_by_author: {\r
+        type: 'count',\r
       },\r
-      by_speech_balloon_template: {\r
-        type: 'list',\r
-        args: {\r
-          list_name: 'by_speech_balloon_template',\r
-        },\r
+      count_by_speech_balloon_template: {\r
+        type: 'count',\r
       },\r
     },\r
   },\r
-  panel_picture: {\r
+  panel_pictures: {\r
     actions: {\r
       index: {\r
         type: 'list',\r
       },\r
       by_panel: {\r
         type: 'list',\r
-        args: {\r
-          list_name: 'by_panel',\r
-        },\r
       },\r
       by_author: {\r
         type: 'list',\r
+      },\r
+      count: {\r
+        type: 'count',\r
         args: {\r
-          list_name: 'by_author',\r
+          list_name: 'public_list',\r
         },\r
       },\r
+      count_by_panel: {\r
+        type: 'count',\r
+      },\r
+      count_by_author: {\r
+        type: 'count',\r
+      },\r
     },\r
   },\r
-  speech_balloon: {\r
+  speech_balloons: {\r
     actions: {\r
       index: {\r
         type: 'list',\r
       },\r
       by_panel: {\r
         type: 'list',\r
-        args: {\r
-          list_name: 'by_panel',\r
-        },\r
       },\r
       by_author: {\r
         type: 'list',\r
+      },\r
+      count: {\r
+        type: 'count',\r
         args: {\r
-          list_name: 'by_author',\r
+          list_name: 'public_list',\r
         },\r
       },\r
+      count_by_panel: {\r
+        type: 'count',\r
+      },\r
+      count_by_author: {\r
+        type: 'count',\r
+      },\r
     },\r
   },\r
-  speech: {\r
+  speeches: {\r
     actions: {\r
       index: {\r
         type: 'list',\r
       },\r
       by_writing_format: {\r
         type: 'list',\r
+      },\r
+      count: {\r
+        type: 'count',\r
         args: {\r
-          list_name: 'by_writing_format',\r
+          list_name: 'public_list',\r
         },\r
       },\r
+      count_by_writing_format: {\r
+        type: 'count',\r
+      },\r
     },\r
   },\r
-  balloon: {\r
+  balloons: {\r
     actions: {\r
       index: {\r
         type: 'list',\r
       #    list_name: 'by_system_picture',\r
       #  },\r
       #},\r
+      count: {\r
+        type: 'count',\r
+        args: {\r
+          list_name: 'public_list',\r
+        },\r
+      },\r
     },\r
   },\r
-  ground_picture: {\r
+  ground_pictures: {\r
     actions: {\r
       index: {\r
         type: 'list',\r
       },\r
       by_panel: {\r
         type: 'list',\r
-        args: {\r
-          list_name: 'by_panel',\r
-        },\r
       },\r
       by_author: {\r
         type: 'list',\r
+      },\r
+      count: {\r
+        type: 'count',\r
         args: {\r
-          list_name: 'by_author',\r
+          list_name: 'public_list',\r
         },\r
       },\r
+      count_by_panel: {\r
+        type: 'count',\r
+      },\r
+      count_by_author: {\r
+        type: 'count',\r
+      },\r
     },\r
   },\r
-  ground_color: {\r
+  ground_colors: {\r
     actions: {\r
       index: {\r
         type: 'list',\r
       },\r
       by_panel: {\r
         type: 'list',\r
-        args: {\r
-          list_name: 'by_panel',\r
-        },\r
       },\r
       by_author: {\r
         type: 'list',\r
+      },\r
+      count: {\r
+        type: 'count',\r
         args: {\r
-          list_name: 'by_author',\r
+          list_name: 'public_list',\r
         },\r
       },\r
+      count_by_panel: {\r
+        type: 'count',\r
+      },\r
+      count_by_author: {\r
+        type: 'count',\r
+      },\r
     },\r
   },\r
-  original_picture: {\r
+  original_pictures: {\r
     actions: {\r
       index: {\r
         type: 'list',\r
           \r
         },\r
       },\r
+      count: {\r
+        type: 'count',\r
+        args: {\r
+          list_name: 'public_list',\r
+        },\r
+      },\r
     },\r
   },\r
-  picture: {\r
+  pictures: {\r
   },\r
-  resource_picture: {\r
+  resource_pictures: {\r
     actions: {\r
       index: {\r
         type: 'list',\r
       },\r
       by_license: {\r
         type: 'list',\r
-        args: {\r
-          list_name: 'by_license',\r
-        },\r
       },\r
       by_artist: {\r
         type: 'list',\r
+      },\r
+      count: {\r
+        type: 'count',\r
         args: {\r
-          list_name: 'by_artist',\r
+          list_name: 'public_list',\r
         },\r
       },\r
+      count_by_license: {\r
+        type: 'count',\r
+      },\r
+      count_by_artist: {\r
+        type: 'count',\r
+      },\r
     },\r
   },\r
-  speech_balloon_template: {\r
+  speech_balloon_templates: {\r
     actions: {\r
       index: {\r
         type: 'list',\r
           \r
         },\r
       },\r
-      speech_balloons: {\r
-        type: 'list',\r
+      count: {\r
+        type: 'count',\r
         args: {\r
-          list_name: 'speech_balloons',\r
-        },\r
-      },\r
-      panels: {\r
-        type: 'list',\r
-        args: {\r
-          list_name: 'panels',\r
+          list_name: 'public_list',\r
         },\r
       },\r
     },\r
   },\r
-  writing_format: {\r
+  writing_formats: {\r
     actions: {\r
       index: {\r
         type: 'list',\r
           \r
         },\r
       },\r
-      speeches: {\r
-        type: 'list',\r
-        args: {\r
-          list_name: 'speeches',\r
-        },\r
-      },\r
       by_system_picture: {\r
         type: 'list',\r
+      },\r
+      count: {\r
+        type: 'count',\r
         args: {\r
-          list_name: 'by_system_picture',\r
+          list_name: 'public_list',\r
         },\r
       },\r
+      count_by_system_picture: {\r
+        type: 'count',\r
+      },\r
     },\r
   },\r
-  license_group: {\r
+  license_groups: {\r
     actions: {\r
       index: {\r
         type: 'list',\r
           \r
         },\r
       },\r
-      licenses: {\r
-        type: 'list',\r
+      count: {\r
+        type: 'count',\r
         args: {\r
-          list_name: 'licenses',\r
+          list_name: 'public_list',\r
         },\r
       },\r
     },\r
   },\r
-  license: {\r
+  licenses: {\r
     actions: {\r
       index: {\r
         type: 'list',\r
           \r
         },\r
       },\r
-      resource_pictures: {\r
-        type: 'list',\r
-        args: {\r
-          list_name: 'resource_pictures',\r
-        },\r
-      },\r
       by_license_group: {\r
         type: 'list',\r
-        args: {\r
-          list_name: 'by_license_group',\r
-        },\r
       },\r
       by_system_picture: {\r
         type: 'list',\r
+      },\r
+      count: {\r
+        type: 'count',\r
         args: {\r
-          list_name: 'by_system_picture',\r
+          list_name: 'public_list',\r
         },\r
       },\r
+      count_by_license_group: {\r
+        type: 'count',\r
+      },\r
+      count_by_system_picture: {\r
+        type: 'count',\r
+      },\r
     },\r
   },\r
-  author: {\r
+  authors: {\r
     actions: {\r
       index: {\r
         type: 'list',\r
           list_name: 'ground_colors',\r
         },\r
       },\r
+      count: {\r
+        type: 'count',\r
+        args: {\r
+          list_name: 'public_list',\r
+        },\r
+      },\r
     },\r
   },\r
-  artist: {\r
+  artists: {\r
     actions: {\r
       index: {\r
         type: 'list',\r
           list_name: 'resource_pictures',\r
         },\r
       },\r
+      count: {\r
+        type: 'count',\r
+        args: {\r
+          list_name: 'public_list',\r
+        },\r
+      },\r
     },\r
   },\r
-  system_picture: {\r
+  system_pictures: {\r
     actions: {\r
       index: {\r
         type: 'list',\r
           \r
         },\r
       },\r
+      count: {\r
+        type: 'count',\r
+        args: {\r
+          list_name: 'public_list',\r
+        },\r
+      },\r
     },\r
   },\r
   home: {\r
     actions: {\r
       scrolls: {\r
-        item_name: 'scroll',\r
         type: 'list',\r
         args: {\r
+          item_name: 'scroll',\r
           list_name: 'private_list',\r
           \r
         },\r
       },\r
       scroll_panels: {\r
-        item_name: 'scroll_panel',\r
         type: 'list',\r
         args: {\r
+          item_name: 'scroll_panel',\r
           list_name: 'private_list',\r
           \r
         },\r
       },\r
       comics: {\r
-        item_name: 'comic',\r
         type: 'list',\r
         args: {\r
+          item_name: 'comic',\r
           list_name: 'private_list',\r
           \r
         },\r
       },\r
       stories: {\r
-        item_name: 'story',\r
         type: 'list',\r
         args: {\r
+          item_name: 'story',\r
           list_name: 'private_list',\r
           \r
         },\r
       },\r
       story_sheets: {\r
-        item_name: 'story_sheet',\r
         type: 'list',\r
         args: {\r
+          item_name: 'story_sheet',\r
           list_name: 'private_list',\r
           \r
         },\r
       },\r
       sheets: {\r
-        item_name: 'sheet',\r
         type: 'list',\r
         args: {\r
+          item_name: 'sheet',\r
           list_name: 'private_list',\r
           \r
         },\r
       },\r
       sheet_panels: {\r
-        item_name: 'sheet_panel',\r
         type: 'list',\r
         args: {\r
+          item_name: 'sheet_panel',\r
           list_name: 'private_list',\r
           \r
         },\r
       },\r
       panels: {\r
-        item_name: 'panel',\r
         type: 'list',\r
         args: {\r
+          item_name: 'panel',\r
           list_name: 'private_list',\r
           \r
         },\r
       },\r
       panel_pictures: {\r
-        item_name: 'panel_picture',\r
         type: 'list',\r
         args: {\r
+          item_name: 'panel_picture',\r
           list_name: 'private_list',\r
           \r
         },\r
       },\r
       speech_balloons: {\r
-        item_name: 'speech_balloon',\r
         type: 'list',\r
         args: {\r
+          item_name: 'speech_balloon',\r
           list_name: 'private_list',\r
           \r
         },\r
       },\r
       speeches: {\r
-        item_name: 'speech',\r
         type: 'list',\r
         args: {\r
+          item_name: 'speech',\r
           list_name: 'private_list',\r
           \r
         },\r
       },\r
       balloons: {\r
-        item_name: 'balloon',\r
         type: 'list',\r
         args: {\r
+          item_name: 'balloon',\r
           list_name: 'private_list',\r
           \r
         },\r
       },\r
       ground_pictures: {\r
-        item_name: 'ground_picture',\r
         type: 'list',\r
         args: {\r
+          item_name: 'ground_picture',\r
           list_name: 'private_list',\r
           \r
         },\r
       },\r
       ground_colors: {\r
-        item_name: 'ground_color',\r
         type: 'list',\r
         args: {\r
+          item_name: 'ground_color',\r
           list_name: 'private_list',\r
           \r
         },\r
       },\r
       original_pictures: {\r
-        item_name: 'original_picture',\r
         type: 'list',\r
         args: {\r
+          item_name: 'original_picture',\r
           list_name: 'private_list',\r
           \r
         },\r
       },\r
       resource_pictures: {\r
-        item_name: 'resource_picture',\r
         type: 'list',\r
         args: {\r
+          item_name: 'resource_picture',\r
           list_name: 'private_list',\r
           \r
         },\r
index 860a10a..28fb5cc 100644 (file)
         link: {\r
           type: 'action',\r
           args: {\r
-            action_nname: 'history',\r
+            action_name: 'history',\r
           },\r
         },\r
       },\r
index 31a2eb6..48481d6 100644 (file)
@@ -108,18 +108,22 @@ class ApplicationController < ActionController::Base
     Manifest.manifest.profiler_managers[self.model.item_name]
   end
   
-  def public_list 
-    my_controller = Manifest.manifest.controllers[self.class.model.item_name]
+  def set_list
+    my_controller = Manifest.manifest.controllers[params[:controller].to_s]
     my_action = my_controller.actions[params[:action].to_s]
     my_model = Manifest.manifest.models[my_action.item_name]
     my_model_list = my_model.lists[my_action.list_name]
     my_list = Manifest.manifest.lists[my_action.item_name]
-    list = my_list[my_action.list_name]
-    list_result = list.open(@operators, {:id => params})
+    @list = my_list[my_action.list_name]
+  end
+  
+  def filer_list
+    set_list
+    list_result = @list.open(@operators, {:id => params[:id]})
     @items = list_result.items 
     respond_to do |format|
       format.html {
-        @filer = Manifest::View::Filer.new my_action.item_name, list_result.items, list_result.paginate, @operators
+        @filer = Manifest::View::Filer.new @list.item_name, list_result.items, list_result.paginate, @operators
         render @filer.template_name, :locals => {
           :filer => @filer
         }
@@ -130,59 +134,11 @@ class ApplicationController < ActionController::Base
     end
   end
   
-  def my_list params
-    controller_name = params[:controller]
-    action_name = params[:action]
-    controller = Manifest.manifest.controller_managers[controller_name]
-    @action = controller.open(action_name, params, @operators)
-    @items = @action.items 
-
-    respond_to do |format|
-      format.html {
-        @filer = @action.filer
-        render :template => 'system/filer', :locals => {
-          :filer => @filer
-        }
-      }
-      format.json { render json: @items.to_json(self.class.model.list_json_opt) }
-    end
-  end
-  
-  def has_many_list 
-    @parent_item = self.class.model.show(params[:id], @operators)
-    controller_name = self.class.model.item_name
-    action_name = params[:action]
-    controller = Manifest.manifest.controller_managers[controller_name]
-    @action = controller.open(action_name, params, @operators)
-    many_name = @action.list.association_model_name
-    @items = @action.list.items @parent_item
-    respond_to do |format|
-      format.html {
-        @filer =  Manifest.manifest.filer_managers[many_name].open(many_name, @items, @operators, @action.list.paginate(@parent_item))
-        render @filer.template_name, :locals => {
-          :filer => @filer
-        }
-      }
-      format.json { render json: @items.to_json(self.class.model.list_json_opt) }
-    end
-  end
-  
-  def filter_list
-    controller_name = self.class.model.item_name
-    action_name = params[:action]
-    controller = Manifest.manifest.controller_managers[controller_name]
-    @action = controller.open(action_name, params, @operators)
-    @filter_item = @action.list.from_model.show(params[:id], @operators)
-    item_model_name = @action.list.item_name
-    @items = @action.list.items @filter_item
+  def list_count
+    set_list
+    j = {:count => @list.count(@operators, {:id => params[:id]})}
     respond_to do |format|
-      format.html {
-        @filer =  Manifest.manifest.filer_managers[item_model_name].open(item_model_name, @items, @operators, @action.list.paginate(@filter_item))
-        render :template => 'system/filer', :locals => {
-          :filer => @filer
-        }
-      }
-      format.json { render json: @items.to_json(self.class.model.list_json_opt) }
+      format.json { render json: j.to_json }
     end
   end
   
index 3f980c1..a5fe524 100644 (file)
@@ -13,11 +13,7 @@ class ArtistsController < ApplicationController
   end
   
   def index
-    public_list
-  end
-
-  def resource_pictures
-    has_many_list
+    filer_list
   end
   
   def show
@@ -33,10 +29,7 @@ class ArtistsController < ApplicationController
   end
 
   def count
-    @artist = {:count => Artist.visible_count}
-    respond_to do |format|
-      format.json { render json: @artist.to_json }
-    end
+    list_count
   end
   
   def new
index f25eba1..dfa8feb 100644 (file)
@@ -3,7 +3,7 @@ class AuthorsController < ApplicationController
     before_filter :authenticate_user, :only => [:new, :create, :edit, :update]
     before_filter :authenticate_author, :only => [:edit, :update]
   else
-    before_filter :authenticate_reader, :only => [:index, :show, :scrolls, :scroll_panels, :comics, :stories, :story_sheets, :sheets, :sheet_panels, :panels, :panel_pictures, :speech_balloons, :ground_pictures, :ground_colors]
+    before_filter :authenticate_reader, :only => [:index, :show, :count]
     before_filter :authenticate_user, :only => [:new, :create, :edit, :update]
     before_filter :authenticate_author, :only => [:edit, :update]
   end
@@ -13,55 +13,7 @@ class AuthorsController < ApplicationController
   end
   
   def index
-    public_list
-  end
-  
-  def scrolls
-    has_many_list
-  end
-  
-  def scroll_panels
-    has_many_list
-  end
-  
-  def comics
-    has_many_list
-  end
-  
-  def stories
-    has_many_list
-  end
-  
-  def story_sheets
-    has_many_list
-  end
-  
-  def sheets
-    has_many_list
-  end
-  
-  def sheet_panels
-    has_many_list
-  end
-  
-  def panels
-    has_many_list
-  end
-  
-  def panel_pictures
-    has_many_list
-  end
-  
-  def speech_balloons
-    has_many_list
-  end
-  
-  def ground_pictures
-    has_many_list
-  end
-  
-  def ground_colors
-    has_many_list
+    filer_list
   end
   
   def show
@@ -75,12 +27,9 @@ class AuthorsController < ApplicationController
       format.json { render :json => @item.to_json(Author.show_json_opt) }
     end
   end
-
+  
   def count
-    @au = {:count => Author.visible_count}
-    respond_to do |format|
-      format.json { render json: @au.to_json }
-    end
+    list_count
   end
   
   def new
index 556baa1..e784738 100644 (file)
@@ -3,7 +3,9 @@ class BalloonsController < ApplicationController
     before_filter :authenticate_user, :only => []
     before_filter :authenticate_author, :only => []
   else
-    before_filter :authenticate_reader, :only => [:index, :show, :by_speech_balloon]
+    before_filter :authenticate_reader, :only => [
+      :index, :show, :by_speech_balloon, :count, :count_by_speech_balloon
+    ]
     before_filter :authenticate_user, :only => []
     before_filter :authenticate_author, :only => []
   end
@@ -14,11 +16,11 @@ class BalloonsController < ApplicationController
   end
   
   def index
-    public_list
+    filer_list
   end
   
   def by_speech_balloon
-    has_one_list
+    filer_list
   end
   
   def show
@@ -32,22 +34,12 @@ class BalloonsController < ApplicationController
     end
   end
   
-  def list
-    @balloons = Balloon.all
-
-    respond_to do |format|
-      format.html { render layout: 'system' }
-      format.json { render json: @balloons }
-    end
+  def count
+    list_count
   end
-
-  def browse
-    @balloon = Balloon.find(params[:id])
-
-    respond_to do |format|
-      format.html { render layout: 'system' }
-      format.json { render json: @balloon }
-    end
+  
+  def count_by_speech_balloon
+    list_count
   end
-
+  
 end
index 42c7a9a..316f0dd 100644 (file)
@@ -3,7 +3,7 @@ class ComicsController < ApplicationController
     before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
     before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
   else
-    before_filter :authenticate_reader, :only => [:top, :index, :show, :stories, :by_author]
+    before_filter :authenticate_reader, :only => [:index, :show, :by_author, :count, :count_by_author]
     before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
     before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
   end
@@ -13,15 +13,11 @@ class ComicsController < ApplicationController
   end
   
   def index
-    public_list
-  end
-
-  def stories
-    has_many_list
+    filer_list
   end
 
   def by_author
-    filter_list
+    filer_list
   end
 
   def show
@@ -37,10 +33,11 @@ class ComicsController < ApplicationController
   end
 
   def count
-    @comic = {:count => Comic.visible_count}
-    respond_to do |format|
-      format.json { render json: @comic.to_json }
-    end
+    list_count
+  end
+  
+  def count_by_author
+    list_count
   end
   
   def new
index 5917c15..8e0a1fa 100644 (file)
@@ -3,7 +3,9 @@ class GroundColorsController < ApplicationController
     before_filter :authenticate_user, :only => [:new, :edit, :create, :update, :destroy]
     before_filter :authenticate_author, :only => [:new, :edit, :create, :update, :destroy]
   else
-    before_filter :authenticate_reader, :only => [:index, :show, :by_panel, :by_author]
+    before_filter :authenticate_reader, :only => [
+      :index, :show, :by_panel, :by_author, :count, :count_by_panel, :count_by_author
+    ]
     before_filter :authenticate_user, :only => [:new, :edit, :create, :update, :destroy]
     before_filter :authenticate_author, :only => [:new, :edit, :create, :update, :destroy]
   end
@@ -13,15 +15,15 @@ class GroundColorsController < ApplicationController
   end
   
   def index
-    public_list
+    filer_list
   end
   
   def by_panel
-    filter_list
+    filer_list
   end
   
   def by_author
-    filter_list
+    filer_list
   end
   
   def show
@@ -35,6 +37,18 @@ class GroundColorsController < ApplicationController
     end
   end
   
+  def count
+    list_count
+  end
+  
+  def count_by_panel
+    list_count
+  end
+  
+  def count_by_author
+    list_count
+  end
+  
   def new
     raise Pettanr::NotWork unless @operators.author.working_panel
     @panel = Panel.edit(@operators.author.working_panel, @operators)
index 7775cb9..515b0c0 100644 (file)
@@ -3,7 +3,9 @@ class GroundPicturesController < ApplicationController
     before_filter :authenticate_user, :only => [:new, :edit, :create, :update, :destroy]
     before_filter :authenticate_author, :only => [:new, :edit, :create, :update, :destroy]
   else
-    before_filter :authenticate_reader, :only => [:index, :show, :by_panel, :by_author]
+    before_filter :authenticate_reader, :only => [
+      :index, :show, :by_panel, :by_author, :count, :count_by_panel, :count_by_author
+    ]
     before_filter :authenticate_user, :only => [:new, :edit, :create, :update, :destroy]
     before_filter :authenticate_author, :only => [:new, :edit, :create, :update, :destroy]
   end
@@ -13,15 +15,15 @@ class GroundPicturesController < ApplicationController
   end
   
   def index
-    public_list
+    filer_list
   end
   
   def by_panel
-    filter_list
+    filer_list
   end
   
   def by_author
-    filter_list
+    filer_list
   end
   
   def show
@@ -35,6 +37,18 @@ class GroundPicturesController < ApplicationController
     end
   end
   
+  def count
+    list_count
+  end
+  
+  def count_by_panel
+    list_count
+  end
+  
+  def count_by_author
+    list_count
+  end
+  
   def new
     raise Pettanr::NotWork unless @operators.author.working_panel
     @picture = Picture.show params[:picture_id], @operators
index 293ed5d..5457786 100644 (file)
@@ -3,7 +3,9 @@ class HomeController < ApplicationController
     :index, :show, :profile, :configure, :create_token, :delete_token, 
     :scrolls, :scroll_panels, :comics, :stories, :story_sheets, :sheets, :sheet_panels, :panels, :resource_pictures, :panel_pictures, :speech_balloons, :ground_pictures, :ground_colors
   ]
-  before_filter :authenticate_author, :only => [:scrolls, :scroll_panels, :comics, :stories, :story_sheets, :sheets, :sheet_panels, :panels, :panel_pictures, :speech_balloons, :ground_pictures, :ground_colors]
+  before_filter :authenticate_author, :only => [
+    :scrolls, :scroll_panels, :comics, :stories, :story_sheets, :sheets, :sheet_panels, :panels, :panel_pictures, :speech_balloons, :ground_pictures, :ground_colors
+  ]
   before_filter :authenticate_artist, :only => [:resource_pictures]
   
   def index
@@ -40,55 +42,55 @@ class HomeController < ApplicationController
   end
   
   def scrolls
-    my_list params
+    filer_list
   end
   
   def scroll_panels
-    my_list params
+    filer_list
   end
   
   def comics
-    my_list params
+    filer_list
   end
   
   def stories
-    my_list params
+    filer_list
   end
   
   def story_sheets
-    my_list params
+    filer_list
   end
   
   def sheets
-    my_list params
+    filer_list
   end
   
   def sheet_panels
-    my_list params
+    filer_list
   end
   
   def panels
-    my_list params
+    filer_list
   end
   
   def panel_pictures
-    my_list params
+    filer_list
   end
   
   def speech_balloons
-    my_list params
+    filer_list
   end
   
   def ground_pictures
-    my_list params
+    filer_list
   end
   
   def ground_colors
-    my_list params
+    filer_list
   end
   
   def resource_pictures
-    my_list params
+    filer_list
   end
   
 end
index af36fd5..1f0c0f8 100644 (file)
@@ -1,16 +1,12 @@
 class LicenseGroupsController < ApplicationController
-  before_filter :authenticate_admin!, :only => [:list, :browse]
+  before_filter :authenticate_admin!, :only => []
   
   def self.model
     LicenseGroup
   end
   
   def index
-    public_list
-  end
-  
-  def licenses
-    has_many_list
+    filer_list
   end
   
   def show
@@ -23,20 +19,9 @@ class LicenseGroupsController < ApplicationController
       format.json { render json: @item.to_json(LicenseGroup.show_json_opt) }
     end
   end
-
-  def list
-    @license_groups = LicenseGroup.all
-
-    respond_to do |format|
-      format.html { render layout: 'system' }
-    end
-  end
-
-  def browse
-    @license_group = LicenseGroup.find(params[:id])
-
-    respond_to do |format|
-      format.html { render layout: 'system' }
-    end
+  
+  def count
+    list_count
   end
+  
 end
index 4ba997a..d5376de 100644 (file)
@@ -1,24 +1,22 @@
 class LicensesController < ApplicationController
-  before_filter :authenticate_resource_reader, :only => [:resource_pictures, :by_license_group, :by_system_picture]
+  before_filter :authenticate_resource_reader, :only => [
+    :by_license_group, :by_system_picture, :count_by_license_group, :count_by_system_picture
+  ]
 
   def self.model
     License
   end
   
   def index
-    public_list
-  end
-  
-  def resource_pictures
-    has_many_list
+    filer_list
   end
   
   def by_license_group
-    filter_list
+    filer_list
   end
   
   def by_system_picture
-    filter_list
+    filer_list
   end
   
   def show
@@ -41,4 +39,16 @@ class LicensesController < ApplicationController
     end
   end
   
+  def count
+    list_count
+  end
+  
+  def count_by_license_group
+    list_count
+  end
+  
+  def count_by_system_picture
+    list_count
+  end
+  
 end
index 9a7884f..7bf19cc 100644 (file)
@@ -1,6 +1,6 @@
 #原画
 class OriginalPicturesController < ApplicationController
-  before_filter :authenticate_reader, :only => [:show, :history]
+  before_filter :authenticate_reader, :only => [:show, :history, :count]
   before_filter :authenticate_user, :only => [:index, :new, :edit, :create, :update, :destroy]
   before_filter :authenticate_artist, :only => [:index, :new, :edit, :create, :update, :destroy]
   
@@ -9,7 +9,7 @@ class OriginalPicturesController < ApplicationController
   end
   
   def index
-    public_list
+    filer_list
   end
 
   def show
@@ -41,6 +41,10 @@ class OriginalPicturesController < ApplicationController
     end
   end
   
+  def count
+    list_count
+  end
+  
   def new
     @original_picture = OriginalPicture.new
     @original_picture.supply_default
index 6af49e4..180bed5 100644 (file)
@@ -3,7 +3,9 @@ class PanelPicturesController < ApplicationController
     before_filter :authenticate_user, :only => [:new, :edit, :create, :update, :destroy]
     before_filter :authenticate_author, :only => [:new, :edit, :create, :update, :destroy]
   else
-    before_filter :authenticate_reader, :only => [:index, :show, :by_panel, :by_author]
+    before_filter :authenticate_reader, :only => [
+      :index, :show, :by_panel, :by_author, :count, :count_by_panel, :count_by_author
+    ]
     before_filter :authenticate_user, :only => [:new, :edit, :create, :update, :destroy]
     before_filter :authenticate_author, :only => [:new, :edit, :create, :update, :destroy]
   end
@@ -13,15 +15,15 @@ class PanelPicturesController < ApplicationController
   end
   
   def index
-    public_list
+    filer_list
   end
   
   def by_panel
-    filter_list
+    filer_list
   end
   
   def by_author
-    filter_list
+    filer_list
   end
   
   def show
@@ -36,6 +38,18 @@ class PanelPicturesController < ApplicationController
     end
   end
 
+  def count
+    list_count
+  end
+  
+  def count_by_panel
+    list_count
+  end
+  
+  def count_by_author
+    list_count
+  end
+  
   def new
     raise Pettanr::NotWork unless @operators.author.working_panel
     @picture = Picture.show params[:picture_id], @operators
index 3b21bb2..8385310 100644 (file)
@@ -3,7 +3,9 @@ class PanelsController < ApplicationController
     before_filter :authenticate_user, :only => [:new, :edit, :create, :update, :destroy, :catch]
     before_filter :authenticate_author, :only => [:new, :edit, :create, :update, :destroy, :catch]
   else
-    before_filter :authenticate_reader, :only => [:index, :show, :scroll_panels, :scrolls, :sheet_panels, :sheets, :panel_pictures, :speech_balloons, :ground_pictures, :ground_colors, :by_scroll, :by_sheet, :by_author]
+    before_filter :authenticate_reader, :only => [
+      :index, :show, :by_scroll, :by_sheet, :by_author, :count, :count_by_scroll, :count_by_sheet, :count_by_author
+    ]
     before_filter :authenticate_user, :only => [:new, :edit, :create, :update, :destroy, :catch]
     before_filter :authenticate_author, :only => [:new, :edit, :create, :update, :destroy, :catch]
   end
@@ -13,54 +15,21 @@ class PanelsController < ApplicationController
   end
   
   def index
-    public_list
-  end
-  
-  def scroll_panels
-    has_many_list
-  end
-  
-  def scrolls
-    has_many_list
-  end
-  
-  def sheet_panels
-    has_many_list
-  end
-  
-  def sheets
-    has_many_list
-  end
-  
-  def panel_pictures
-    has_many_list
-  end
-  
-  def speech_balloons
-    has_many_list
-  end
-  
-  def ground_pictures
-    has_many_list
-  end
-  
-  def ground_colors
-    has_many_list
+    filer_list
   end
   
   def by_scroll
-    filter_list
+    filer_list
   end
   
   def by_sheet
-    filter_list
+    filer_list
   end
   
   def by_author
-    filter_list
+    filer_list
   end
   
-  
   def show
     @item = Panel.show(params[:id], @operators)
 
@@ -85,10 +54,19 @@ class PanelsController < ApplicationController
   end
 
   def count
-    @panel = {:count => Panel.visible_count}
-    respond_to do |format|
-      format.json { render json: @panel.to_json }
-    end
+    list_count
+  end
+  
+  def count_by_scroll
+    list_count
+  end
+  
+  def count_by_sheet
+    list_count
+  end
+  
+  def count_by_author
+    list_count
   end
   
   def new
index 7c22c2b..da074af 100644 (file)
@@ -3,7 +3,9 @@ class ResourcePicturesController < ApplicationController
     before_filter :authenticate_user, :only => [:new, :create, :update, :destroy]
     before_filter :authenticate_artist, :only => [:new, :create, :update, :destroy]
   else
-    before_filter :authenticate_resource_reader, :only => [:index, :show, :credit, :by_license, :by_artist]
+    before_filter :authenticate_resource_reader, :only => [
+      :index, :show, :credit, :by_license, :by_artist, :count, :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
@@ -13,15 +15,15 @@ class ResourcePicturesController < ApplicationController
   end
   
   def index
-    public_list
+    filer_list
   end
   
   def by_license
-    filter_list
+    filer_list
   end
   
   def by_artist
-    filter_list
+    filer_list
   end
   
   def show
@@ -49,6 +51,18 @@ class ResourcePicturesController < ApplicationController
     end
   end
   
+  def count
+    list_count
+  end
+  
+  def count_by_license
+    list_count
+  end
+  
+  def count_by_artist
+    list_count
+  end
+  
   def new
     @original_picture = OriginalPicture.edit params[:original_picture_id], @operators
     @imager = PettanImager.load @original_picture.restore
index 5c61a55..a785287 100644 (file)
@@ -3,7 +3,9 @@ class ScrollPanelsController < ApplicationController
     before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
     before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
   else
-    before_filter :authenticate_reader, :only => [:index, :show, :by_panel, :by_scroll]
+    before_filter :authenticate_reader, :only => [
+      :index, :show, :by_panel, :by_scroll, :count, :count_by_panel, :count_by_scroll
+    ]
     before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
     before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
   end
@@ -13,15 +15,15 @@ class ScrollPanelsController < ApplicationController
   end
   
   def index
-    public_list
+    filer_list
   end
   
   def by_panel
-    filter_list
+    filer_list
   end
   
   def by_scroll
-    filter_list
+    filer_list
   end
   
   def show
@@ -33,6 +35,18 @@ class ScrollPanelsController < ApplicationController
     end
   end
   
+  def count
+    list_count
+  end
+  
+  def count_by_panel
+    list_count
+  end
+  
+  def count_by_scroll
+    list_count
+  end
+  
   def new
     @scroll_panel = ScrollPanel.new 
     @scroll_panel.supply_default
index 6bffe7d..8e271c5 100644 (file)
@@ -13,15 +13,15 @@ class ScrollsController < ApplicationController
   end
   
   def index
-    public_list
+    filer_list
   end
   
   def by_author
-    filter_list
+    filer_list
   end
   
   def by_panel
-    filter_list
+    filer_list
   end
   
   def show
@@ -61,26 +61,15 @@ class ScrollsController < ApplicationController
   end
   
   def count
-    @scroll = {:count => Scroll.visible_count}
-    respond_to do |format|
-      format.json { render json: @scroll.to_json }
-    end
-  end
-  
-  def scroll_panels_count
-    has_many_list
-  end
-  
-  def panels_count
-    has_many_list
+    list_count
   end
   
   def count_by_author
-    filter_list
+    list_count
   end
   
   def count_by_panel
-    filter_list
+    list_count
   end
   
   def new
index 218fc82..b3296ee 100644 (file)
@@ -3,7 +3,9 @@ class SheetPanelsController < ApplicationController
     before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
     before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
   else
-    before_filter :authenticate_reader, :only => [:index, :show, :by_sheet, :by_panel]
+    before_filter :authenticate_reader, :only => [
+      :index, :show, :by_sheet, :by_panel, :count, :count_by_sheet, :count_by_panel
+    ]
     before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
     before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
   end
@@ -13,15 +15,15 @@ class SheetPanelsController < ApplicationController
   end
   
   def index
-    public_list
+    filer_list
   end
   
   def by_sheet
-    filter_list
+    filer_list
   end
   
   def by_panel
-    filter_list
+    filer_list
   end
   
   def show
@@ -33,6 +35,18 @@ class SheetPanelsController < ApplicationController
     end
   end
   
+  def count
+    list_count
+  end
+  
+  def count_by_sheet
+    list_count
+  end
+  
+  def count_by_panel
+    list_count
+  end
+  
   def new
     @sheet_panel = SheetPanel.new 
     @sheet_panel.supply_default
index 297f17e..6b621a6 100644 (file)
@@ -3,7 +3,9 @@ class SheetsController < ApplicationController
     before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
     before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
   else
-    before_filter :authenticate_reader, :only => [:index, :show, :play, :story_sheets, :stories, :sheet_panels, :panels, :by_story, :by_panel, :by_author]
+    before_filter :authenticate_reader, :only => [
+      :index, :show, :play, :by_story, :by_panel, :by_author, :count, :count_by_story, :count_by_panel, :count_by_author
+    ]
     before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
     before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
   end
@@ -13,35 +15,19 @@ class SheetsController < ApplicationController
   end
   
   def index
-    public_list
-  end
-  
-  def story_sheets
-    has_many_list
-  end
-  
-  def stories
-    has_many_list
-  end
-  
-  def sheet_panels
-    has_many_list
-  end
-  
-  def panels
-    has_many_list
+    filer_list
   end
   
   def by_story
-    filter_list
+    filer_list
   end
   
   def by_panel
-    filter_list
+    filer_list
   end
   
   def by_author
-    filter_list
+    filer_list
   end
   
   def show
@@ -86,10 +72,19 @@ class SheetsController < ApplicationController
   end
   
   def count
-    @sheet = {:count => Sheet.visible_count}
-    respond_to do |format|
-      format.json { render json: @sheet.to_json }
-    end
+    list_count
+  end
+  
+  def count_by_story
+    list_count
+  end
+  
+  def count_by_panel
+    list_count
+  end
+  
+  def count_by_author
+    list_count
   end
   
   def new
index 4b4fe8a..1e3b1c9 100644 (file)
@@ -2,29 +2,23 @@ class SpeechBalloonTemplatesController < ApplicationController
   if Manifest.manifest.magic_numbers['run_mode'] == 0
     before_filter :authenticate_user, :only => []
   else
-    before_filter :authenticate_reader, :only => [:index, :show, :speech_balloons, :panels, :by_system_picture]
+    before_filter :authenticate_reader, :only => [
+      :index, :show, :by_system_picture, :count, :count_by_system_picture
+    ]
     before_filter :authenticate_user, :only => []
   end
-  before_filter :authenticate_admin!, :only => [:list, :browse, :destroy]
+  before_filter :authenticate_admin!, :only => [:destroy]
 
   def self.model
     SpeechBalloonTemplate
   end
   
   def index
-    public_list
-  end
-  
-  def speech_balloons
-    has_many_list
-  end
-  
-  def panels
-    has_many_list
+    filer_list
   end
   
   def by_system_picture
-    filter_list
+    filer_list
   end
   
   def show
@@ -40,25 +34,15 @@ class SpeechBalloonTemplatesController < ApplicationController
       }
     end
   end
-
-  def list
-    @speech_balloon_templates = SpeechBalloonTemplate.all
-
-    respond_to do |format|
-      format.html { render layout: 'system' }
-      format.json { render json: @speech_balloon_templates }
-    end
+  
+  def count
+    list_count
   end
-
-  def browse
-    @speech_balloon_template = SpeechBalloonTemplate.find(params[:id])
-
-    respond_to do |format|
-      format.html { render layout: 'system' }
-      format.json { render json: @speech_balloon_template }
-    end
+  
+  def count_by_system_picture
+    list_count
   end
-
+  
   def destroy
     @speech_balloon_template = SpeechBalloonTemplate.find(params[:id])
     @speech_balloon_template.destroy
index ed47f97..0203309 100644 (file)
@@ -3,7 +3,9 @@ class SpeechBalloonsController < ApplicationController
     before_filter :authenticate_user, :only => [:new, :edit, :create, :update, :destroy]
     before_filter :authenticate_author, :only => [:new, :edit, :create, :update, :destroy]
   else
-    before_filter :authenticate_reader, :only => [:index, :show, :by_panel, :by_author]
+    before_filter :authenticate_reader, :only => [
+      :index, :show, :by_panel, :by_author, :count, :count_by_panel, :count_by_author
+    ]
     before_filter :authenticate_user, :only => [:new, :edit, :create, :update, :destroy]
     before_filter :authenticate_author, :only => [:new, :edit, :create, :update, :destroy]
   end
@@ -13,15 +15,15 @@ class SpeechBalloonsController < ApplicationController
   end
   
   def index
-    public_list
+    filer_list
   end
   
   def by_panel
-    filter_list
+    filer_list
   end
   
   def by_author
-    filter_list
+    filer_list
   end
   
   def show
@@ -35,6 +37,18 @@ class SpeechBalloonsController < ApplicationController
     end
   end
   
+  def count
+    list_count
+  end
+  
+  def count_by_panel
+    list_count
+  end
+  
+  def count_by_author
+    list_count
+  end
+  
   def new
     raise Pettanr::NotWork unless @operators.author.working_panel
     @speech_balloon_template = SpeechBalloonTemplate.show params[:speech_balloon_template_id], @operators
index 0c4a416..19e3fc0 100644 (file)
@@ -3,26 +3,28 @@ class SpeechesController < ApplicationController
     before_filter :authenticate_user, :only => []
     before_filter :authenticate_author, :only => []
   else
-    before_filter :authenticate_reader, :only => [:index, :show, :by_speech_balloon, :by_writing_format]
+    before_filter :authenticate_reader, :only => [
+      :index, :show, :by_speech_balloon, :by_writing_format, :count, :count_by_speech_balloon, :count_by_writing_format
+    ]
     before_filter :authenticate_user, :only => []
     before_filter :authenticate_author, :only => []
   end
-  before_filter :authenticate_admin!, :only => [:list, :browse]
+  before_filter :authenticate_admin!, :only => []
 
   def self.model
     Speech
   end
   
   def index
-    public_list
+    filer_list
   end
   
   def by_speech_balloon
-    filter_list
+    filer_list
   end
   
   def by_writing_format
-    filter_list
+    filer_list
   end
   
   def show
@@ -36,22 +38,16 @@ class SpeechesController < ApplicationController
     end
   end
   
-  def list
-    @speeches = Speech.all
-
-    respond_to do |format|
-      format.html { render layout: 'system' }
-      format.json { render json: @speeches }
-    end
+  def count
+    list_count
   end
-
-  def browse
-    @speech = Speech.find(params[:id])
-
-    respond_to do |format|
-      format.html { render layout: 'system' }
-      format.json { render json: @speech }
-    end
+  
+  def count_by_speech_balloon
+    list_count
   end
-
+  
+  def count_by_writing_format
+    list_count
+  end
+  
 end
index 1fcf003..e459528 100644 (file)
@@ -3,7 +3,9 @@ class StoriesController < ApplicationController
     before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
     before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
   else
-    before_filter :authenticate_reader, :only => [:index, :show, :play, :story_sheets, :sheets, :by_comic, :by_sheet, :by_author]
+    before_filter :authenticate_reader, :only => [
+      :index, :show, :play, :by_comic, :by_sheet, :by_author, :count, :count_by_comic, :count_by_sheet, :count_by_author
+    ]
     before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
     before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
   end
@@ -13,27 +15,19 @@ class StoriesController < ApplicationController
   end
   
   def index
-    public_list
-  end
-  
-  def story_sheets
-    has_many_list
-  end
-  
-  def sheets
-    has_many_list
+    filer_list
   end
   
   def by_comic
-    filter_list
+    filer_list
   end
   
   def by_sheet
-    filter_list
+    filer_list
   end
   
   def by_author
-    filter_list
+    filer_list
   end
   
   def show
@@ -77,6 +71,22 @@ class StoriesController < ApplicationController
     end
   end
   
+  def count
+    list_count
+  end
+  
+  def count_by_comic
+    list_count
+  end
+  
+  def count_by_sheet
+    list_count
+  end
+  
+  def count_by_author
+    list_count
+  end
+  
   def new
     @story = Story.new 
     @story.supply_default
index ffabcca..e4edfac 100644 (file)
@@ -3,7 +3,9 @@ class StorySheetsController < ApplicationController
     before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
     before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
   else
-    before_filter :authenticate_reader, :only => [:index, :show, :by_story, :by_sheet]
+    before_filter :authenticate_reader, :only => [
+      :index, :show, :by_story, :by_sheet, :count, :count_by_story, :count_by_sheet
+    ]
     before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
     before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
   end
@@ -13,15 +15,15 @@ class StorySheetsController < ApplicationController
   end
   
   def index
-    public_list
+    filer_list
   end
   
   def by_story
-    filter_list
+    filer_list
   end
   
   def by_sheet
-    filter_list
+    filer_list
   end
   
   def show
@@ -33,6 +35,18 @@ class StorySheetsController < ApplicationController
     end
   end
   
+  def count
+    list_count
+  end
+  
+  def count_by_story
+    list_count
+  end
+  
+  def count_by_sheet
+    list_count
+  end
+  
   def new
     @story_sheet = StorySheet.new 
     @story_sheet.supply_default
index fe79ea2..03d3595 100644 (file)
@@ -20,9 +20,6 @@ class SystemController < ApplicationController
     end
   end
   
-  def browse
-  end
-  
   def auth_token
   end
   
index 58bd89b..b151632 100644 (file)
@@ -3,26 +3,18 @@ class SystemPicturesController < ApplicationController
     before_filter :authenticate_user, :only => []
     before_filter :authenticate_author, :only => []
   else
-    before_filter :authenticate_resource_reader, :only => [:index, :show, :speech_balloon_templates, :licenses]
+    before_filter :authenticate_resource_reader, :only => [:index, :show, :count]
     before_filter :authenticate_user, :only => []
     before_filter :authenticate_author, :only => []
   end
-  before_filter :authenticate_admin!, :only => [:list, :browse, :new, :create]
+  before_filter :authenticate_admin!, :only => []
 
   def self.model
     SystemPicture
   end
   
   def index
-    public_list
-  end
-  
-  def speech_balloon_templates
-    has_many_list
-  end
-  
-  def licenses
-    has_many_list
+    filer_list
   end
   
   def show
@@ -40,23 +32,9 @@ class SystemPicturesController < ApplicationController
       format.json { render json: @item.to_json(SystemPicture.show_json_opt)}
     end
   end
-
-  def list
-    @system_pictures = SystemPicture.all
-
-    respond_to do |format|
-      format.html { render layout: 'system' }
-      format.json { render json: @system_pictures }
-    end
-  end
-
-  def browse
-    @system_picture = SystemPicture.find(params[:id])
-
-    respond_to do |format|
-      format.html { render layout: 'system' }
-      format.json { render json: @system_picture}
-    end
+  
+  def count
+    list_count
   end
-
+  
 end
index 21ab7ae..ab7f606 100644 (file)
@@ -2,17 +2,17 @@ class WritingFormatsController < ApplicationController
   if Manifest.manifest.magic_numbers['run_mode'] == 0
     before_filter :authenticate_user, :only => []
   else
-    before_filter :authenticate_reader, :only => [:index, :show]
+    before_filter :authenticate_reader, :only => [:index, :show, :count]
     before_filter :authenticate_user, :only => []
   end
-  before_filter :authenticate_admin!, :only => [:list, :browse, :destroy]
+  before_filter :authenticate_admin!, :only => [:destroy]
 
   def self.model
     WritingFormat
   end
   
   def index
-    public_list
+    filer_list
   end
 
   def show
@@ -27,4 +27,8 @@ class WritingFormatsController < ApplicationController
     end
   end
 
+  def count
+    list_count
+  end
+  
 end
index ba858e2..25209e4 100644 (file)
@@ -20,7 +20,7 @@ module Manifest
     end
     
     def set_default
-      @controller_manifest['item_name'] ||= @controller_name
+      @controller_manifest['item_name'] ||= ::Manifest.singularize(@controller_name)
       @controller_manifest['actions'] ||= {}
     end
     
index 147263c..9814ee4 100644 (file)
@@ -1,12 +1,13 @@
 require_dependency "manifest/controller/action/base"
 require_dependency "manifest/controller/action/list"
 require_dependency "manifest/controller/action/show"
+require_dependency "manifest/controller/action/count"
 module Manifest
   module ControllerModule
     class ActionFactory
       include ActionModule
       @@types = {
-        'list' => ActionList, 'show' => ActionShow
+        'list' => ActionList, 'show' => ActionShow, 'count' => ActionCount
       }
       def self.factory controller, action_name, my_manifest
         my_manifest['type'] ||= 'list'
index 198cd65..1efd8c5 100644 (file)
@@ -6,11 +6,11 @@ module Manifest
         
         def set_default
           super
+          @action_manifest['args']['list_name'] ||= @action_name
         end
         
         def init
           super
-          raise "undefined list_name for controllers > #{self.controller_name} > actions > #{@action_name}\n" unless @args['list_name']
           @list_name = @args['list_name']
         end
         
index a5fe270..8784991 100644 (file)
@@ -40,7 +40,7 @@ module Manifest
             attr :method_name
             def set_default
               super
-              raise "undefined method_name for filers > #{self.caption.filer.filer_name} > caption > default > face\n" unless @face_manifest['args']['method_name']
+              @face_manifest['args']['method_name'] ||= 'caption'
             end
             
             def init
index 2365a74..58e7a7e 100644 (file)
@@ -77,6 +77,10 @@ module Manifest
         @model.where(self.where).includes(self.includes).order(self.order).offset(offset).limit(page_size)
       end
       
+      def count operators, options
+        @model.where(self.where).includes(self.includes)
+      end
+      
       def paginate items, offset, page_size
         c = items ? items.count : 0
         Kaminari.paginate_array(Array.new(c, nil)).page(offset).per(page_size)
index 842af37..2a06ffb 100644 (file)
@@ -8,12 +8,13 @@ module Manifest
       
       def init
         super
+        @filter_key = @model_list_manifest.filter_key
       end
       
-      def where filter_item
+      def where filter_item_id
         w = @model.list_where
         w += ' and ' unless w.blank?
-        [w + @table_name + '.' + @filter_key + ' = ?', filter_item.id] 
+        [w + @table_name + '.' + @filter_key + ' = ?', filter_item_id] 
       end
       
       def includes
@@ -23,8 +24,13 @@ module Manifest
       end
       
       def items options, offset, page_size
-        filter_item = options[:filter_item]
-        @model.where(self.where(filter_item)).includes(self.includes).order(self.order).offset(offset).limit(page_size)
+        filter_item_id = options[:id]
+        @model.where(self.where(filter_item_)).includes(self.includes).order(self.order).offset(offset).limit(page_size)
+      end
+      
+      def count operators, options
+        filter_item_id = options[:id]
+        @model.where(self.where(filter_item_id)).includes(self.includes).count
       end
       
       def self._add_action item_name, action_name, list_name, list_conf
index bfbe0c9..1d20a45 100644 (file)
@@ -66,7 +66,11 @@ module Manifest
                     end
                     
                     def tag_opt
-                      @item.__send__ self.method_name
+                      if @item.methods(true).include?(self.method_name.to_sym)
+                        @item.__send__ self.method_name
+                      else
+                        {:src => '/images/error.png', :width => Manifest.manifest.magic_numbers['thumbnail_width'], :height => Manifest.manifest.magic_numbers['thumbnail_height']}
+                      end
                     end
                     
                   end
index 240e6ef..8f26799 100644 (file)
@@ -1,3 +1,4 @@
+require_dependency "manifest/local/view/filer/body/file_header/base"
 require_dependency "manifest/local/view/filer/body/file_header/show"
 require_dependency "manifest/local/view/filer/body/file_header/none"
 module Manifest
index 85be450..d1bf4b9 100644 (file)
@@ -3,45 +3,10 @@ module Manifest
     module FilerModule
       module BodyModule
         module FileHeaderModule
-          class None
-            attr :file_header, :column_name
-            def initialize file_header, column_name
-              @file_header = file_header
-              @column_name = column_name
-            end
-            
-            def filer
-              @file_header.filer
-            end
-            
-            def manifest
-              self.filer.manifest
-            end
-            
-            def item_name
-              self.filer.item_name
-            end
-            
-            def model
-              self.filer.model
-            end
-            
-            def items
-              self.filer.items
-            end
-            
-            def template_dir
-              self.filer.template_dir + 'header_column/'
-            end
-            
+          class None < Base
             def template_file_name
               "none"
             end
-            
-            def template_name
-              self.template_dir + self.template_file_name
-            end
-            
           end
         end
       end
index c3216c8..3f69cd8 100644 (file)
@@ -3,45 +3,10 @@ module Manifest
     module FilerModule
       module BodyModule
         module FileHeaderModule
-          class Show
-            attr :file_header, :column_name
-            def initialize file_header, column_name
-              @file_header = file_header
-              @column_name = column_name
-            end
-            
-            def filer
-              @file_header.filer
-            end
-            
-            def manifest
-              self.filer.manifest
-            end
-            
-            def item_name
-              self.filer.item_name
-            end
-            
-            def model
-              self.filer.model
-            end
-            
-            def items
-              self.filer.items
-            end
-            
-            def template_dir
-              self.filer.template_dir + 'header_column/'
-            end
-            
+          class Show < Base
             def template_file_name
               "show"
             end
-            
-            def template_name
-              self.template_dir + self.template_file_name
-            end
-            
           end
         end
       end
index 6c3fdfe..a871faa 100644 (file)
@@ -56,6 +56,10 @@ module Manifest
       item_name.classify.constantize
     end
     
+    def singularize name
+      name.singularize
+    end
+    
   end
 
   extend ModuleMethods
index 93df4dd..b5cac7b 100644 (file)
@@ -21,8 +21,8 @@ module Manifest
         def init
           @type = @list_manifest['type']
           @args = @list_manifest['args']
-          @default_page_size = @list_manifest['args']['default_page_size']
-          @max_page_size = @list_manifest['args']['max_page_size']
+          @default_page_size = @args['default_page_size']
+          @max_page_size = @args['max_page_size']
         end
         
         def model_name
index daf0ea2..e79ca01 100644 (file)
@@ -2,34 +2,17 @@ module Manifest
   module ModelModule
     module ListModule
       class FilterList < Base
+        attr :filter_key
         
         def set_default
           super
+          @list_manifest['args']['filter_item_name'] ||= @list_name.gsub(/^by_/, '')
+          @list_manifest['args']['filter_key'] ||= @list_manifest['args']['filter_item_name'] + '_id'
         end
         
         def init
           super
-          return
-        end
-        
-        def where filter_item
-          w = @model.list_where
-          w += ' and ' unless w.blank?
-          [w + @table_name + '.' + @filter_key + ' = ?', filter_item.id] 
-        end
-        
-        def includes
-          return @includes if @includes
-          w = @owner_model ? {@owner_model.item_name => {}} : {}
-          w.merge({@from => {} }) 
-        end
-        
-        def items filter_item
-          @model.where(self.where(filter_item)).includes(self.includes).order(self.order).offset(@offset).limit(@page_size)
-        end
-        
-        def paginate filter_item
-          Kaminari.paginate_array(Array.new(@model.where(self.where(filter_item)).includes(self.includes).count, nil)).page(@offset).per(@page_size)
+          @filter_key = @args['filter_key']
         end
         
         def self._add_action item_name, action_name, list_name, list_conf
index 4af2cb6..1cafc04 100644 (file)
@@ -1,6 +1,6 @@
 {\r
   "controllers": {\r
-    "scroll": {\r
+    "scrolls": {\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
@@ -8,29 +8,11 @@
             "list_name": "public_list"\r
           }\r
         },\r
-        "scroll_panels": {\r
-          "type": "list",\r
-          "args": {\r
-            "list_name": "scroll_panels"\r
-          }\r
-        },\r
-        "panels": {\r
-          "type": "list",\r
-          "args": {\r
-            "list_name": "panels"\r
-          }\r
-        },\r
         "by_author": {\r
-          "type": "list",\r
-          "args": {\r
-            "list_name": "by_author"\r
-          }\r
+          "type": "list"\r
         },\r
         "by_panel": {\r
-          "type": "list",\r
-          "args": {\r
-            "list_name": "by_panel"\r
-          }\r
+          "type": "list"\r
         },\r
         "play": {\r
           "type": "list",\r
         "show": {\r
           "type": "show",\r
           "name": "show"\r
+        },\r
+        "count": {\r
+          "type": "count",\r
+          "args": {\r
+            "list_name": "public_list"\r
+          }\r
+        },\r
+        "count_by_author": {\r
+          "type": "count"\r
+        },\r
+        "count_by_panel": {\r
+          "type": "count"\r
         }\r
       }\r
     },\r
-    "scroll_panel": {\r
+    "scroll_panels": {\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           }\r
         },\r
         "by_panel": {\r
-          "type": "list",\r
-          "args": {\r
-            "list_name": "by_panel"\r
-          }\r
+          "type": "list"\r
         },\r
         "by_scroll": {\r
-          "type": "list",\r
+          "type": "list"\r
+        },\r
+        "count": {\r
+          "type": "count",\r
           "args": {\r
-            "list_name": "by_scroll"\r
+            "list_name": "public_list"\r
           }\r
+        },\r
+        "count_by_panel": {\r
+          "type": "count"\r
+        },\r
+        "count_by_scroll": {\r
+          "type": "count"\r
         }\r
       }\r
     },\r
-    "comic": {\r
+    "comics": {\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
             "list_name": "public_list"\r
           }\r
         },\r
-        "stories": {\r
-          "type": "list",\r
-          "args": {\r
-            "list_name": "stories"\r
-          }\r
-        },\r
         "by_author": {\r
-          "type": "list",\r
+          "type": "list"\r
+        },\r
+        "count": {\r
+          "type": "count",\r
           "args": {\r
-            "list_name": "by_author"\r
+            "list_name": "public_list"\r
           }\r
+        },\r
+        "count_by_author": {\r
+          "type": "count"\r
         }\r
       }\r
     },\r
-    "story": {\r
+    "stories": {\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
             "list_name": "public_list"\r
           }\r
         },\r
-        "story_sheets": {\r
-          "type": "list",\r
-          "args": {\r
-            "list_name": "story_sheets"\r
-          }\r
-        },\r
-        "sheets": {\r
-          "type": "list",\r
-          "args": {\r
-            "list_name": "sheets"\r
-          }\r
-        },\r
         "by_comic": {\r
-          "type": "list",\r
-          "args": {\r
-            "list_name": "by_comic"\r
-          }\r
+          "type": "count"\r
         },\r
         "by_sheet": {\r
-          "type": "list",\r
-          "args": {\r
-            "list_name": "by_sheet"\r
-          }\r
+          "type": "count"\r
         },\r
         "by_author": {\r
-          "type": "list",\r
-          "args": {\r
-            "list_name": "by_author"\r
-          }\r
+          "type": "list"\r
         },\r
         "play": {\r
           "type": "list",\r
           "args": {\r
             "list_name": "play"\r
           }\r
+        },\r
+        "count": {\r
+          "type": "count",\r
+          "args": {\r
+            "list_name": "public_list"\r
+          }\r
+        },\r
+        "count_by_author": {\r
+          "type": "count"\r
         }\r
       }\r
     },\r
-    "story_sheet": {\r
+    "story_sheets": {\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           }\r
         },\r
         "by_story": {\r
-          "type": "list",\r
-          "args": {\r
-            "list_name": "by_story"\r
-          }\r
+          "type": "list"\r
         },\r
         "by_sheet": {\r
-          "type": "list",\r
+          "type": "list"\r
+        },\r
+        "count": {\r
+          "type": "count",\r
           "args": {\r
-            "list_name": "by_sheet"\r
+            "list_name": "public_list"\r
           }\r
+        },\r
+        "count_by_story": {\r
+          "type": "count"\r
+        },\r
+        "count_by_sheet": {\r
+          "type": "count"\r
         }\r
       }\r
     },\r
-    "sheet": {\r
+    "sheets": {\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
             "list_name": "public_list"\r
           }\r
         },\r
-        "story_sheets": {\r
-          "type": "list",\r
-          "args": {\r
-            "list_name": "story_sheets"\r
-          }\r
+        "by_story": {\r
+          "type": "list"\r
         },\r
-        "stories": {\r
-          "type": "list",\r
-          "args": {\r
-            "list_name": "stories"\r
-          }\r
+        "by_panel": {\r
+          "type": "list"\r
         },\r
-        "sheet_panels": {\r
-          "type": "list",\r
-          "args": {\r
-            "list_name": "sheet_panels"\r
-          }\r
+        "by_author": {\r
+          "type": "list"\r
         },\r
-        "panels": {\r
+        "play": {\r
           "type": "list",\r
           "args": {\r
-            "list_name": "panels"\r
+            "list_name": "play"\r
           }\r
         },\r
-        "by_story": {\r
-          "type": "list",\r
+        "count": {\r
+          "type": "count",\r
           "args": {\r
-            "list_name": "by_story"\r
+            "list_name": "public_list"\r
           }\r
         },\r
-        "by_panel": {\r
-          "type": "list",\r
-          "args": {\r
-            "list_name": "by_panel"\r
-          }\r
+        "count_by_story": {\r
+          "type": "count"\r
         },\r
-        "by_author": {\r
-          "type": "list",\r
-          "args": {\r
-            "list_name": "by_author"\r
-          }\r
+        "count_by_panel": {\r
+          "type": "count"\r
         },\r
-        "play": {\r
-          "type": "list",\r
-          "args": {\r
-            "list_name": "play"\r
-          }\r
+        "count_by_author": {\r
+          "type": "count"\r
         }\r
       }\r
     },\r
-    "sheet_panel": {\r
+    "sheet_panels": {\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           }\r
         },\r
         "by_sheet": {\r
-          "type": "list",\r
-          "args": {\r
-            "list_name": "by_sheet"\r
-          }\r
+          "type": "list"\r
         },\r
         "by_panel": {\r
-          "type": "list",\r
+          "type": "list"\r
+        },\r
+        "count": {\r
+          "type": "count",\r
           "args": {\r
-            "list_name": "by_panel"\r
+            "list_name": "public_list"\r
           }\r
+        },\r
+        "count_by_sheet": {\r
+          "type": "count"\r
+        },\r
+        "count_by_panel": {\r
+          "type": "count"\r
         }\r
       }\r
     },\r
-    "panel": {\r
+    "panels": {\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
             "list_name": "public_list"\r
           }\r
         },\r
-        "scroll_panels": {\r
-          "type": "list",\r
-          "args": {\r
-            "list_name": "scroll_panels"\r
-          }\r
-        },\r
-        "scrolls": {\r
-          "type": "list",\r
-          "args": {\r
-            "list_name": "scrolls"\r
-          }\r
-        },\r
-        "sheet_panels": {\r
-          "type": "list",\r
-          "args": {\r
-            "list_name": "sheet_panels"\r
-          }\r
-        },\r
-        "sheets": {\r
-          "type": "list",\r
-          "args": {\r
-            "list_name": "sheets"\r
-          }\r
+        "by_scroll": {\r
+          "type": "list"\r
         },\r
-        "panel_pictures": {\r
-          "type": "list",\r
-          "args": {\r
-            "list_name": "panel_pictures"\r
-          }\r
+        "by_sheet": {\r
+          "type": "list"\r
         },\r
-        "speech_balloons": {\r
-          "type": "list",\r
-          "args": {\r
-            "list_name": "speech_balloons"\r
-          }\r
+        "by_author": {\r
+          "type": "list"\r
         },\r
-        "ground_pictures": {\r
-          "type": "list",\r
-          "args": {\r
-            "list_name": "ground_pictures"\r
-          }\r
+        "by_speech_balloon_template": {\r
+          "type": "list"\r
         },\r
-        "ground_colors": {\r
-          "type": "list",\r
+        "count": {\r
+          "type": "count",\r
           "args": {\r
-            "list_name": "ground_colors"\r
+            "list_name": "public_list"\r
           }\r
         },\r
-        "by_scroll": {\r
-          "type": "list",\r
-          "args": {\r
-            "list_name": "by_scroll"\r
-          }\r
+        "count_by_scroll": {\r
+          "type": "count"\r
         },\r
-        "by_sheet": {\r
-          "type": "list",\r
-          "args": {\r
-            "list_name": "by_sheet"\r
-          }\r
+        "count_by_sheet": {\r
+          "type": "count"\r
         },\r
-        "by_author": {\r
-          "type": "list",\r
-          "args": {\r
-            "list_name": "by_author"\r
-          }\r
+        "count_by_author": {\r
+          "type": "count"\r
         },\r
-        "by_speech_balloon_template": {\r
-          "type": "list",\r
-          "args": {\r
-            "list_name": "by_speech_balloon_template"\r
-          }\r
+        "count_by_speech_balloon_template": {\r
+          "type": "count"\r
         }\r
       }\r
     },\r
-    "panel_picture": {\r
+    "panel_pictures": {\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           }\r
         },\r
         "by_panel": {\r
-          "type": "list",\r
-          "args": {\r
-            "list_name": "by_panel"\r
-          }\r
+          "type": "list"\r
         },\r
         "by_author": {\r
-          "type": "list",\r
+          "type": "list"\r
+        },\r
+        "count": {\r
+          "type": "count",\r
           "args": {\r
-            "list_name": "by_author"\r
+            "list_name": "public_list"\r
           }\r
+        },\r
+        "count_by_panel": {\r
+          "type": "count"\r
+        },\r
+        "count_by_author": {\r
+          "type": "count"\r
         }\r
       }\r
     },\r
-    "speech_balloon": {\r
+    "speech_balloons": {\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           }\r
         },\r
         "by_panel": {\r
-          "type": "list",\r
-          "args": {\r
-            "list_name": "by_panel"\r
-          }\r
+          "type": "list"\r
         },\r
         "by_author": {\r
-          "type": "list",\r
+          "type": "list"\r
+        },\r
+        "count": {\r
+          "type": "count",\r
           "args": {\r
-            "list_name": "by_author"\r
+            "list_name": "public_list"\r
           }\r
+        },\r
+        "count_by_panel": {\r
+          "type": "count"\r
+        },\r
+        "count_by_author": {\r
+          "type": "count"\r
         }\r
       }\r
     },\r
-    "speech": {\r
+    "speeches": {\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           }\r
         },\r
         "by_writing_format": {\r
-          "type": "list",\r
+          "type": "list"\r
+        },\r
+        "count": {\r
+          "type": "count",\r
           "args": {\r
-            "list_name": "by_writing_format"\r
+            "list_name": "public_list"\r
           }\r
+        },\r
+        "count_by_writing_format": {\r
+          "type": "count"\r
         }\r
       }\r
     },\r
-    "balloon": {\r
+    "balloons": {\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
             "list_name": "public_list"\r
           }\r
+        },\r
+        "count": {\r
+          "type": "count",\r
+          "args": {\r
+            "list_name": "public_list"\r
+          }\r
         }\r
       }\r
     },\r
-    "ground_picture": {\r
+    "ground_pictures": {\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           }\r
         },\r
         "by_panel": {\r
-          "type": "list",\r
-          "args": {\r
-            "list_name": "by_panel"\r
-          }\r
+          "type": "list"\r
         },\r
         "by_author": {\r
-          "type": "list",\r
+          "type": "list"\r
+        },\r
+        "count": {\r
+          "type": "count",\r
           "args": {\r
-            "list_name": "by_author"\r
+            "list_name": "public_list"\r
           }\r
+        },\r
+        "count_by_panel": {\r
+          "type": "count"\r
+        },\r
+        "count_by_author": {\r
+          "type": "count"\r
         }\r
       }\r
     },\r
-    "ground_color": {\r
+    "ground_colors": {\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           }\r
         },\r
         "by_panel": {\r
-          "type": "list",\r
-          "args": {\r
-            "list_name": "by_panel"\r
-          }\r
+          "type": "list"\r
         },\r
         "by_author": {\r
-          "type": "list",\r
+          "type": "list"\r
+        },\r
+        "count": {\r
+          "type": "count",\r
           "args": {\r
-            "list_name": "by_author"\r
+            "list_name": "public_list"\r
           }\r
+        },\r
+        "count_by_panel": {\r
+          "type": "count"\r
+        },\r
+        "count_by_author": {\r
+          "type": "count"\r
         }\r
       }\r
     },\r
-    "original_picture": {\r
+    "original_pictures": {\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
             "list_name": "private_list"\r
           }\r
+        },\r
+        "count": {\r
+          "type": "count",\r
+          "args": {\r
+            "list_name": "public_list"\r
+          }\r
         }\r
       }\r
     },\r
-    "picture": {},\r
-    "resource_picture": {\r
+    "pictures": {},\r
+    "resource_pictures": {\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           }\r
         },\r
         "by_license": {\r
-          "type": "list",\r
-          "args": {\r
-            "list_name": "by_license"\r
-          }\r
+          "type": "list"\r
         },\r
         "by_artist": {\r
-          "type": "list",\r
+          "type": "list"\r
+        },\r
+        "count": {\r
+          "type": "count",\r
           "args": {\r
-            "list_name": "by_artist"\r
+            "list_name": "public_list"\r
           }\r
+        },\r
+        "count_by_license": {\r
+          "type": "count"\r
+        },\r
+        "count_by_artist": {\r
+          "type": "count"\r
         }\r
       }\r
     },\r
-    "speech_balloon_template": {\r
+    "speech_balloon_templates": {\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
             "list_name": "public_list"\r
           }\r
         },\r
-        "speech_balloons": {\r
-          "type": "list",\r
+        "count": {\r
+          "type": "count",\r
           "args": {\r
-            "list_name": "speech_balloons"\r
-          }\r
-        },\r
-        "panels": {\r
-          "type": "list",\r
-          "args": {\r
-            "list_name": "panels"\r
+            "list_name": "public_list"\r
           }\r
         }\r
       }\r
     },\r
-    "writing_format": {\r
+    "writing_formats": {\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
             "list_name": "public_list"\r
           }\r
         },\r
-        "speeches": {\r
-          "type": "list",\r
-          "args": {\r
-            "list_name": "speeches"\r
-          }\r
-        },\r
         "by_system_picture": {\r
-          "type": "list",\r
+          "type": "list"\r
+        },\r
+        "count": {\r
+          "type": "count",\r
           "args": {\r
-            "list_name": "by_system_picture"\r
+            "list_name": "public_list"\r
           }\r
+        },\r
+        "count_by_system_picture": {\r
+          "type": "count"\r
         }\r
       }\r
     },\r
-    "license_group": {\r
+    "license_groups": {\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
             "list_name": "public_list"\r
           }\r
         },\r
-        "licenses": {\r
-          "type": "list",\r
+        "count": {\r
+          "type": "count",\r
           "args": {\r
-            "list_name": "licenses"\r
+            "list_name": "public_list"\r
           }\r
         }\r
       }\r
     },\r
-    "license": {\r
+    "licenses": {\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
             "list_name": "public_list"\r
           }\r
         },\r
-        "resource_pictures": {\r
-          "type": "list",\r
-          "args": {\r
-            "list_name": "resource_pictures"\r
-          }\r
-        },\r
         "by_license_group": {\r
-          "type": "list",\r
-          "args": {\r
-            "list_name": "by_license_group"\r
-          }\r
+          "type": "list"\r
         },\r
         "by_system_picture": {\r
-          "type": "list",\r
+          "type": "list"\r
+        },\r
+        "count": {\r
+          "type": "count",\r
           "args": {\r
-            "list_name": "by_system_picture"\r
+            "list_name": "public_list"\r
           }\r
+        },\r
+        "count_by_license_group": {\r
+          "type": "count"\r
+        },\r
+        "count_by_system_picture": {\r
+          "type": "count"\r
         }\r
       }\r
     },\r
-    "author": {\r
+    "authors": {\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
             "list_name": "ground_colors"\r
           }\r
+        },\r
+        "count": {\r
+          "type": "count",\r
+          "args": {\r
+            "list_name": "public_list"\r
+          }\r
         }\r
       }\r
     },\r
-    "artist": {\r
+    "artists": {\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
             "list_name": "resource_pictures"\r
           }\r
+        },\r
+        "count": {\r
+          "type": "count",\r
+          "args": {\r
+            "list_name": "public_list"\r
+          }\r
         }\r
       }\r
     },\r
-    "system_picture": {\r
+    "system_pictures": {\r
       "actions": {\r
         "index": {\r
           "type": "list",\r
           "args": {\r
             "list_name": "public_list"\r
           }\r
+        },\r
+        "count": {\r
+          "type": "count",\r
+          "args": {\r
+            "list_name": "public_list"\r
+          }\r
         }\r
       }\r
     },\r
     "home": {\r
       "actions": {\r
         "scrolls": {\r
-          "item_name": "scroll",\r
           "type": "list",\r
           "args": {\r
+            "item_name": "scroll",\r
             "list_name": "private_list"\r
           }\r
         },\r
         "scroll_panels": {\r
-          "item_name": "scroll_panel",\r
           "type": "list",\r
           "args": {\r
+            "item_name": "scroll_panel",\r
             "list_name": "private_list"\r
           }\r
         },\r
         "comics": {\r
-          "item_name": "comic",\r
           "type": "list",\r
           "args": {\r
+            "item_name": "comic",\r
             "list_name": "private_list"\r
           }\r
         },\r
         "stories": {\r
-          "item_name": "story",\r
           "type": "list",\r
           "args": {\r
+            "item_name": "story",\r
             "list_name": "private_list"\r
           }\r
         },\r
         "story_sheets": {\r
-          "item_name": "story_sheet",\r
           "type": "list",\r
           "args": {\r
+            "item_name": "story_sheet",\r
             "list_name": "private_list"\r
           }\r
         },\r
         "sheets": {\r
-          "item_name": "sheet",\r
           "type": "list",\r
           "args": {\r
+            "item_name": "sheet",\r
             "list_name": "private_list"\r
           }\r
         },\r
         "sheet_panels": {\r
-          "item_name": "sheet_panel",\r
           "type": "list",\r
           "args": {\r
+            "item_name": "sheet_panel",\r
             "list_name": "private_list"\r
           }\r
         },\r
         "panels": {\r
-          "item_name": "panel",\r
           "type": "list",\r
           "args": {\r
+            "item_name": "panel",\r
             "list_name": "private_list"\r
           }\r
         },\r
         "panel_pictures": {\r
-          "item_name": "panel_picture",\r
           "type": "list",\r
           "args": {\r
+            "item_name": "panel_picture",\r
             "list_name": "private_list"\r
           }\r
         },\r
         "speech_balloons": {\r
-          "item_name": "speech_balloon",\r
           "type": "list",\r
           "args": {\r
+            "item_name": "speech_balloon",\r
             "list_name": "private_list"\r
           }\r
         },\r
         "speeches": {\r
-          "item_name": "speech",\r
           "type": "list",\r
           "args": {\r
+            "item_name": "speech",\r
             "list_name": "private_list"\r
           }\r
         },\r
         "balloons": {\r
-          "item_name": "balloon",\r
           "type": "list",\r
           "args": {\r
+            "item_name": "balloon",\r
             "list_name": "private_list"\r
           }\r
         },\r
         "ground_pictures": {\r
-          "item_name": "ground_picture",\r
           "type": "list",\r
           "args": {\r
+            "item_name": "ground_picture",\r
             "list_name": "private_list"\r
           }\r
         },\r
         "ground_colors": {\r
-          "item_name": "ground_color",\r
           "type": "list",\r
           "args": {\r
+            "item_name": "ground_color",\r
             "list_name": "private_list"\r
           }\r
         },\r
         "original_pictures": {\r
-          "item_name": "original_picture",\r
           "type": "list",\r
           "args": {\r
+            "item_name": "original_picture",\r
             "list_name": "private_list"\r
           }\r
         },\r
         "resource_pictures": {\r
-          "item_name": "resource_picture",\r
           "type": "list",\r
           "args": {\r
+            "item_name": "resource_picture",\r
             "list_name": "private_list"\r
           }\r
         }\r
             "link": {\r
               "type": "action",\r
               "args": {\r
-                "action_nname": "history"\r
+                "action_name": "history"\r
               }\r
             }\r
           }\r