Merge #19152 - Add custom rows value to select

Add custom page size to browse table when coming from search view

Fixes #18394

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
This commit is contained in:
Maurício Meneghini Fauth 2024-06-06 10:55:36 -03:00
commit a38f06ef08
No known key found for this signature in database
GPG Key ID: 6A16FD38AFC89CC8

View File

@ -48,10 +48,13 @@
<label for="sessionMaxRowsSelect">{% trans 'Number of rows:' %}</label>
<select class="autosubmit" name="session_max_rows" id="sessionMaxRowsSelect">
{% set rows_options = [25, 50, 100, 250, 500] %}
{% if navigation.is_showing_all %}
<option value="" disabled selected>{% trans 'All' %}</option>
{% elseif navigation.max_rows not in rows_options %}
{% set rows_options = rows_options|merge([navigation.max_rows])|sort((a, b) => a <=> b) %}
{% endif %}
{% for option in ['25', '50', '100', '250', '500'] %}
{% for option in rows_options %}
<option value="{{ option }}"{{ navigation.max_rows == option ? ' selected' }}>{{ option }}</option>
{% endfor %}
</select>