From 26a6de7f9a264f04424a7fcd1acacad612322210 Mon Sep 17 00:00:00 2001 From: yasushiito Date: Sun, 9 Nov 2014 16:37:12 +0900 Subject: [PATCH] remove counter api --- .../javascripts/work/controllers.js.coffee.erb | 468 +------------------ app/controllers/application_controller.rb | 8 - app/controllers/artists_controller.rb | 8 +- app/controllers/authors_controller.rb | 6 +- app/controllers/balloons_controller.rb | 25 +- app/controllers/comic_stories_controller.rb | 14 +- app/controllers/comics_controller.rb | 14 +- app/controllers/ground_colors_controller.rb | 14 +- app/controllers/ground_pictures_controller.rb | 14 +- app/controllers/home_controller.rb | 70 +-- app/controllers/license_groups_controller.rb | 11 +- app/controllers/licenses_controller.rb | 14 +- app/controllers/original_pictures_controller.rb | 6 +- app/controllers/panel_pictures_controller.rb | 14 +- app/controllers/panels_controller.rb | 20 - app/controllers/pictures_controller.rb | 14 +- app/controllers/resource_pictures_controller.rb | 25 +- app/controllers/scroll_panels_controller.rb | 22 +- app/controllers/scrolls_controller.rb | 16 - app/controllers/sheet_panels_controller.rb | 18 +- app/controllers/sheets_controller.rb | 18 +- .../speech_balloon_templates_controller.rb | 14 +- app/controllers/speech_balloons_controller.rb | 18 +- app/controllers/speeches_controller.rb | 25 +- app/controllers/stories_controller.rb | 18 +- app/controllers/story_sheets_controller.rb | 18 +- app/controllers/system_pictures_controller.rb | 2 +- app/controllers/writing_formats_controller.rb | 12 +- config/routes.rb | 86 ---- lib/locmare/filer.rb | 1 - lib/locmare/filer/pager.rb | 54 --- lib/locmare/list_group/lib/page_status.rb | 1 + lib/locmare/list_group/list/base.rb | 1 + lib/locmare/list_group/list/filter.rb | 26 -- lib/locmare/profiler/association/has_many.rb | 2 +- lib/manifest/controller/action.rb | 4 +- lib/manifest/controller/action/count.rb | 21 - lib/manifest/controller/action/list.rb | 14 - lib/manifest/system_resource.rb | 5 +- public/manifest.json | 508 +-------------------- 40 files changed, 74 insertions(+), 1575 deletions(-) delete mode 100644 lib/locmare/filer/pager.rb delete mode 100644 lib/manifest/controller/action/count.rb diff --git a/app/assets/javascripts/work/controllers.js.coffee.erb b/app/assets/javascripts/work/controllers.js.coffee.erb index 0e01995b..d23b2cea 100644 --- a/app/assets/javascripts/work/controllers.js.coffee.erb +++ b/app/assets/javascripts/work/controllers.js.coffee.erb @@ -17,12 +17,6 @@ watch: { type: 'show', }, - count: { - type: 'count', - args: { - action_name: 'index', - }, - }, new: { type: 'new', }, @@ -65,18 +59,6 @@ show: { type: 'show', }, - count: { - type: 'count', - args: { - action_name: 'index', - }, - }, - count_by_author: { - type: 'count', - }, - count_by_panel: { - type: 'count', - }, new: { type: 'new', }, @@ -123,21 +105,6 @@ show: { type: 'show', }, - count: { - type: 'count', - args: { - action_name: 'index', - }, - }, - count_by_panel: { - type: 'count', - }, - count_by_scroll: { - type: 'count', - }, - count_by_author: { - type: 'count', - }, new: { type: 'new', }, @@ -186,18 +153,6 @@ show: { type: 'show', }, - count: { - type: 'count', - args: { - action_name: 'index', - }, - }, - count_by_story: { - type: 'count', - }, - count_by_author: { - type: 'count', - }, new: { type: 'new', }, @@ -244,21 +199,6 @@ show: { type: 'show', }, - count: { - type: 'count', - args: { - action_name: 'index', - }, - }, - count_by_comic: { - type: 'count', - }, - count_by_story: { - type: 'count', - }, - count_by_author: { - type: 'count', - }, new: { type: 'new', }, @@ -313,21 +253,6 @@ show: { type: 'show', }, - count: { - type: 'count', - args: { - action_name: 'index', - }, - }, - count_by_comic: { - type: 'count', - }, - count_by_sheet: { - type: 'count', - }, - count_by_author: { - type: 'count', - }, new: { type: 'new', }, @@ -374,21 +299,6 @@ show: { type: 'show', }, - count: { - type: 'count', - args: { - action_name: 'index', - }, - }, - count_by_story: { - type: 'count', - }, - count_by_sheet: { - type: 'count', - }, - count_by_author: { - type: 'count', - }, new: { type: 'new', }, @@ -443,21 +353,6 @@ show: { type: 'show', }, - count: { - type: 'count', - args: { - action_name: 'index', - }, - }, - count_by_story: { - type: 'count', - }, - count_by_panel: { - type: 'count', - }, - count_by_author: { - type: 'count', - }, new: { type: 'new', }, @@ -504,21 +399,6 @@ show: { type: 'show', }, - count: { - type: 'count', - args: { - action_name: 'index', - }, - }, - count_by_sheet: { - type: 'count', - }, - count_by_panel: { - type: 'count', - }, - count_by_author: { - type: 'count', - }, new: { type: 'new', }, @@ -571,24 +451,6 @@ show: { type: 'show', }, - count: { - type: 'count', - args: { - action_name: 'index', - }, - }, - count_by_scroll: { - type: 'count', - }, - count_by_sheet: { - type: 'count', - }, - count_by_author: { - type: 'count', - }, - count_by_speech_balloon_template: { - type: 'count', - }, new: { type: 'new', }, @@ -629,18 +491,6 @@ show: { type: 'show', }, - count: { - type: 'count', - args: { - action_name: 'index', - }, - }, - count_by_panel: { - type: 'count', - }, - count_by_author: { - type: 'count', - }, new: { type: 'new', }, @@ -678,21 +528,6 @@ show: { type: 'show', }, - count: { - type: 'count', - args: { - action_name: 'index', - }, - }, - count_by_panel: { - type: 'count', - }, - count_by_author: { - type: 'count', - }, - count_by_speech_balloon_template: { - type: 'count', - }, new: { type: 'new', }, @@ -736,24 +571,6 @@ show: { type: 'show', }, - count: { - type: 'count', - args: { - action_name: 'index', - }, - }, - count_by_author: { - type: 'count', - }, - count_by_speech_balloon: { - type: 'count', - }, - count_by_speech_balloon_template: { - type: 'count', - }, - count_by_writing_format: { - type: 'count', - }, new: { type: 'new', }, @@ -797,24 +614,6 @@ show: { type: 'show', }, - count: { - type: 'count', - args: { - action_name: 'index', - }, - }, - count_by_author: { - type: 'count', - }, - count_by_speech_balloon: { - type: 'count', - }, - count_by_speech_balloon_template: { - type: 'count', - }, - count_by_system_picture: { - type: 'count', - }, new: { type: 'new', }, @@ -846,18 +645,6 @@ show: { type: 'show', }, - count: { - type: 'count', - args: { - action_name: 'index', - }, - }, - count_by_panel: { - type: 'count', - }, - count_by_author: { - type: 'count', - }, new: { type: 'new', }, @@ -889,18 +676,6 @@ show: { type: 'show', }, - count: { - type: 'count', - args: { - action_name: 'index', - }, - }, - count_by_panel: { - type: 'count', - }, - count_by_author: { - type: 'count', - }, new: { type: 'new', }, @@ -923,12 +698,6 @@ history: { type: 'show', }, - count: { - type: 'count', - args: { - action_name: 'index', - }, - }, new: { type: 'new', }, @@ -963,15 +732,6 @@ show: { type: 'show', }, - count: { - type: 'count', - args: { - action_name: 'index', - }, - }, - count_by_artist: { - type: 'count', - }, }, }, resource_pictures: { @@ -1009,24 +769,6 @@ show: { type: 'show', }, - count: { - type: 'count', - args: { - action_name: 'index', - }, - }, - count_by_original_picture: { - type: 'count', - }, - count_by_license_group: { - type: 'count', - }, - count_by_license: { - type: 'count', - }, - count_by_artist: { - type: 'count', - }, }, }, speech_balloon_templates: { @@ -1035,6 +777,7 @@ type: 'list', args: { param_id: 'none', + max_page_size: -1, }, }, by_panel: { @@ -1052,15 +795,6 @@ show: { type: 'show', }, - count: { - type: 'count', - args: { - action_name: 'index', - }, - }, - count_by_panel: { - type: 'count', - }, new: { type: 'new', }, @@ -1084,6 +818,7 @@ type: 'list', args: { param_id: 'none', + max_page_size: -1, }, }, by_system_picture: { @@ -1095,15 +830,6 @@ show: { type: 'show', }, - count: { - type: 'count', - args: { - action_name: 'index', - }, - }, - count_by_system_picture: { - type: 'count', - }, new: { type: 'new', }, @@ -1127,6 +853,7 @@ type: 'list', args: { param_id: 'none', + max_page_size: -1, }, }, by_resource_picture: { @@ -1138,15 +865,6 @@ show: { type: 'show', }, - count: { - type: 'count', - args: { - action_name: 'index', - }, - }, - count_by_resource_picture: { - type: 'count', - }, new: { type: 'new', }, @@ -1170,6 +888,7 @@ type: 'list', args: { param_id: 'none', + max_page_size: -1, }, }, by_license_group: { @@ -1187,18 +906,6 @@ show: { type: 'show', }, - count: { - type: 'count', - args: { - action_name: 'index', - }, - }, - count_by_license_group: { - type: 'count', - }, - count_by_system_picture: { - type: 'count', - }, new: { type: 'new', }, @@ -1227,12 +934,6 @@ show: { type: 'show', }, - count: { - type: 'count', - args: { - action_name: 'index', - }, - }, new: { type: 'new', }, @@ -1261,12 +962,6 @@ show: { type: 'show', }, - count: { - type: 'count', - args: { - action_name: 'index', - }, - }, new: { type: 'new', }, @@ -1295,12 +990,6 @@ show: { type: 'show', }, - count: { - type: 'count', - args: { - action_name: 'index', - }, - }, }, }, home: { @@ -1310,7 +999,6 @@ args: { item_name: 'scroll', param_id: 'none', - counter_name: 'scrolls_count', }, }, scroll_panels: { @@ -1318,7 +1006,6 @@ args: { item_name: 'scroll_panel', param_id: 'none', - counter_name: 'scroll_panels_count', }, }, comics: { @@ -1326,7 +1013,6 @@ args: { item_name: 'comic', param_id: 'none', - counter_name: 'comics_count', }, }, comic_stories: { @@ -1334,7 +1020,6 @@ args: { item_name: 'comic_story', param_id: 'none', - counter_name: 'comic_stories_count', }, }, stories: { @@ -1342,7 +1027,6 @@ args: { item_name: 'story', param_id: 'none', - counter_name: 'stories_count', }, }, story_sheets: { @@ -1350,7 +1034,6 @@ args: { item_name: 'story_sheet', param_id: 'none', - counter_name: 'story_sheets_count', }, }, sheets: { @@ -1358,7 +1041,6 @@ args: { item_name: 'sheet', param_id: 'none', - counter_name: 'sheets_count', }, }, sheet_panels: { @@ -1366,7 +1048,6 @@ args: { item_name: 'sheet_panel', param_id: 'none', - counter_name: 'sheet_panels_count', }, }, panels: { @@ -1374,7 +1055,6 @@ args: { item_name: 'panel', param_id: 'none', - counter_name: 'panels_count', }, }, panel_pictures: { @@ -1382,7 +1062,6 @@ args: { item_name: 'panel_picture', param_id: 'none', - counter_name: 'panel_pictures_count', }, }, speech_balloons: { @@ -1390,7 +1069,6 @@ args: { item_name: 'speech_balloon', param_id: 'none', - counter_name: 'speech_balloons_count', }, }, speeches: { @@ -1398,7 +1076,6 @@ args: { item_name: 'speech', param_id: 'none', - counter_name: 'speeches_count', }, }, balloons: { @@ -1406,7 +1083,6 @@ args: { item_name: 'balloon', param_id: 'none', - counter_name: 'balloons_count', }, }, ground_pictures: { @@ -1414,7 +1090,6 @@ args: { item_name: 'ground_picture', param_id: 'none', - counter_name: 'ground_pictures_count', }, }, ground_colors: { @@ -1422,7 +1097,6 @@ args: { item_name: 'ground_color', param_id: 'none', - counter_name: 'ground_colors_count', }, }, original_pictures: { @@ -1430,7 +1104,6 @@ args: { item_name: 'original_picture', param_id: 'none', - counter_name: 'count', }, }, resource_pictures: { @@ -1438,139 +1111,6 @@ args: { item_name: 'resource_picture', param_id: 'none', - counter_name: 'resource_pictures_count', - }, - }, - scrolls_count: { - type: 'count', - args: { - item_name: 'scroll', - param_id: 'none', - }, - }, - scroll_panels_count: { - type: 'count', - args: { - item_name: 'scroll_panel', - param_id: 'none', - }, - }, - comics_count: { - type: 'count', - args: { - item_name: 'comic', - param_id: 'none', - }, - }, - comic_stories_count: { - type: 'count', - args: { - item_name: 'comic_story', - param_id: 'none', - }, - }, - stories_count: { - type: 'count', - args: { - item_name: 'story', - list_name: 'private', - param_id: 'none', - }, - }, - story_sheets_count: { - type: 'count', - args: { - item_name: 'story_sheet', - list_name: 'private', - param_id: 'none', - }, - }, - sheets_count: { - type: 'count', - args: { - item_name: 'sheet', - list_name: 'private', - param_id: 'none', - }, - }, - sheet_panels_count: { - type: 'count', - args: { - item_name: 'sheet_panel', - list_name: 'private', - param_id: 'none', - }, - }, - panels_count: { - type: 'count', - args: { - item_name: 'panel', - list_name: 'private', - param_id: 'none', - }, - }, - panel_pictures_count: { - type: 'count', - args: { - item_name: 'panel_picture', - list_name: 'private', - param_id: 'none', - }, - }, - speech_balloons_count: { - type: 'count', - args: { - item_name: 'speech_balloon', - list_name: 'private', - param_id: 'none', - }, - }, - speeches_count: { - type: 'count', - args: { - item_name: 'speech', - list_name: 'private', - param_id: 'none', - }, - }, - balloons_count: { - type: 'count', - args: { - item_name: 'balloon', - list_name: 'private', - param_id: 'none', - }, - }, - ground_pictures_count: { - type: 'count', - args: { - item_name: 'ground_picture', - list_name: 'private', - param_id: 'none', - }, - }, - ground_colors_count: { - type: 'count', - args: { - item_name: 'ground_color', - list_name: 'private', - param_id: 'none', - }, - }, - original_pictures_count: { - type: 'count', - args: { - item_name: 'original_picture', - list_name: 'private', - param_id: 'none', - }, - }, - resource_pictures_count: { - type: 'count', - args: { - item_name: 'resource_picture', - list_name: 'private', - param_id: 'none', }, }, }, diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index c6c83a9c..dd356509 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -396,14 +396,6 @@ class ApplicationController < ActionController::Base end end - def list_count - set_list - j = {:count => @list.count()} - respond_to do |format| - format.json { render json: j.to_json } - end - end - def format_filer format format.html { @paginate = @@model.list_paginate(@page, @page_size) diff --git a/app/controllers/artists_controller.rb b/app/controllers/artists_controller.rb index 82145f12..83257f2b 100644 --- a/app/controllers/artists_controller.rb +++ b/app/controllers/artists_controller.rb @@ -3,7 +3,9 @@ class ArtistsController < ApplicationController before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy] before_filter :authenticate_artist, :only => [:edit, :update, :destroy] else - before_filter :authenticate_resource_reader, :only => [:index, :show, :resource_pictures] + before_filter :authenticate_resource_reader, :only => [ + :index, :show, :resource_pictures + ] before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy] before_filter :authenticate_artist, :only => [:edit, :update, :destroy] end @@ -26,10 +28,6 @@ class ArtistsController < ApplicationController end end - def count - list_count - end - def new form_new end diff --git a/app/controllers/authors_controller.rb b/app/controllers/authors_controller.rb index 2a3e90d0..e5e5c46c 100644 --- a/app/controllers/authors_controller.rb +++ b/app/controllers/authors_controller.rb @@ -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, :count] + before_filter :authenticate_reader, :only => [:index, :show] before_filter :authenticate_user, :only => [:new, :create, :edit, :update] before_filter :authenticate_author, :only => [:edit, :update] end @@ -26,10 +26,6 @@ class AuthorsController < ApplicationController end end - def count - list_count - end - def new form_new end diff --git a/app/controllers/balloons_controller.rb b/app/controllers/balloons_controller.rb index 6a5637ec..f9079cc1 100644 --- a/app/controllers/balloons_controller.rb +++ b/app/controllers/balloons_controller.rb @@ -4,9 +4,8 @@ class BalloonsController < ApplicationController before_filter :authenticate_author, :only => [:new, :edit, :create, :update, :destroy] else before_filter :authenticate_reader, :only => [ - :index, :show, :count, - :by_author, :by_speech_balloon, :by_speech_balloon_template, :by_system_picture, - :count_by_author, :count_by_speech_balloon, :count_by_speech_balloon_template, :count_by_system_picture + :index, :show, + :by_author, :by_speech_balloon, :by_speech_balloon_template, :by_system_picture ] before_filter :authenticate_user, :only => [:new, :edit, :create, :update, :destroy] before_filter :authenticate_author, :only => [:new, :edit, :create, :update, :destroy] @@ -48,26 +47,6 @@ class BalloonsController < ApplicationController end end - def count - list_count - end - - def count_by_author - list_count - end - - def count_by_speech_balloon - list_count - end - - def count_by_speech_balloon_template - list_count - end - - def count_by_system_picture - list_count - end - def new form_new end diff --git a/app/controllers/comic_stories_controller.rb b/app/controllers/comic_stories_controller.rb index cbb596d2..fd777ec0 100644 --- a/app/controllers/comic_stories_controller.rb +++ b/app/controllers/comic_stories_controller.rb @@ -4,7 +4,7 @@ class ComicStoriesController < ApplicationController before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy] else before_filter :authenticate_reader, :only => [ - :index, :show, :by_story, :by_comic, :by_author, :count, :count_by_story, :count_by_comic, :count_by_author + :index, :show, :by_story, :by_comic, :by_author ] before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy] before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy] @@ -34,18 +34,6 @@ class ComicStoriesController < ApplicationController end end - def count - list_count - end - - def count_by_story - list_count - end - - def count_by_comic - list_count - end - def count_by_author list_count end diff --git a/app/controllers/comics_controller.rb b/app/controllers/comics_controller.rb index 975288b0..61f9ac4e 100644 --- a/app/controllers/comics_controller.rb +++ b/app/controllers/comics_controller.rb @@ -4,7 +4,7 @@ class ComicsController < ApplicationController before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy] else before_filter :authenticate_reader, :only => [ - :index, :show, :play, :by_story, :by_author, :count, :count_by_story, :count_by_author + :index, :show, :play, :by_story, :by_author ] before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy] before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy] @@ -63,18 +63,6 @@ class ComicsController < ApplicationController end end - def count - list_count - end - - def count_by_story - list_count - end - - def count_by_author - list_count - end - def new form_new end diff --git a/app/controllers/ground_colors_controller.rb b/app/controllers/ground_colors_controller.rb index 78c03b44..0f031f96 100644 --- a/app/controllers/ground_colors_controller.rb +++ b/app/controllers/ground_colors_controller.rb @@ -4,7 +4,7 @@ class GroundColorsController < ApplicationController before_filter :authenticate_author, :only => [] else before_filter :authenticate_reader, :only => [ - :index, :show, :by_panel, :by_author, :count, :count_by_panel, :count_by_author + :index, :show, :by_panel, :by_author ] before_filter :authenticate_user, :only => [] before_filter :authenticate_author, :only => [] @@ -37,16 +37,4 @@ class GroundColorsController < ApplicationController end end - def count - list_count - end - - def count_by_panel - list_count - end - - def count_by_author - list_count - end - end diff --git a/app/controllers/ground_pictures_controller.rb b/app/controllers/ground_pictures_controller.rb index 05d3d5eb..db7c5534 100644 --- a/app/controllers/ground_pictures_controller.rb +++ b/app/controllers/ground_pictures_controller.rb @@ -4,7 +4,7 @@ class GroundPicturesController < ApplicationController before_filter :authenticate_author, :only => [] else before_filter :authenticate_reader, :only => [ - :index, :show, :by_panel, :by_author, :count, :count_by_panel, :count_by_author + :index, :show, :by_panel, :by_author ] before_filter :authenticate_user, :only => [] before_filter :authenticate_author, :only => [] @@ -37,16 +37,4 @@ class GroundPicturesController < ApplicationController end end - def count - list_count - end - - def count_by_panel - list_count - end - - def count_by_author - list_count - end - end diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 3ee6e97d..661773bc 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -1,12 +1,14 @@ class HomeController < ApplicationController before_filter :authenticate_user, :only => [ :index, :show, :profile, :configure, :create_token, :delete_token, - :scrolls, :scroll_panels, :comics, :comic_stories, :stories, :story_sheets, :sheets, :sheet_panels, :panels, :panel_pictures, :speech_balloons, :balloons, :speeches, :ground_pictures, :ground_colors, - :scrolls_count, :scroll_panels_count, :comics_count, :comic_stories_count, :stories_count, :story_sheets_count, :sheets_count, :sheet_panels_count, :panels_count, :resource_pictures_count, :panel_pictures_count, :speech_balloons_count, :balloons_count, :speeches_count, :ground_pictures_count, :ground_colors_count + :scrolls, :scroll_panels, :comics, :comic_stories, :stories, :story_sheets, + :sheets, :sheet_panels, + :panels, :panel_pictures, :speech_balloons, :balloons, :speeches, :ground_pictures, :ground_colors ] before_filter :authenticate_author, :only => [ - :scrolls, :scroll_panels, :comics, :comic_stories, :stories, :story_sheets, :sheets, :sheet_panels, :panels, :panel_pictures, :speech_balloons, :balloons, :speeches, :ground_pictures, :ground_colors, - :scrolls_count, :scroll_panels_count, :comics_count, :comic_stories_count, :stories_count, :story_sheets_count, :sheets_count, :sheet_panels_count, :panels_count, :resource_pictures_count, :panel_pictures_count, :speech_balloons_count, :balloons_count, :speeches_count, :ground_pictures_count, :ground_colors_count + :scrolls, :scroll_panels, :comics, :comic_stories, :stories, :story_sheets, + :sheets, :sheet_panels, + :panels, :panel_pictures, :speech_balloons, :balloons, :speeches, :ground_pictures, :ground_colors ] before_filter :authenticate_artist, :only => [:resource_pictures] @@ -121,64 +123,4 @@ class HomeController < ApplicationController filer_list end - def scrolls_count - list_count - end - - def scroll_panels_count - list_count - end - - def comics_count - list_count - end - - def comic_stories_count - list_count - end - - def stories_count - list_count - end - - def story_sheets_count - list_count - end - - def sheets_count - list_count - end - - def sheet_panels_count - list_count - end - - def panels_count - list_count - end - - def panel_pictures_count - list_count - end - - def balloons_count - list_count - end - - def speeches_count - list_count - end - - def ground_pictures_count - list_count - end - - def ground_colors_count - list_count - end - - def resource_pictures_count - list_count - end - end diff --git a/app/controllers/license_groups_controller.rb b/app/controllers/license_groups_controller.rb index 7c852cf2..2b12b4a3 100644 --- a/app/controllers/license_groups_controller.rb +++ b/app/controllers/license_groups_controller.rb @@ -2,8 +2,7 @@ class LicenseGroupsController < ApplicationController if Manifest.manifest.magic_numbers['run_mode'] == 0 else before_filter :authenticate_reader, :only => [ - :by_resource_picture, - :count_by_resource_picture, + :by_resource_picture ] end before_filter :authenticate_admin, :only => [:new, :create, :edit, :update, :destroy] @@ -31,14 +30,6 @@ class LicenseGroupsController < ApplicationController end end - def count - list_count - end - - def count_by_resource_picture - list_count - end - def new form_new end diff --git a/app/controllers/licenses_controller.rb b/app/controllers/licenses_controller.rb index f47a1451..f781d0f9 100644 --- a/app/controllers/licenses_controller.rb +++ b/app/controllers/licenses_controller.rb @@ -1,6 +1,6 @@ class LicensesController < ApplicationController before_filter :authenticate_resource_reader, :only => [ - :by_license_group, :by_system_picture, :count_by_license_group, :count_by_system_picture + :by_license_group, :by_system_picture ] before_filter :authenticate_admin, :only => [:new, :create, :edit, :update, :destroy] @@ -40,18 +40,6 @@ 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 - def new form_new end diff --git a/app/controllers/original_pictures_controller.rb b/app/controllers/original_pictures_controller.rb index 92a5ab84..db1c5048 100644 --- a/app/controllers/original_pictures_controller.rb +++ b/app/controllers/original_pictures_controller.rb @@ -1,6 +1,6 @@ #原画 class OriginalPicturesController < ApplicationController - before_filter :authenticate_reader, :only => [:show, :history, :count] + before_filter :authenticate_reader, :only => [:show, :history] before_filter :authenticate_user, :only => [:index, :new, :edit, :create, :update, :destroy] before_filter :authenticate_artist, :only => [:index, :new, :edit, :create, :update, :destroy] @@ -45,10 +45,6 @@ class OriginalPicturesController < ApplicationController end end - def count - list_count - end - def new set_new respond_to do |format| diff --git a/app/controllers/panel_pictures_controller.rb b/app/controllers/panel_pictures_controller.rb index 5c666e0a..3ae4dac9 100644 --- a/app/controllers/panel_pictures_controller.rb +++ b/app/controllers/panel_pictures_controller.rb @@ -4,7 +4,7 @@ class PanelPicturesController < ApplicationController before_filter :authenticate_author, :only => [] else before_filter :authenticate_reader, :only => [ - :index, :show, :by_panel, :by_author, :count, :count_by_panel, :count_by_author + :index, :show, :by_panel, :by_author ] before_filter :authenticate_user, :only => [] before_filter :authenticate_author, :only => [] @@ -37,16 +37,4 @@ class PanelPicturesController < ApplicationController end end - def count - list_count - end - - def count_by_panel - list_count - end - - def count_by_author - list_count - end - end diff --git a/app/controllers/panels_controller.rb b/app/controllers/panels_controller.rb index 25898512..8d5d44b3 100644 --- a/app/controllers/panels_controller.rb +++ b/app/controllers/panels_controller.rb @@ -69,26 +69,6 @@ class PanelsController < ApplicationController end end end - - def count - 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 count_by_speech_balloon_template - list_count - end def new set_new diff --git a/app/controllers/pictures_controller.rb b/app/controllers/pictures_controller.rb index 497aba6e..1dd8e5bb 100644 --- a/app/controllers/pictures_controller.rb +++ b/app/controllers/pictures_controller.rb @@ -4,10 +4,12 @@ class PicturesController < ApplicationController before_filter :authenticate_author, :only => [] else before_filter :authenticate_user, :only => [] - before_filter :authenticate_resource_reader, :only => [:show, :credit, :search] + before_filter :authenticate_resource_reader, :only => [ + :show, :credit, :search + ] before_filter :authenticate_author, :only => [] end - before_filter :authenticate_admin, :only => [:index, :by_artist, :count, :count_by_artist] + before_filter :authenticate_admin, :only => [:index, :by_artist ] def index filer_list @@ -55,12 +57,4 @@ class PicturesController < ApplicationController end end - def count - list_count - end - - def count_by_artist - list_count - end - end diff --git a/app/controllers/resource_pictures_controller.rb b/app/controllers/resource_pictures_controller.rb index e2ee9dd9..cf5c3a5d 100644 --- a/app/controllers/resource_pictures_controller.rb +++ b/app/controllers/resource_pictures_controller.rb @@ -4,9 +4,8 @@ class ResourcePicturesController < ApplicationController before_filter :authenticate_artist, :only => [:new, :create, :update, :destroy] else before_filter :authenticate_resource_reader, :only => [ - :index, :show, :credit, :count, - :by_original_picture, :by_license_group, :by_license, :by_artist, - :count_by_original_picture, :count_by_license_group, :count_by_license, :count_by_artist + :index, :show, :credit, + :by_original_picture, :by_license_group, :by_license, :by_artist ] before_filter :authenticate_user, :only => [:new, :create, :update, :destroy] before_filter :authenticate_artist, :only => [:new, :create, :update, :destroy] @@ -59,26 +58,6 @@ class ResourcePicturesController < ApplicationController end end - def count - list_count - end - - def count_by_original_picture - list_count - end - - def count_by_license_group - list_count - end - - def count_by_license - list_count - end - - def count_by_artist - list_count - end - def new # use @item, @original_picture respond_to do |format| diff --git a/app/controllers/scroll_panels_controller.rb b/app/controllers/scroll_panels_controller.rb index 21d4d142..e0fbda4e 100644 --- a/app/controllers/scroll_panels_controller.rb +++ b/app/controllers/scroll_panels_controller.rb @@ -4,7 +4,7 @@ class ScrollPanelsController < ApplicationController before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy] else before_filter :authenticate_reader, :only => [ - :index, :show, :by_panel, :by_scroll, :by_author, :play, :count, :count_by_panel, :count_by_scroll, :count_by_author, :play + :index, :show, :by_panel, :by_scroll, :by_author, :play :play ] before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy] before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy] @@ -38,26 +38,6 @@ 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 count_by_author - list_count - end - - def count_play - list_count - end - def new form_new end diff --git a/app/controllers/scrolls_controller.rb b/app/controllers/scrolls_controller.rb index 3c88b607..0f69df7e 100644 --- a/app/controllers/scrolls_controller.rb +++ b/app/controllers/scrolls_controller.rb @@ -55,22 +55,6 @@ class ScrollsController < ApplicationController end end - def count - list_count - end - - def count_by_author - list_count - end - - def count_by_panel - list_count - end - - def count_play - list_count - end - def new form_new end diff --git a/app/controllers/sheet_panels_controller.rb b/app/controllers/sheet_panels_controller.rb index 703f409e..752fb287 100644 --- a/app/controllers/sheet_panels_controller.rb +++ b/app/controllers/sheet_panels_controller.rb @@ -4,7 +4,7 @@ class SheetPanelsController < ApplicationController before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy] else before_filter :authenticate_reader, :only => [ - :index, :show, :by_sheet, :by_panel, :by_author, :count, :count_by_sheet, :count_by_panel, :count_by_author + :index, :show, :by_sheet, :by_panel, :by_author ] before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy] before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy] @@ -34,22 +34,6 @@ 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 count_by_author - list_count - end - def new form_new end diff --git a/app/controllers/sheets_controller.rb b/app/controllers/sheets_controller.rb index 8564d06c..6114a13a 100644 --- a/app/controllers/sheets_controller.rb +++ b/app/controllers/sheets_controller.rb @@ -4,7 +4,7 @@ class SheetsController < ApplicationController before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy] else before_filter :authenticate_reader, :only => [ - :index, :show, :play, :by_story, :by_panel, :by_author, :count, :count_by_story, :count_by_panel, :count_by_author + :index, :show, :play, :by_story, :by_panel, :by_author ] before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy] before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy] @@ -61,22 +61,6 @@ class SheetsController < ApplicationController end end - def count - 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 set_new respond_to do |format| diff --git a/app/controllers/speech_balloon_templates_controller.rb b/app/controllers/speech_balloon_templates_controller.rb index 0b2d0249..42b1724e 100644 --- a/app/controllers/speech_balloon_templates_controller.rb +++ b/app/controllers/speech_balloon_templates_controller.rb @@ -3,7 +3,7 @@ class SpeechBalloonTemplatesController < ApplicationController before_filter :authenticate_user, :only => [] else before_filter :authenticate_reader, :only => [ - :index, :show, :by_panel, :by_system_picture, :count, :count_by_panel, :count_by_system_picture + :index, :show, :by_panel, :by_system_picture ] before_filter :authenticate_user, :only => [] end @@ -35,18 +35,6 @@ class SpeechBalloonTemplatesController < ApplicationController end end - def count - list_count - end - - def count_by_panel - list_count - end - - def count_by_system_picture - list_count - end - def new form_new end diff --git a/app/controllers/speech_balloons_controller.rb b/app/controllers/speech_balloons_controller.rb index 1d1a523b..3b8e4002 100644 --- a/app/controllers/speech_balloons_controller.rb +++ b/app/controllers/speech_balloons_controller.rb @@ -4,7 +4,7 @@ class SpeechBalloonsController < ApplicationController before_filter :authenticate_author, :only => [] else before_filter :authenticate_reader, :only => [ - :index, :show, :by_panel, :by_author, :by_speech_balloon_template, :count, :count_by_panel, :count_by_author, :count_by_speech_balloon_template + :index, :show, :by_panel, :by_author, :by_speech_balloon_template ] before_filter :authenticate_user, :only => [] before_filter :authenticate_author, :only => [] @@ -42,20 +42,4 @@ 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 count_by_speech_balloon_template - list_count - end - end diff --git a/app/controllers/speeches_controller.rb b/app/controllers/speeches_controller.rb index 601444df..fb37d662 100644 --- a/app/controllers/speeches_controller.rb +++ b/app/controllers/speeches_controller.rb @@ -4,9 +4,8 @@ class SpeechesController < ApplicationController before_filter :authenticate_author, :only => [:new, :edit, :create, :update, :destroy] else before_filter :authenticate_reader, :only => [ - :index, :show, :count, - :by_author, :by_speech_balloon, :by_speech_balloon_template, :by_writing_format, - :count_by_author, :count_by_speech_balloon, :count_by_speech_balloon_template, :count_by_writing_format + :index, :show, + :by_author, :by_speech_balloon, :by_speech_balloon_template, :by_writing_format ] before_filter :authenticate_user, :only => [:new, :edit, :create, :update, :destroy] before_filter :authenticate_author, :only => [:new, :edit, :create, :update, :destroy] @@ -49,26 +48,6 @@ class SpeechesController < ApplicationController end end - def count - list_count - end - - def count_by_author - list_count - end - - def count_by_speech_balloon - list_count - end - - def count_by_speech_balloon_template - list_count - end - - def count_by_writing_format - list_count - end - def new form_new end diff --git a/app/controllers/stories_controller.rb b/app/controllers/stories_controller.rb index 6e473f1e..009c38cd 100644 --- a/app/controllers/stories_controller.rb +++ b/app/controllers/stories_controller.rb @@ -4,7 +4,7 @@ class StoriesController < ApplicationController before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy] else before_filter :authenticate_reader, :only => [ - :index, :show, :play, :by_comic, :by_sheet, :by_author, :count, :count_by_comic, :count_by_sheet, :count_by_author + :index, :show, :play, :by_comic, :by_sheet, :by_author ] before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy] before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy] @@ -68,22 +68,6 @@ 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 form_new end diff --git a/app/controllers/story_sheets_controller.rb b/app/controllers/story_sheets_controller.rb index c1b74e07..748f195f 100644 --- a/app/controllers/story_sheets_controller.rb +++ b/app/controllers/story_sheets_controller.rb @@ -4,7 +4,7 @@ class StorySheetsController < ApplicationController before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy] else before_filter :authenticate_reader, :only => [ - :index, :show, :by_story, :by_sheet, :by_author, :count, :count_by_story, :count_by_sheet, :count_by_author + :index, :show, :by_story, :by_sheet, :by_author ] before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy] before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy] @@ -34,22 +34,6 @@ 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 count_by_author - list_count - end - def new form_new end diff --git a/app/controllers/system_pictures_controller.rb b/app/controllers/system_pictures_controller.rb index a0175e1d..3917ca62 100644 --- a/app/controllers/system_pictures_controller.rb +++ b/app/controllers/system_pictures_controller.rb @@ -3,7 +3,7 @@ class SystemPicturesController < ApplicationController before_filter :authenticate_user, :only => [] before_filter :authenticate_author, :only => [] else - before_filter :authenticate_resource_reader, :only => [:index, :show, :count] + before_filter :authenticate_resource_reader, :only => [:index, :show] before_filter :authenticate_user, :only => [] before_filter :authenticate_author, :only => [] end diff --git a/app/controllers/writing_formats_controller.rb b/app/controllers/writing_formats_controller.rb index a6efeb6c..cdb27e5b 100644 --- a/app/controllers/writing_formats_controller.rb +++ b/app/controllers/writing_formats_controller.rb @@ -2,7 +2,9 @@ class WritingFormatsController < ApplicationController if Manifest.manifest.magic_numbers['run_mode'] == 0 before_filter :authenticate_user, :only => [] else - before_filter :authenticate_reader, :only => [:index, :by_system_picture, :show, :count, :count_by_system_picture] + before_filter :authenticate_reader, :only => [ + :index, :by_system_picture, :show + ] before_filter :authenticate_user, :only => [] end before_filter :authenticate_admin, :only => [:new, :create, :edit, :update, :destroy] @@ -29,14 +31,6 @@ class WritingFormatsController < ApplicationController end end - def count - list_count - end - - def count_by_system_picture - list_count - end - def new form_new end diff --git a/config/routes.rb b/config/routes.rb index c15a6927..bbc107c2 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -21,7 +21,6 @@ Pettanr::Application.routes.draw do get :index get :watch get :show - get :count post :create end member do @@ -37,20 +36,15 @@ Pettanr::Application.routes.draw do collection do get :index get :show - get :count post :create end member do get :by_author get :by_panel - get :count_by_author - get :count_by_panel - get :count_play get :play get :edit put :update delete :destroy - get :browse end end resources :scroll_panels do @@ -60,7 +54,6 @@ Pettanr::Application.routes.draw do collection do get :index get :show - get :count post :create end member do @@ -68,10 +61,6 @@ Pettanr::Application.routes.draw do get :by_scroll get :by_author get :play - get :count_by_panel - get :count_by_scroll - get :count_by_author - get :count_play get :edit put :update delete :destroy @@ -84,14 +73,11 @@ Pettanr::Application.routes.draw do collection do get :index get :show - get :count post :create end member do get :by_author get :by_story - get :count_by_author - get :count_by_story get :play get :edit put :update @@ -105,16 +91,12 @@ Pettanr::Application.routes.draw do collection do get :index get :show - get :count post :create end member do get :by_comic get :by_story get :by_author - get :count_by_comic - get :count_by_story - get :count_by_author get :edit put :update delete :destroy @@ -127,16 +109,12 @@ Pettanr::Application.routes.draw do collection do get :index get :show - get :count post :create end member do get :by_comic get :by_sheet get :by_author - get :count_by_comic - get :count_by_sheet - get :count_by_author get :play get :edit put :update @@ -150,16 +128,12 @@ Pettanr::Application.routes.draw do collection do get :index get :show - get :count post :create end member do get :by_story get :by_sheet get :by_author - get :count_by_story - get :count_by_sheet - get :count_by_author get :edit put :update delete :destroy @@ -172,7 +146,6 @@ Pettanr::Application.routes.draw do collection do get :index get :show - get :count post :create end member do @@ -183,9 +156,6 @@ Pettanr::Application.routes.draw do get :by_story get :by_panel get :by_author - get :count_by_story - get :count_by_panel - get :count_by_author get :play get :edit put :update @@ -199,16 +169,12 @@ Pettanr::Application.routes.draw do collection do get :index get :show - get :count post :create end member do get :by_sheet get :by_panel get :by_author - get :count_by_sheet - get :count_by_panel - get :count_by_author get :edit put :update delete :destroy @@ -221,7 +187,6 @@ Pettanr::Application.routes.draw do collection do get :index get :show - get :count post :create end member do @@ -229,10 +194,6 @@ Pettanr::Application.routes.draw do get :by_sheet get :by_author get :by_speech_balloon_template - get :count_by_scroll - get :count_by_sheet - get :count_by_author - get :count_by_speech_balloon_template get :catch get :edit put :update @@ -246,14 +207,11 @@ Pettanr::Application.routes.draw do collection do get :index get :show - get :count post :create end member do get :by_panel get :by_author - get :count_by_panel - get :count_by_author get :edit put :update delete :destroy @@ -266,16 +224,12 @@ Pettanr::Application.routes.draw do collection do get :index get :show - get :count post :create end member do get :by_panel get :by_author get :by_speech_balloon_template - get :count_by_panel - get :count_by_author - get :count_by_speech_balloon_template get :edit put :update delete :destroy @@ -285,17 +239,12 @@ Pettanr::Application.routes.draw do collection do get :index get :show - get :count end member do get :by_author get :by_speech_balloon get :by_speech_balloon_template get :by_system_picture - get :count_by_author - get :count_by_speech_balloon - get :count_by_speech_balloon_template - get :count_by_system_picture get :edit put :update end @@ -304,7 +253,6 @@ Pettanr::Application.routes.draw do collection do get :index get :show - get :count end member do get :by_author @@ -312,10 +260,6 @@ Pettanr::Application.routes.draw do get :by_author get :by_speech_balloon_template get :by_writing_format - get :count_by_author - get :count_by_speech_balloon - get :count_by_speech_balloon_template - get :count_by_writing_format get :edit put :update end @@ -327,13 +271,10 @@ Pettanr::Application.routes.draw do collection do get :index get :show - get :count end member do get :by_panel get :by_author - get :count_by_panel - get :count_by_author get :edit put :update delete :destroy @@ -346,13 +287,10 @@ Pettanr::Application.routes.draw do collection do get :index get :show - get :count end member do get :by_panel get :by_author - get :count_by_panel - get :count_by_author get :edit put :update delete :destroy @@ -365,7 +303,6 @@ Pettanr::Application.routes.draw do collection do get :index get :show - get :count post :create end member do @@ -379,13 +316,11 @@ Pettanr::Application.routes.draw do collection do get :index get :show - get :count get :credit get :search end member do get :by_artist - get :count_by_artist get :credit end end @@ -393,20 +328,14 @@ Pettanr::Application.routes.draw do collection do get :index get :show - get :count get :new post :create - get :count end member do get :by_original_picture get :by_license_group get :by_license get :by_artist - get :count_by_original_picture - get :count_by_license_group - get :count_by_license - get :count_by_artist delete :destroy get :credit end @@ -415,14 +344,11 @@ Pettanr::Application.routes.draw do collection do get :index get :show - get :count post :create end member do get :by_panel get :by_system_picture - get :count_by_system_picture - get :count_by_panel put :update delete :destroy end @@ -431,14 +357,12 @@ Pettanr::Application.routes.draw do collection do get :index get :show - get :count post :create end member do get :speeches get :by_system_picture get :speeches_count - get :count_by_system_picture put :update delete :destroy end @@ -447,12 +371,10 @@ Pettanr::Application.routes.draw do collection do get :index get :show - get :count post :create end member do get :by_resource_picture - get :count_by_resource_picture put :update delete :destroy end @@ -461,7 +383,6 @@ Pettanr::Application.routes.draw do collection do get :index get :show - get :count get :search post :create end @@ -470,8 +391,6 @@ Pettanr::Application.routes.draw do get :by_license_group get :by_system_picture get :resource_pictures_count - get :count_by_license_group - get :count_by_system_picture put :update delete :destroy end @@ -483,7 +402,6 @@ Pettanr::Application.routes.draw do collection do get :index get :show - get :count post :create end member do @@ -499,7 +417,6 @@ Pettanr::Application.routes.draw do collection do get :index get :show - get :count post :create end member do @@ -512,14 +429,11 @@ Pettanr::Application.routes.draw do collection do get :index get :show - get :count end member do #get :balloons get :speech_balloon_templates get :licenses - get :speech_balloon_templates_count - get :licenses_count delete :destroy end end diff --git a/lib/locmare/filer.rb b/lib/locmare/filer.rb index 610f0c09..0222235b 100644 --- a/lib/locmare/filer.rb +++ b/lib/locmare/filer.rb @@ -1,6 +1,5 @@ require_dependency "locmare/filer/header" require_dependency "locmare/filer/body" -require_dependency "locmare/filer/pager" module Locmare class Filer include FilerModule diff --git a/lib/locmare/filer/pager.rb b/lib/locmare/filer/pager.rb deleted file mode 100644 index d98b937e..00000000 --- a/lib/locmare/filer/pager.rb +++ /dev/null @@ -1,54 +0,0 @@ -module Locmare - module FilerModule - class Pager - attr :filer - - def initialize filer - @filer = filer - end - - def list_result - @filer.list_result - end - - def api_path - list_result.path - end - - def template_dir - @filer.template_dir + "pager/" - end - - def template_name - self.template_dir + self.template_file_name - end - - end - - class NonePager < Pager - def template_file_name - "none" - end - - end - - class DefaultPager < Pager - def template_file_name - "default" - end - - def paginate - list_result.paginate - end - - end - - class MorePager < Pager - def template_file_name - "more" - end - - end - - end -end diff --git a/lib/locmare/list_group/lib/page_status.rb b/lib/locmare/list_group/lib/page_status.rb index ee726b93..0c58d0a9 100644 --- a/lib/locmare/list_group/lib/page_status.rb +++ b/lib/locmare/list_group/lib/page_status.rb @@ -187,6 +187,7 @@ module Locmare end def self.load list, total, options + return nil if total == 0 ps = if self.offset(options) or self.count(options) Offset.new list, total, options else diff --git a/lib/locmare/list_group/list/base.rb b/lib/locmare/list_group/list/base.rb index e899fd4a..e9fbbc93 100644 --- a/lib/locmare/list_group/list/base.rb +++ b/lib/locmare/list_group/list/base.rb @@ -92,6 +92,7 @@ module Locmare end def items + return [] unless @page_status @items ||= @model.where( self.where_condition ).includes( diff --git a/lib/locmare/list_group/list/filter.rb b/lib/locmare/list_group/list/filter.rb index 1e8d69c1..97200dd8 100644 --- a/lib/locmare/list_group/list/filter.rb +++ b/lib/locmare/list_group/list/filter.rb @@ -33,32 +33,6 @@ module Locmare r end - def items - if self.visible? - @model.where( - self.where_condition - ).includes( - self.include_hash - ).order( - self.order_by - ).offset(@offset).limit(@limit) - else - [] - end - end - - def count - if self.visible? - @model.where( - self.where_condition - ).includes( - self.include_hash - ).count - else - 0 - end - end - end end diff --git a/lib/locmare/profiler/association/has_many.rb b/lib/locmare/profiler/association/has_many.rb index e611743f..e887d4a0 100644 --- a/lib/locmare/profiler/association/has_many.rb +++ b/lib/locmare/profiler/association/has_many.rb @@ -25,7 +25,7 @@ module Locmare ) ::Locmare::Filer.new( self.has_many_model.item_name, list.items, - list.page_status, self.profiler.operators + nil, self.profiler.operators ) end diff --git a/lib/manifest/controller/action.rb b/lib/manifest/controller/action.rb index 33acd583..81e88a67 100644 --- a/lib/manifest/controller/action.rb +++ b/lib/manifest/controller/action.rb @@ -1,5 +1,5 @@ ManifestBase.require_modules "manifest/controller/action/", - %w|base list show count new edit create update destroy| + %w|base list show new edit create update destroy| module Manifest module ControllerModule @@ -8,7 +8,7 @@ module Manifest def self.types { - 'list' => ActionList, 'show' => ActionShow, 'count' => ActionCount, + 'list' => ActionList, 'show' => ActionShow, 'new' => ActionNew, 'edit' => ActionEdit, 'create' => ActionCreate, 'update' => ActionUpdate, 'destroy' => ActionDestroy } diff --git a/lib/manifest/controller/action/count.rb b/lib/manifest/controller/action/count.rb deleted file mode 100644 index 189d69e5..00000000 --- a/lib/manifest/controller/action/count.rb +++ /dev/null @@ -1,21 +0,0 @@ -module Manifest - module ControllerModule - module ActionModule - class ActionCount < Base - attr :alias - - def set_default - super - @args['action_name'] ||= @name.gsub(/^count_/, '') - end - - def init - super - @action_name = @args['action_name'] - end - - end - - end - end -end diff --git a/lib/manifest/controller/action/list.rb b/lib/manifest/controller/action/list.rb index 0475a498..3a544837 100644 --- a/lib/manifest/controller/action/list.rb +++ b/lib/manifest/controller/action/list.rb @@ -18,15 +18,6 @@ module Manifest @direction = @args['direction'].to_i @default_page_size = @args['default_page_size'] @max_page_size = @args['max_page_size'] - @counter_name = if @args['counter_name'] - @args['counter_name'] - else - if @name == 'index' - 'count' - else - 'count_' + @name - end - end end def alias_action @@ -35,11 +26,6 @@ module Manifest c.actions[s[1]] end - def counter_url params - action_manifest = @parent.actions[@counter_name] - self.encode_url(params) - end - end end diff --git a/lib/manifest/system_resource.rb b/lib/manifest/system_resource.rb index b7651467..120902a6 100644 --- a/lib/manifest/system_resource.rb +++ b/lib/manifest/system_resource.rb @@ -44,11 +44,10 @@ module Manifest resource_controller_name, resource_action_name, nil, - {} # set no limit options + {:page_size => -1} # set no limit options ) - r = list.open nil @select_items[source_manifest.select_item_name] = - r.items.map {|item| [item.attributes[caption], item.id]} + list.items.map {|item| [item.attributes[caption], item.id]} rescue puts 'skip store select_items:' + resource_item_name + '.' + resource_action_name end diff --git a/public/manifest.json b/public/manifest.json index fdb3624a..da1b7f76 100644 --- a/public/manifest.json +++ b/public/manifest.json @@ -254,12 +254,6 @@ "watch": { "type": "show" }, - "count": { - "type": "count", - "args": { - "action_name": "index" - } - }, "new": { "type": "new" }, @@ -302,18 +296,6 @@ "show": { "type": "show" }, - "count": { - "type": "count", - "args": { - "action_name": "index" - } - }, - "count_by_author": { - "type": "count" - }, - "count_by_panel": { - "type": "count" - }, "new": { "type": "new" }, @@ -360,21 +342,6 @@ "show": { "type": "show" }, - "count": { - "type": "count", - "args": { - "action_name": "index" - } - }, - "count_by_panel": { - "type": "count" - }, - "count_by_scroll": { - "type": "count" - }, - "count_by_author": { - "type": "count" - }, "new": { "type": "new" }, @@ -423,18 +390,6 @@ "show": { "type": "show" }, - "count": { - "type": "count", - "args": { - "action_name": "index" - } - }, - "count_by_story": { - "type": "count" - }, - "count_by_author": { - "type": "count" - }, "new": { "type": "new" }, @@ -481,21 +436,6 @@ "show": { "type": "show" }, - "count": { - "type": "count", - "args": { - "action_name": "index" - } - }, - "count_by_comic": { - "type": "count" - }, - "count_by_story": { - "type": "count" - }, - "count_by_author": { - "type": "count" - }, "new": { "type": "new" }, @@ -550,21 +490,6 @@ "show": { "type": "show" }, - "count": { - "type": "count", - "args": { - "action_name": "index" - } - }, - "count_by_comic": { - "type": "count" - }, - "count_by_sheet": { - "type": "count" - }, - "count_by_author": { - "type": "count" - }, "new": { "type": "new" }, @@ -611,21 +536,6 @@ "show": { "type": "show" }, - "count": { - "type": "count", - "args": { - "action_name": "index" - } - }, - "count_by_story": { - "type": "count" - }, - "count_by_sheet": { - "type": "count" - }, - "count_by_author": { - "type": "count" - }, "new": { "type": "new" }, @@ -680,21 +590,6 @@ "show": { "type": "show" }, - "count": { - "type": "count", - "args": { - "action_name": "index" - } - }, - "count_by_story": { - "type": "count" - }, - "count_by_panel": { - "type": "count" - }, - "count_by_author": { - "type": "count" - }, "new": { "type": "new" }, @@ -741,21 +636,6 @@ "show": { "type": "show" }, - "count": { - "type": "count", - "args": { - "action_name": "index" - } - }, - "count_by_sheet": { - "type": "count" - }, - "count_by_panel": { - "type": "count" - }, - "count_by_author": { - "type": "count" - }, "new": { "type": "new" }, @@ -808,24 +688,6 @@ "show": { "type": "show" }, - "count": { - "type": "count", - "args": { - "action_name": "index" - } - }, - "count_by_scroll": { - "type": "count" - }, - "count_by_sheet": { - "type": "count" - }, - "count_by_author": { - "type": "count" - }, - "count_by_speech_balloon_template": { - "type": "count" - }, "new": { "type": "new" }, @@ -866,18 +728,6 @@ "show": { "type": "show" }, - "count": { - "type": "count", - "args": { - "action_name": "index" - } - }, - "count_by_panel": { - "type": "count" - }, - "count_by_author": { - "type": "count" - }, "new": { "type": "new" }, @@ -915,21 +765,6 @@ "show": { "type": "show" }, - "count": { - "type": "count", - "args": { - "action_name": "index" - } - }, - "count_by_panel": { - "type": "count" - }, - "count_by_author": { - "type": "count" - }, - "count_by_speech_balloon_template": { - "type": "count" - }, "new": { "type": "new" }, @@ -973,24 +808,6 @@ "show": { "type": "show" }, - "count": { - "type": "count", - "args": { - "action_name": "index" - } - }, - "count_by_author": { - "type": "count" - }, - "count_by_speech_balloon": { - "type": "count" - }, - "count_by_speech_balloon_template": { - "type": "count" - }, - "count_by_writing_format": { - "type": "count" - }, "new": { "type": "new" }, @@ -1034,24 +851,6 @@ "show": { "type": "show" }, - "count": { - "type": "count", - "args": { - "action_name": "index" - } - }, - "count_by_author": { - "type": "count" - }, - "count_by_speech_balloon": { - "type": "count" - }, - "count_by_speech_balloon_template": { - "type": "count" - }, - "count_by_system_picture": { - "type": "count" - }, "new": { "type": "new" }, @@ -1083,18 +882,6 @@ "show": { "type": "show" }, - "count": { - "type": "count", - "args": { - "action_name": "index" - } - }, - "count_by_panel": { - "type": "count" - }, - "count_by_author": { - "type": "count" - }, "new": { "type": "new" }, @@ -1126,18 +913,6 @@ "show": { "type": "show" }, - "count": { - "type": "count", - "args": { - "action_name": "index" - } - }, - "count_by_panel": { - "type": "count" - }, - "count_by_author": { - "type": "count" - }, "new": { "type": "new" }, @@ -1160,12 +935,6 @@ "history": { "type": "show" }, - "count": { - "type": "count", - "args": { - "action_name": "index" - } - }, "new": { "type": "new" }, @@ -1199,15 +968,6 @@ }, "show": { "type": "show" - }, - "count": { - "type": "count", - "args": { - "action_name": "index" - } - }, - "count_by_artist": { - "type": "count" } } }, @@ -1245,24 +1005,6 @@ }, "show": { "type": "show" - }, - "count": { - "type": "count", - "args": { - "action_name": "index" - } - }, - "count_by_original_picture": { - "type": "count" - }, - "count_by_license_group": { - "type": "count" - }, - "count_by_license": { - "type": "count" - }, - "count_by_artist": { - "type": "count" } } }, @@ -1271,7 +1013,8 @@ "index": { "type": "list", "args": { - "param_id": "none" + "param_id": "none", + "max_page_size": -1 } }, "by_panel": { @@ -1289,15 +1032,6 @@ "show": { "type": "show" }, - "count": { - "type": "count", - "args": { - "action_name": "index" - } - }, - "count_by_panel": { - "type": "count" - }, "new": { "type": "new" }, @@ -1320,7 +1054,8 @@ "index": { "type": "list", "args": { - "param_id": "none" + "param_id": "none", + "max_page_size": -1 } }, "by_system_picture": { @@ -1332,15 +1067,6 @@ "show": { "type": "show" }, - "count": { - "type": "count", - "args": { - "action_name": "index" - } - }, - "count_by_system_picture": { - "type": "count" - }, "new": { "type": "new" }, @@ -1363,7 +1089,8 @@ "index": { "type": "list", "args": { - "param_id": "none" + "param_id": "none", + "max_page_size": -1 } }, "by_resource_picture": { @@ -1375,15 +1102,6 @@ "show": { "type": "show" }, - "count": { - "type": "count", - "args": { - "action_name": "index" - } - }, - "count_by_resource_picture": { - "type": "count" - }, "new": { "type": "new" }, @@ -1406,7 +1124,8 @@ "index": { "type": "list", "args": { - "param_id": "none" + "param_id": "none", + "max_page_size": -1 } }, "by_license_group": { @@ -1424,18 +1143,6 @@ "show": { "type": "show" }, - "count": { - "type": "count", - "args": { - "action_name": "index" - } - }, - "count_by_license_group": { - "type": "count" - }, - "count_by_system_picture": { - "type": "count" - }, "new": { "type": "new" }, @@ -1464,12 +1171,6 @@ "show": { "type": "show" }, - "count": { - "type": "count", - "args": { - "action_name": "index" - } - }, "new": { "type": "new" }, @@ -1498,12 +1199,6 @@ "show": { "type": "show" }, - "count": { - "type": "count", - "args": { - "action_name": "index" - } - }, "new": { "type": "new" }, @@ -1531,12 +1226,6 @@ }, "show": { "type": "show" - }, - "count": { - "type": "count", - "args": { - "action_name": "index" - } } } }, @@ -1546,267 +1235,118 @@ "type": "list", "args": { "item_name": "scroll", - "param_id": "none", - "counter_name": "scrolls_count" + "param_id": "none" } }, "scroll_panels": { "type": "list", "args": { "item_name": "scroll_panel", - "param_id": "none", - "counter_name": "scroll_panels_count" + "param_id": "none" } }, "comics": { "type": "list", "args": { "item_name": "comic", - "param_id": "none", - "counter_name": "comics_count" + "param_id": "none" } }, "comic_stories": { "type": "list", "args": { "item_name": "comic_story", - "param_id": "none", - "counter_name": "comic_stories_count" + "param_id": "none" } }, "stories": { "type": "list", "args": { "item_name": "story", - "param_id": "none", - "counter_name": "stories_count" + "param_id": "none" } }, "story_sheets": { "type": "list", "args": { "item_name": "story_sheet", - "param_id": "none", - "counter_name": "story_sheets_count" + "param_id": "none" } }, "sheets": { "type": "list", "args": { "item_name": "sheet", - "param_id": "none", - "counter_name": "sheets_count" + "param_id": "none" } }, "sheet_panels": { "type": "list", "args": { "item_name": "sheet_panel", - "param_id": "none", - "counter_name": "sheet_panels_count" + "param_id": "none" } }, "panels": { "type": "list", "args": { "item_name": "panel", - "param_id": "none", - "counter_name": "panels_count" + "param_id": "none" } }, "panel_pictures": { "type": "list", "args": { "item_name": "panel_picture", - "param_id": "none", - "counter_name": "panel_pictures_count" + "param_id": "none" } }, "speech_balloons": { "type": "list", "args": { "item_name": "speech_balloon", - "param_id": "none", - "counter_name": "speech_balloons_count" + "param_id": "none" } }, "speeches": { "type": "list", "args": { "item_name": "speech", - "param_id": "none", - "counter_name": "speeches_count" + "param_id": "none" } }, "balloons": { "type": "list", "args": { "item_name": "balloon", - "param_id": "none", - "counter_name": "balloons_count" + "param_id": "none" } }, "ground_pictures": { "type": "list", "args": { "item_name": "ground_picture", - "param_id": "none", - "counter_name": "ground_pictures_count" + "param_id": "none" } }, "ground_colors": { "type": "list", "args": { "item_name": "ground_color", - "param_id": "none", - "counter_name": "ground_colors_count" + "param_id": "none" } }, "original_pictures": { "type": "list", "args": { "item_name": "original_picture", - "param_id": "none", - "counter_name": "count" + "param_id": "none" } }, "resource_pictures": { "type": "list", "args": { "item_name": "resource_picture", - "param_id": "none", - "counter_name": "resource_pictures_count" - } - }, - "scrolls_count": { - "type": "count", - "args": { - "item_name": "scroll", - "param_id": "none" - } - }, - "scroll_panels_count": { - "type": "count", - "args": { - "item_name": "scroll_panel", - "param_id": "none" - } - }, - "comics_count": { - "type": "count", - "args": { - "item_name": "comic", - "param_id": "none" - } - }, - "comic_stories_count": { - "type": "count", - "args": { - "item_name": "comic_story", - "param_id": "none" - } - }, - "stories_count": { - "type": "count", - "args": { - "item_name": "story", - "list_name": "private", - "param_id": "none" - } - }, - "story_sheets_count": { - "type": "count", - "args": { - "item_name": "story_sheet", - "list_name": "private", - "param_id": "none" - } - }, - "sheets_count": { - "type": "count", - "args": { - "item_name": "sheet", - "list_name": "private", - "param_id": "none" - } - }, - "sheet_panels_count": { - "type": "count", - "args": { - "item_name": "sheet_panel", - "list_name": "private", - "param_id": "none" - } - }, - "panels_count": { - "type": "count", - "args": { - "item_name": "panel", - "list_name": "private", - "param_id": "none" - } - }, - "panel_pictures_count": { - "type": "count", - "args": { - "item_name": "panel_picture", - "list_name": "private", - "param_id": "none" - } - }, - "speech_balloons_count": { - "type": "count", - "args": { - "item_name": "speech_balloon", - "list_name": "private", - "param_id": "none" - } - }, - "speeches_count": { - "type": "count", - "args": { - "item_name": "speech", - "list_name": "private", - "param_id": "none" - } - }, - "balloons_count": { - "type": "count", - "args": { - "item_name": "balloon", - "list_name": "private", - "param_id": "none" - } - }, - "ground_pictures_count": { - "type": "count", - "args": { - "item_name": "ground_picture", - "list_name": "private", - "param_id": "none" - } - }, - "ground_colors_count": { - "type": "count", - "args": { - "item_name": "ground_color", - "list_name": "private", - "param_id": "none" - } - }, - "original_pictures_count": { - "type": "count", - "args": { - "item_name": "original_picture", - "list_name": "private", - "param_id": "none" - } - }, - "resource_pictures_count": { - "type": "count", - "args": { - "item_name": "resource_picture", - "list_name": "private", "param_id": "none" } } -- 2.11.0