Issue #3079738 by lauriii, saschaeggi, webchick, xjm, andrewmacpherson, shimpy, effulgentsia, Wim Leers, DyanneNova, svettes, rainbreaw, fhaeberle, ckrina, AaronMcHale, justafish, catch, charlieweb82, AntoineH, lot007, pzajacz, kostyashupenko, jasonbarrie, antonellasevero, finnsky, worldlinemine, bnjmnm, RobLoach, Dennis Cohn, huzooka, Archita Arora, joachim, jrockowitz, benjifisher, shaal, Gábor Hojtsy, quiron, L2G2, ccasals, hampercm, if-jds, abhisekmazumdar, Kami Amiga, pivica, zrpnr, BrightBold, imalabya, jhedstrom, Neslee Canil Pinto, maliknaik, junaidmasoodi, Maithri Shetty, pranav73, mandclu, modulist, nod_, philosurfer, phenaproxima, mherchel, mlncn, rafuel92, leymannx, kiboman, Swapnil_Kotwal, anevins, evankay, rfmarcelino, thamas, brianperry, idebr, joelpittet, boulaffasae, alexpott, volkerk, DuneBL, Eli-T, Mahenkvyas22: Add Claro administration theme to core
2019-10-13 20:42:58 +00:00
|
|
|
|
{#
|
|
|
|
|
/**
|
|
|
|
|
* @file
|
|
|
|
|
* Theme override to display a pager.
|
|
|
|
|
*
|
|
|
|
|
* Available variables:
|
|
|
|
|
* - heading_id: Pagination heading ID.
|
|
|
|
|
* - items: List of pager items.
|
|
|
|
|
* The list is keyed by the following elements:
|
|
|
|
|
* - first: Item for the first page; not present on the first page of results.
|
|
|
|
|
* - previous: Item for the previous page; not present on the first page
|
|
|
|
|
* of results.
|
|
|
|
|
* - next: Item for the next page; not present on the last page of results.
|
|
|
|
|
* - last: Item for the last page; not present on the last page of results.
|
|
|
|
|
* - pages: List of pages, keyed by page number.
|
|
|
|
|
* Sub-sub elements:
|
|
|
|
|
* items.first, items.previous, items.next, items.last, and each item inside
|
|
|
|
|
* items.pages contain the following elements:
|
|
|
|
|
* - href: URL with appropriate query parameters for the item.
|
|
|
|
|
* - attributes: A keyed list of HTML attributes for the item.
|
|
|
|
|
* - text: The visible text used for the item link, such as "‹ Previous"
|
|
|
|
|
* or "Next ›".
|
|
|
|
|
* - current: The page number of the current page.
|
|
|
|
|
* - ellipses: If there are more pages than the quantity allows, then an
|
|
|
|
|
* ellipsis before or after the listed pages may be present.
|
|
|
|
|
* - previous: Present if the currently visible list of pages does not start
|
|
|
|
|
* at the first page.
|
|
|
|
|
* - next: Present if the visible list of pages ends before the last page.
|
|
|
|
|
*
|
|
|
|
|
* @see template_preprocess_pager()
|
|
|
|
|
*
|
|
|
|
|
* @todo review all uses of the replace() filter below in
|
|
|
|
|
* https://www.drupal.org/node/3053707 as the behavior it addresses will
|
|
|
|
|
* likely change when that issue is completed.
|
|
|
|
|
*/
|
|
|
|
|
#}
|
|
|
|
|
{% if items %}
|
|
|
|
|
<nav class="pager" role="navigation" aria-labelledby="{{ heading_id }}">
|
|
|
|
|
<h4 id="{{ heading_id }}" class="visually-hidden">{{ 'Pagination'|t }}</h4>
|
|
|
|
|
<ul class="pager__items js-pager__items">
|
|
|
|
|
{# Print first item if we are not on the first page. #}
|
|
|
|
|
{% if items.first %}
|
Issue #3041076 by alexpott, shaal, Gábor Hojtsy, lauriii, Wim Leers, catch, Cottser, jibran, andypost, znerol, xim, joelpittet, effulgentsia: Update Drupal 9 to Twig 2
2019-10-31 12:39:18 +00:00
|
|
|
|
{% apply spaceless %}
|
Issue #3079738 by lauriii, saschaeggi, webchick, xjm, andrewmacpherson, shimpy, effulgentsia, Wim Leers, DyanneNova, svettes, rainbreaw, fhaeberle, ckrina, AaronMcHale, justafish, catch, charlieweb82, AntoineH, lot007, pzajacz, kostyashupenko, jasonbarrie, antonellasevero, finnsky, worldlinemine, bnjmnm, RobLoach, Dennis Cohn, huzooka, Archita Arora, joachim, jrockowitz, benjifisher, shaal, Gábor Hojtsy, quiron, L2G2, ccasals, hampercm, if-jds, abhisekmazumdar, Kami Amiga, pivica, zrpnr, BrightBold, imalabya, jhedstrom, Neslee Canil Pinto, maliknaik, junaidmasoodi, Maithri Shetty, pranav73, mandclu, modulist, nod_, philosurfer, phenaproxima, mherchel, mlncn, rafuel92, leymannx, kiboman, Swapnil_Kotwal, anevins, evankay, rfmarcelino, thamas, brianperry, idebr, joelpittet, boulaffasae, alexpott, volkerk, DuneBL, Eli-T, Mahenkvyas22: Add Claro administration theme to core
2019-10-13 20:42:58 +00:00
|
|
|
|
<li class="pager__item pager__item--action pager__item--first">
|
|
|
|
|
<a href="{{ items.first.href }}" class="pager__link pager__link--action-link" title="{{ 'Go to first page'|t }}"{{ items.first.attributes|without('href', 'title') }}>
|
|
|
|
|
<span class="visually-hidden">{{ 'First page'|t }}</span>
|
|
|
|
|
<span class="pager__item-title pager__item-title--backwards" aria-hidden="true">
|
|
|
|
|
{{ items.first.text|default('First'|t)|replace({'«': ''}) }}
|
|
|
|
|
</span>
|
|
|
|
|
</a>
|
|
|
|
|
</li>
|
Issue #3041076 by alexpott, shaal, Gábor Hojtsy, lauriii, Wim Leers, catch, Cottser, jibran, andypost, znerol, xim, joelpittet, effulgentsia: Update Drupal 9 to Twig 2
2019-10-31 12:39:18 +00:00
|
|
|
|
{% endapply %}
|
Issue #3079738 by lauriii, saschaeggi, webchick, xjm, andrewmacpherson, shimpy, effulgentsia, Wim Leers, DyanneNova, svettes, rainbreaw, fhaeberle, ckrina, AaronMcHale, justafish, catch, charlieweb82, AntoineH, lot007, pzajacz, kostyashupenko, jasonbarrie, antonellasevero, finnsky, worldlinemine, bnjmnm, RobLoach, Dennis Cohn, huzooka, Archita Arora, joachim, jrockowitz, benjifisher, shaal, Gábor Hojtsy, quiron, L2G2, ccasals, hampercm, if-jds, abhisekmazumdar, Kami Amiga, pivica, zrpnr, BrightBold, imalabya, jhedstrom, Neslee Canil Pinto, maliknaik, junaidmasoodi, Maithri Shetty, pranav73, mandclu, modulist, nod_, philosurfer, phenaproxima, mherchel, mlncn, rafuel92, leymannx, kiboman, Swapnil_Kotwal, anevins, evankay, rfmarcelino, thamas, brianperry, idebr, joelpittet, boulaffasae, alexpott, volkerk, DuneBL, Eli-T, Mahenkvyas22: Add Claro administration theme to core
2019-10-13 20:42:58 +00:00
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
|
|
{# Print previous item if we are not on the first page. #}
|
|
|
|
|
{% if items.previous %}
|
Issue #3041076 by alexpott, shaal, Gábor Hojtsy, lauriii, Wim Leers, catch, Cottser, jibran, andypost, znerol, xim, joelpittet, effulgentsia: Update Drupal 9 to Twig 2
2019-10-31 12:39:18 +00:00
|
|
|
|
{% apply spaceless %}
|
Issue #3079738 by lauriii, saschaeggi, webchick, xjm, andrewmacpherson, shimpy, effulgentsia, Wim Leers, DyanneNova, svettes, rainbreaw, fhaeberle, ckrina, AaronMcHale, justafish, catch, charlieweb82, AntoineH, lot007, pzajacz, kostyashupenko, jasonbarrie, antonellasevero, finnsky, worldlinemine, bnjmnm, RobLoach, Dennis Cohn, huzooka, Archita Arora, joachim, jrockowitz, benjifisher, shaal, Gábor Hojtsy, quiron, L2G2, ccasals, hampercm, if-jds, abhisekmazumdar, Kami Amiga, pivica, zrpnr, BrightBold, imalabya, jhedstrom, Neslee Canil Pinto, maliknaik, junaidmasoodi, Maithri Shetty, pranav73, mandclu, modulist, nod_, philosurfer, phenaproxima, mherchel, mlncn, rafuel92, leymannx, kiboman, Swapnil_Kotwal, anevins, evankay, rfmarcelino, thamas, brianperry, idebr, joelpittet, boulaffasae, alexpott, volkerk, DuneBL, Eli-T, Mahenkvyas22: Add Claro administration theme to core
2019-10-13 20:42:58 +00:00
|
|
|
|
<li class="pager__item pager__item--action pager__item--previous">
|
|
|
|
|
<a href="{{ items.previous.href }}" class="pager__link pager__link--action-link" title="{{ 'Go to previous page'|t }}" rel="prev"{{ items.previous.attributes|without('href', 'title', 'rel') }}>
|
|
|
|
|
<span class="visually-hidden">{{ 'Previous page'|t }}</span>
|
|
|
|
|
<span class="pager__item-title pager__item-title--backwards" aria-hidden="true">
|
|
|
|
|
{{ items.previous.text|default('Previous'|t)|replace({'‹': ''}) }}
|
|
|
|
|
</span>
|
|
|
|
|
</a>
|
|
|
|
|
</li>
|
Issue #3041076 by alexpott, shaal, Gábor Hojtsy, lauriii, Wim Leers, catch, Cottser, jibran, andypost, znerol, xim, joelpittet, effulgentsia: Update Drupal 9 to Twig 2
2019-10-31 12:39:18 +00:00
|
|
|
|
{% endapply %}
|
Issue #3079738 by lauriii, saschaeggi, webchick, xjm, andrewmacpherson, shimpy, effulgentsia, Wim Leers, DyanneNova, svettes, rainbreaw, fhaeberle, ckrina, AaronMcHale, justafish, catch, charlieweb82, AntoineH, lot007, pzajacz, kostyashupenko, jasonbarrie, antonellasevero, finnsky, worldlinemine, bnjmnm, RobLoach, Dennis Cohn, huzooka, Archita Arora, joachim, jrockowitz, benjifisher, shaal, Gábor Hojtsy, quiron, L2G2, ccasals, hampercm, if-jds, abhisekmazumdar, Kami Amiga, pivica, zrpnr, BrightBold, imalabya, jhedstrom, Neslee Canil Pinto, maliknaik, junaidmasoodi, Maithri Shetty, pranav73, mandclu, modulist, nod_, philosurfer, phenaproxima, mherchel, mlncn, rafuel92, leymannx, kiboman, Swapnil_Kotwal, anevins, evankay, rfmarcelino, thamas, brianperry, idebr, joelpittet, boulaffasae, alexpott, volkerk, DuneBL, Eli-T, Mahenkvyas22: Add Claro administration theme to core
2019-10-13 20:42:58 +00:00
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
|
|
{# Add an ellipsis if there are further previous pages. #}
|
|
|
|
|
{% if ellipses.previous %}
|
|
|
|
|
<li class="pager__item pager__item--ellipsis" role="presentation">…</li>
|
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
|
|
{# Now generate the actual pager piece. #}
|
|
|
|
|
{% for key, item in items.pages %}
|
Issue #3041076 by alexpott, shaal, Gábor Hojtsy, lauriii, Wim Leers, catch, Cottser, jibran, andypost, znerol, xim, joelpittet, effulgentsia: Update Drupal 9 to Twig 2
2019-10-31 12:39:18 +00:00
|
|
|
|
{% apply spaceless %}
|
Issue #3079738 by lauriii, saschaeggi, webchick, xjm, andrewmacpherson, shimpy, effulgentsia, Wim Leers, DyanneNova, svettes, rainbreaw, fhaeberle, ckrina, AaronMcHale, justafish, catch, charlieweb82, AntoineH, lot007, pzajacz, kostyashupenko, jasonbarrie, antonellasevero, finnsky, worldlinemine, bnjmnm, RobLoach, Dennis Cohn, huzooka, Archita Arora, joachim, jrockowitz, benjifisher, shaal, Gábor Hojtsy, quiron, L2G2, ccasals, hampercm, if-jds, abhisekmazumdar, Kami Amiga, pivica, zrpnr, BrightBold, imalabya, jhedstrom, Neslee Canil Pinto, maliknaik, junaidmasoodi, Maithri Shetty, pranav73, mandclu, modulist, nod_, philosurfer, phenaproxima, mherchel, mlncn, rafuel92, leymannx, kiboman, Swapnil_Kotwal, anevins, evankay, rfmarcelino, thamas, brianperry, idebr, joelpittet, boulaffasae, alexpott, volkerk, DuneBL, Eli-T, Mahenkvyas22: Add Claro administration theme to core
2019-10-13 20:42:58 +00:00
|
|
|
|
<li class="pager__item{{ current == key ? ' pager__item--active' : '' }} pager__item--number">
|
|
|
|
|
{% if current == key %}
|
|
|
|
|
{% set title = 'Current page'|t %}
|
|
|
|
|
{% else %}
|
|
|
|
|
{% set title = 'Go to page @key'|t({'@key': key}) %}
|
|
|
|
|
{% endif %}
|
|
|
|
|
<a href="{{ item.href }}" class="pager__link{{ current == key ? ' is-active' }}" title="{{ title }}"{{ item.attributes|without('href', 'title', 'class') }}>
|
|
|
|
|
<span class="visually-hidden">
|
|
|
|
|
{{ current == key ? 'Current page'|t : 'Page'|t }}
|
|
|
|
|
</span>
|
|
|
|
|
{{ key }}
|
|
|
|
|
</a>
|
|
|
|
|
</li>
|
Issue #3041076 by alexpott, shaal, Gábor Hojtsy, lauriii, Wim Leers, catch, Cottser, jibran, andypost, znerol, xim, joelpittet, effulgentsia: Update Drupal 9 to Twig 2
2019-10-31 12:39:18 +00:00
|
|
|
|
{% endapply %}
|
Issue #3079738 by lauriii, saschaeggi, webchick, xjm, andrewmacpherson, shimpy, effulgentsia, Wim Leers, DyanneNova, svettes, rainbreaw, fhaeberle, ckrina, AaronMcHale, justafish, catch, charlieweb82, AntoineH, lot007, pzajacz, kostyashupenko, jasonbarrie, antonellasevero, finnsky, worldlinemine, bnjmnm, RobLoach, Dennis Cohn, huzooka, Archita Arora, joachim, jrockowitz, benjifisher, shaal, Gábor Hojtsy, quiron, L2G2, ccasals, hampercm, if-jds, abhisekmazumdar, Kami Amiga, pivica, zrpnr, BrightBold, imalabya, jhedstrom, Neslee Canil Pinto, maliknaik, junaidmasoodi, Maithri Shetty, pranav73, mandclu, modulist, nod_, philosurfer, phenaproxima, mherchel, mlncn, rafuel92, leymannx, kiboman, Swapnil_Kotwal, anevins, evankay, rfmarcelino, thamas, brianperry, idebr, joelpittet, boulaffasae, alexpott, volkerk, DuneBL, Eli-T, Mahenkvyas22: Add Claro administration theme to core
2019-10-13 20:42:58 +00:00
|
|
|
|
{% endfor %}
|
|
|
|
|
|
|
|
|
|
{# Add an ellipsis if there are further next pages. #}
|
|
|
|
|
{% if ellipses.next %}
|
|
|
|
|
<li class="pager__item pager__item--ellipsis" role="presentation">…</li>
|
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
|
|
{# Print next item if we are not on the last page. #}
|
|
|
|
|
{% if items.next %}
|
Issue #3041076 by alexpott, shaal, Gábor Hojtsy, lauriii, Wim Leers, catch, Cottser, jibran, andypost, znerol, xim, joelpittet, effulgentsia: Update Drupal 9 to Twig 2
2019-10-31 12:39:18 +00:00
|
|
|
|
{% apply spaceless %}
|
Issue #3079738 by lauriii, saschaeggi, webchick, xjm, andrewmacpherson, shimpy, effulgentsia, Wim Leers, DyanneNova, svettes, rainbreaw, fhaeberle, ckrina, AaronMcHale, justafish, catch, charlieweb82, AntoineH, lot007, pzajacz, kostyashupenko, jasonbarrie, antonellasevero, finnsky, worldlinemine, bnjmnm, RobLoach, Dennis Cohn, huzooka, Archita Arora, joachim, jrockowitz, benjifisher, shaal, Gábor Hojtsy, quiron, L2G2, ccasals, hampercm, if-jds, abhisekmazumdar, Kami Amiga, pivica, zrpnr, BrightBold, imalabya, jhedstrom, Neslee Canil Pinto, maliknaik, junaidmasoodi, Maithri Shetty, pranav73, mandclu, modulist, nod_, philosurfer, phenaproxima, mherchel, mlncn, rafuel92, leymannx, kiboman, Swapnil_Kotwal, anevins, evankay, rfmarcelino, thamas, brianperry, idebr, joelpittet, boulaffasae, alexpott, volkerk, DuneBL, Eli-T, Mahenkvyas22: Add Claro administration theme to core
2019-10-13 20:42:58 +00:00
|
|
|
|
<li class="pager__item pager__item--action pager__item--next">
|
|
|
|
|
<a href="{{ items.next.href }}" class="pager__link pager__link--action-link" title="{{ 'Go to next page'|t }}" rel="next"{{ items.next.attributes|without('href', 'title', 'rel') }}>
|
|
|
|
|
<span class="visually-hidden">{{ 'Next page'|t }}</span>
|
|
|
|
|
<span class="pager__item-title pager__item-title--forward" aria-hidden="true">
|
|
|
|
|
{{ items.next.text|default('Next'|t)|replace({'›': ''}) }}
|
|
|
|
|
</span>
|
|
|
|
|
</a>
|
|
|
|
|
</li>
|
Issue #3041076 by alexpott, shaal, Gábor Hojtsy, lauriii, Wim Leers, catch, Cottser, jibran, andypost, znerol, xim, joelpittet, effulgentsia: Update Drupal 9 to Twig 2
2019-10-31 12:39:18 +00:00
|
|
|
|
{% endapply %}
|
Issue #3079738 by lauriii, saschaeggi, webchick, xjm, andrewmacpherson, shimpy, effulgentsia, Wim Leers, DyanneNova, svettes, rainbreaw, fhaeberle, ckrina, AaronMcHale, justafish, catch, charlieweb82, AntoineH, lot007, pzajacz, kostyashupenko, jasonbarrie, antonellasevero, finnsky, worldlinemine, bnjmnm, RobLoach, Dennis Cohn, huzooka, Archita Arora, joachim, jrockowitz, benjifisher, shaal, Gábor Hojtsy, quiron, L2G2, ccasals, hampercm, if-jds, abhisekmazumdar, Kami Amiga, pivica, zrpnr, BrightBold, imalabya, jhedstrom, Neslee Canil Pinto, maliknaik, junaidmasoodi, Maithri Shetty, pranav73, mandclu, modulist, nod_, philosurfer, phenaproxima, mherchel, mlncn, rafuel92, leymannx, kiboman, Swapnil_Kotwal, anevins, evankay, rfmarcelino, thamas, brianperry, idebr, joelpittet, boulaffasae, alexpott, volkerk, DuneBL, Eli-T, Mahenkvyas22: Add Claro administration theme to core
2019-10-13 20:42:58 +00:00
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
|
|
{# Print last item if we are not on the last page. #}
|
|
|
|
|
{% if items.last %}
|
Issue #3041076 by alexpott, shaal, Gábor Hojtsy, lauriii, Wim Leers, catch, Cottser, jibran, andypost, znerol, xim, joelpittet, effulgentsia: Update Drupal 9 to Twig 2
2019-10-31 12:39:18 +00:00
|
|
|
|
{% apply spaceless %}
|
Issue #3079738 by lauriii, saschaeggi, webchick, xjm, andrewmacpherson, shimpy, effulgentsia, Wim Leers, DyanneNova, svettes, rainbreaw, fhaeberle, ckrina, AaronMcHale, justafish, catch, charlieweb82, AntoineH, lot007, pzajacz, kostyashupenko, jasonbarrie, antonellasevero, finnsky, worldlinemine, bnjmnm, RobLoach, Dennis Cohn, huzooka, Archita Arora, joachim, jrockowitz, benjifisher, shaal, Gábor Hojtsy, quiron, L2G2, ccasals, hampercm, if-jds, abhisekmazumdar, Kami Amiga, pivica, zrpnr, BrightBold, imalabya, jhedstrom, Neslee Canil Pinto, maliknaik, junaidmasoodi, Maithri Shetty, pranav73, mandclu, modulist, nod_, philosurfer, phenaproxima, mherchel, mlncn, rafuel92, leymannx, kiboman, Swapnil_Kotwal, anevins, evankay, rfmarcelino, thamas, brianperry, idebr, joelpittet, boulaffasae, alexpott, volkerk, DuneBL, Eli-T, Mahenkvyas22: Add Claro administration theme to core
2019-10-13 20:42:58 +00:00
|
|
|
|
<li class="pager__item pager__item--action pager__item--last">
|
|
|
|
|
<a href="{{ items.last.href }}" class="pager__link pager__link--action-link" title="{{ 'Go to last page'|t }}"{{ items.last.attributes|without('href', 'title') }}>
|
|
|
|
|
<span class="visually-hidden">{{ 'Last page'|t }}</span>
|
|
|
|
|
<span class="pager__item-title pager__item-title--forward" aria-hidden="true">
|
|
|
|
|
{{ items.last.text|default('Last'|t)|replace({'»': ''}) }}
|
|
|
|
|
</span>
|
|
|
|
|
</a>
|
|
|
|
|
</li>
|
Issue #3041076 by alexpott, shaal, Gábor Hojtsy, lauriii, Wim Leers, catch, Cottser, jibran, andypost, znerol, xim, joelpittet, effulgentsia: Update Drupal 9 to Twig 2
2019-10-31 12:39:18 +00:00
|
|
|
|
{% endapply %}
|
Issue #3079738 by lauriii, saschaeggi, webchick, xjm, andrewmacpherson, shimpy, effulgentsia, Wim Leers, DyanneNova, svettes, rainbreaw, fhaeberle, ckrina, AaronMcHale, justafish, catch, charlieweb82, AntoineH, lot007, pzajacz, kostyashupenko, jasonbarrie, antonellasevero, finnsky, worldlinemine, bnjmnm, RobLoach, Dennis Cohn, huzooka, Archita Arora, joachim, jrockowitz, benjifisher, shaal, Gábor Hojtsy, quiron, L2G2, ccasals, hampercm, if-jds, abhisekmazumdar, Kami Amiga, pivica, zrpnr, BrightBold, imalabya, jhedstrom, Neslee Canil Pinto, maliknaik, junaidmasoodi, Maithri Shetty, pranav73, mandclu, modulist, nod_, philosurfer, phenaproxima, mherchel, mlncn, rafuel92, leymannx, kiboman, Swapnil_Kotwal, anevins, evankay, rfmarcelino, thamas, brianperry, idebr, joelpittet, boulaffasae, alexpott, volkerk, DuneBL, Eli-T, Mahenkvyas22: Add Claro administration theme to core
2019-10-13 20:42:58 +00:00
|
|
|
|
{% endif %}
|
|
|
|
|
</ul>
|
|
|
|
|
</nav>
|
|
|
|
|
{% endif %}
|