chore(manager): disable pagination count on massive tables
This commit is contained in:
parent
a28e31bd97
commit
a4ed1d07af
3 changed files with 14 additions and 0 deletions
|
@ -21,5 +21,9 @@ module Manager
|
|||
def unfiltered_list?
|
||||
action_name == "index" && !params[:search]
|
||||
end
|
||||
|
||||
def paginate_resources(_resources)
|
||||
super.without_count
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -89,5 +89,9 @@ module Manager
|
|||
def targeted_email
|
||||
params[:user][:email]
|
||||
end
|
||||
|
||||
def paginate_resources(_resources)
|
||||
super.without_count
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
6
app/views/administrate/application/_pagination.html.haml
Normal file
6
app/views/administrate/application/_pagination.html.haml
Normal file
|
@ -0,0 +1,6 @@
|
|||
- if resources.singleton_class.included_modules.include?(Kaminari::PaginatableWithoutCount)
|
||||
%nav.pagination
|
||||
= link_to_prev_page resources, t("views.pagination.previous"), param_name: "_page"
|
||||
= link_to_next_page resources, t("views.pagination.next"), param_name: "_page"
|
||||
- else
|
||||
= paginate resources, param_name: "_page"
|
Loading…
Reference in a new issue