Skip to content

Commit

Permalink
fix pager and limit for non-form pages
Browse files Browse the repository at this point in the history
  • Loading branch information
cconard96 authored and trasher committed May 16, 2024
1 parent a360e6d commit 96b6be1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion templates/components/dropdown/limit.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
{% endif %}

{% if not no_onchange %}
{% set href = "location.href='" ~ href ~ "glpilist_limit='+this.value+'" ~ additional_params ~ "'" %}
{% set href_separator = '?' in href ? '&' : '?' %}
{% set href = "location.href='" ~ href ~ href_separator ~ "glpilist_limit='+this.value+'" ~ additional_params ~ "'" %}
{% if is_tab is defined and is_tab == true %}
{% set href = "javascript:reloadTab('glpilist_limit='+this.value+'" ~ additional_params ~ "');" %}
{% endif %}
Expand Down
4 changes: 3 additions & 1 deletion templates/components/pager.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
{% endif %}
{% endif %}

{% set href = href ~ "&start=%start%" ~ additional_params %}
{% set href_separator = '?' in href ? '&' : '?' %}
{% set href = href ~ href_separator ~ "start=%start%" ~ additional_params %}
{% if is_tab is defined and is_tab == true %}
{% set href = "javascript:reloadTab('start=%start%" ~ additional_params ~ "');" %}
{% endif %}
Expand Down Expand Up @@ -71,6 +72,7 @@
{% set limitdropdown = include('components/dropdown/limit.html.twig', {
'no_onchange': fluid_search|default(false),
'select_class': 'search-limit-dropdown',
'href': href|replace({'%start%': start}),
}) %}
<span class="search-limit d-none d-md-block">
{{ __('%s rows / page')|format(limitdropdown)|raw }}
Expand Down
2 changes: 1 addition & 1 deletion templates/pages/admin/events_list.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<div class="card-header search-header pe-0">
{% if count > 0 %}
{% set limitdropdown = include('components/dropdown/limit.html.twig', {
'href': target ~ '?',
'href': target,
'additional_params': 'sort=' ~ sort ~ '&order=' ~ order
}) %}
<div class="ms-auto d-inline-flex align-items-center d-none d-md-block search-limit">
Expand Down

0 comments on commit 96b6be1

Please sign in to comment.