Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/templates/admin/elements/icons/page_next.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<span aria-hidden="true" title="{% trans 'next' %}">&raquo;</span>
<span class="sr-only">{% trans 'next page' %}</span>
2 changes: 2 additions & 0 deletions src/templates/admin/elements/icons/page_previous.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<span aria-hidden="true" title="{% trans 'previous' %}">&laquo;</span>
<span class="sr-only">{% trans 'previous page' %}</span>
8 changes: 6 additions & 2 deletions src/templates/admin/reports/metrics.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,19 @@ <h4>Total Downloads</h4>
<div class="pagination-block">
<ul class="pagination">
{% if articles.has_previous %}
<li class="arrow"><a href="?page={{ articles.previous_page_number }}">&laquo;</a>
<li class="arrow"><a href="?page={{ articles.previous_page_number }}">
{% include "elements/icons/page_previous.html" %}
</a>
</li>{% endif %}
{{ articles.page.page_range }}
{% for page in articles.paginator.page_range %}
<li class="{% if articles.number == page %}current{% endif %}"><a
href="?page={{ page }}">{{ page }}</a></li>
{% endfor %}
{% if articles.has_next %}
<li class="arrow"><a href="?page={{ articles.next_page_number }}">&raquo;</a>
<li class="arrow"><a href="?page={{ articles.next_page_number }}">
{% include "elements/icons/page_next.html" %}
</a>
</li>{% endif %}
</ul>
</div>
Expand Down
12 changes: 10 additions & 2 deletions src/templates/common/elements/pagination.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
{% if is_paginated %}
<ul class="pagination">
{% if page_obj.has_previous %}
<li><button name="page" value="{{ page_obj.previous_page_number }}" form={{ form_id }}>&laquo;</button></li>
<li>
<button name="page" value="{{ page_obj.previous_page_number }}" form={{ form_id }}>
{% include "elements/icons/page_previous.html" %}
</button>
</li>
{% endif %}

{% for page in page_obj|slice_pages_with_first_last_ellipsis:2 %}
Expand All @@ -21,7 +25,11 @@
{% endfor %}

{% if page_obj.has_next %}
<li class="arrow"><button name="page" value="{{ page_obj.next_page_number }}" form={{ form_id }}>&raquo;</button></li>
<li class="arrow">
<button name="page" value="{{ page_obj.next_page_number }}" form={{ form_id }}>
{% include "elements/icons/page_next.html" %}
</button>
</li>
{% endif %}
</ul>
{% endif %}
Expand Down
8 changes: 6 additions & 2 deletions src/themes/OLH/templates/core/news/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,19 @@ <h2>{% trans "This journal currently has no news items to display." %}</h2>
<div class="pagination-block">
<ul class="pagination">
{% if news_items.has_previous %}
<li class="arrow"><a href="?page={{ news_items.previous_page_number }}">&laquo;</a>
<li class="arrow"><a href="?page={{ news_items.previous_page_number }}">
{% include "elements/icons/page_previous.html" %}
</a>
</li>{% endif %}
{{ news_items.page.page_range }}
{% for page in news_items.paginator.page_range %}
<li class="{% if news_items.number == page %}current{% endif %}"><a
href="?page={{ page }}">{{ page }}</a></li>
{% endfor %}
{% if news_items.has_next %}
<li class="arrow"><a href="?page={{ news_items.next_page_number }}">&raquo;</a>
<li class="arrow"><a href="?page={{ news_items.next_page_number }}">
{% include "elements/icons/page_next.html" %}
</a>
</li>{% endif %}
</ul>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,19 @@
<div class="pagination-block">
<ul class="pagination">
{% if articles.has_previous %}
<li class="arrow"><a href="?page={{ articles.previous_page_number }}">&laquo;</a>
<li class="arrow"><a href="?page={{ articles.previous_page_number }}">
{% include "elements/icons/page_previous.html" %}
</a>
</li>{% endif %}
{{ articles.page.page_range }}
{% for page in articles|slice_pages:3 %}
<li class="{% if articles.number == page.number %}current{% endif %}"><a
href="?page={{ page.number }}">{{ page.number }}</a></li>
{% endfor %}
{% if articles.has_next %}
<li class="arrow"><a href="?page={{ articles.next_page_number }}">&raquo;</a>
<li class="arrow"><a href="?page={{ articles.next_page_number }}">
{% include "elements/icons/page_next.html" %}
</a>
</li>
{% endif %}
</ul>
Expand Down
8 changes: 6 additions & 2 deletions src/themes/OLH/templates/journal/articles.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,19 @@ <h3>{% trans 'There are no articles published in this journal yet' %}.</h3>
<div class="pagination-block">
<ul class="pagination">
{% if articles.has_previous %}
<li class="arrow"><a href="?page={{ articles.previous_page_number }}">&laquo;</a>
<li class="arrow"><a href="?page={{ articles.previous_page_number }}">
{% include "elements/icons/page_previous.html" %}
</a>
</li>{% endif %}
{{ articles.page.page_range }}
{% for page in articles|slice_pages:3 %}
<li class="{% if articles.number == page.number %}current{% endif %}"><a
href="?page={{ page.number }}">{{ page.number }}</a></li>
{% endfor %}
{% if articles.has_next %}
<li class="arrow"><a href="?page={{ articles.next_page_number }}">&raquo;</a>
<li class="arrow"><a href="?page={{ articles.next_page_number }}">
{% include "elements/icons/page_next.html" %}
</a>
</li>{% endif %}
</ul>
</div>
Expand Down
8 changes: 6 additions & 2 deletions src/themes/OLH/templates/press/core/news/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,19 @@ <h2>{% trans "This press currently has no news items to display." %}</h2>
<div class="pagination-block">
<ul class="pagination">
{% if news_items.has_previous %}
<li class="arrow"><a href="?page={{ news_items.previous_page_number }}">&laquo;</a>
<li class="arrow"><a href="?page={{ news_items.previous_page_number }}">
{% include "elements/icons/page_previous.html" %}
</a>
</li>{% endif %}
{{ news_items.page.page_range }}
{% for page in news_items.paginator.page_range %}
<li class="{% if news_items.number == page %}current{% endif %}"><a
href="?page={{ page }}">{{ page }}</a></li>
{% endfor %}
{% if news_items.has_next %}
<li class="arrow"><a href="?page={{ news_items.next_page_number }}">&raquo;</a>
<li class="arrow"><a href="?page={{ news_items.next_page_number }}">
{% include "elements/icons/page_next.html" %}
</a>
</li>{% endif %}
</ul>
</div>
Expand Down
8 changes: 6 additions & 2 deletions src/themes/OLH/templates/repository/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,19 @@ <h2>{{ preprint.title|safe }}</h2>
<div class="pagination-block">
<ul class="pagination">
{% if preprints.has_previous %}
<li class="arrow"><a href="?page={{ preprints.previous_page_number }}">&laquo;</a>
<li class="arrow"><a href="?page={{ preprints.previous_page_number }}">
{% include "elements/icons/page_previous.html" %}
</a>
</li>{% endif %}
{{ preprints.page.page_range }}
{% for page in preprints.paginator.page_range %}
<li class="{% if preprints.number == page %}current{% endif %}"><a
href="?page={{ page }}">{{ page }}</a></li>
{% endfor %}
{% if preprints.has_next %}
<li class="arrow"><a href="?page={{ preprints.next_page_number }}">&raquo;</a>
<li class="arrow"><a href="?page={{ preprints.next_page_number }}">
{% include "elements/icons/page_next.html" %}
</a>
</li>{% endif %}
</ul>
</div>
Expand Down
58 changes: 42 additions & 16 deletions src/themes/clean/templates/core/news/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,46 @@ <h2>{{ item.title|safe }}</h2>
<h2> {% trans 'This journal currently has no {{ journal_settings.news.news_title }} items to display.' %}</h2>
{% endfor %}
</div>
<div class="pagination-block">{{ page }}
<ul class="d-flex justify-content-center">
{% if news_items.has_previous %}
<a href="?page={{ news_items.previous_page_number }}" class="btn btn-outline-primary">&laquo;</a>
&nbsp;{% endif %}
{{ news_items.page.page_range }}
{% for page in news_items.paginator.page_range %}
<a href="?page={{ page }}"
class="btn {% if news_items.number == page %}btn-primary{% else %}btn-outline-primary{% endif %}">{{ page }}</a>
&nbsp;
{% endfor %}
{% if news_items.has_next %}
<a href="?page={{ news_items.next_page_number }}" class="btn btn-outline-primary">&raquo;</a>
{% endif %}
</ul>
</div>
<section aria-label="pagination">
<div class="pagination-block">
<ul class="d-flex justify-content-center list-inline">
{% if news_items.has_previous %}
<li class="list-inline-item">
<a href="?page={{ news_items.previous_page_number }}"
class="btn btn-outline-primary"
>
{% include "elements/icons/page_previous.html" %}
</a>
</li>
{% endif %}

{% for page in news_items.paginator.page_range %}
{% if news_items.number == page %}
<li class="list-inline-item">
<a href="?page={{ page }}"
class="btn btn-primary"
>
<span class="sr-only">{% trans 'current page' %}</span>{{ page }}
</a>
</li>
{% else %}
<li class="list-inline-item">
<a href="?page={{ page }}"
class="btn btn-outline-primary"
>
<span class="sr-only">{% trans 'page' %}</span>{{ page }}
</a>
</li>
{% endif %}
{% endfor %}
{% if news_items.has_next %}
<li class="list-inline-item">
<a href="?page={{ news_items.next_page_number }}" class="btn btn-outline-primary">
{% include "elements/icons/page_next.html" %}
</a>
</li>
{% endif %}
</ul>
</div>
</section>
{% endblock body %}
40 changes: 26 additions & 14 deletions src/themes/clean/templates/elements/journal/issue_paginator.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,30 @@
{% load pages %}

{% if articles and articles.paginator %}
<div class="pagination-block">
<ul class="d-flex justify-content-center">
{% if articles.has_previous %}
<a href="?page={{ articles.previous_page_number }}" class="btn btn-primary">&laquo;</a>
&nbsp;{% endif %}
{{ articles.page.page_range }}
{% for page in articles.paginator.page_range %}
<a href="?page={{ page }}" class="btn btn-primary">{{ page }}</a>&nbsp;
{% endfor %}
{% if articles.has_next %}
<a href="?page={{ articles.next_page_number }}" class="btn btn-primary">&raquo;</a>
{% endif %}
</ul>
</div>
<section aria-label="pagination">
<div class="pagination-block">
<ul class="d-flex justify-content-center list-inline">
{% if articles.has_previous %}
<li class="list-inline-item">
<a href="?page={{ articles.previous_page_number }}" class="btn btn-primary">
{% include "elements/icons/page_previous.html" %}
</a>
</li>
{% endif %}
{{ articles.page.page_range }}
{% for page in articles.paginator.page_range %}
<li class="list-inline-item">
<a href="?page={{ page }}" class="btn btn-primary">{{ page }}</a>&nbsp;
</li>
{% endfor %}
{% if articles.has_next %}
<li class="list-inline-item">
<a href="?page={{ articles.next_page_number }}" class="btn btn-primary">
{% include "elements/icons/page_next.html" %}
</a>
</li>
{% endif %}
</ul>
</div>
</section>
{% endif %}
38 changes: 26 additions & 12 deletions src/themes/clean/templates/elements/pagination.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,40 @@
class="page-link"
value="{{ page_obj.previous_page_number }}"
form={{ form_id }}>
&laquo;
{% include "elements/icons/page_previous.html" %}
</button>
</li>
{% endif %}

{% for page in page_obj|slice_pages_with_first_last_ellipsis:2 %}
{% if page == '...' %}
<li class="page-item">
<button disabled class="page-link" name="ellipsis">...</button>
<button disabled class="page-link" name="ellipsis" aria-label="ellipsis">...</button>
</li>
{% else %}
<li class="page-item {% if page_obj.number == page.number %}active{% endif %}">
<button
name="page"
class="page-link"
value="{{ page.number }}"
form={{ form_id }}>
{{ page.number }}
</button>
</li>
{% if page_obj.number == page.number %}
<li class="page-item active">
<button
name="page"
class="page-link"
value="{{ page.number }}"
form={{ form_id }}>
<span class="sr-only">{% trans 'current page' %}</span>
{{ page.number }}
</button>
</li>
{% else %}
<li class="page-item">
<button
name="page"
class="page-link"
value="{{ page.number }}"
form={{ form_id }}>
<span class="sr-only">{% trans 'page' %}</span>
{{ page.number }}
</button>
</li>
{% endif %}
{% endif %}
{% endfor %}

Expand All @@ -41,7 +55,7 @@
class="page-link"
value="{{ page_obj.next_page_number }}"
form={{ form_id }}>
&raquo;
{% include "elements/icons/page_next.html" %}
</button>
</li>
{% endif %}
Expand Down
42 changes: 27 additions & 15 deletions src/themes/clean/templates/journal/articles.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,33 @@ <h1>{% trans 'Articles' %}</h1>
{% empty %}
<p>{% trans "No articles to display" %}.</p>
{% endfor %}

<div class="pagination-block">
<ul class="d-flex justify-content-center">
{% if articles.has_previous %}
<a href="?page={{ articles.previous_page_number }}" class="btn btn-primary">&laquo;</a>
&nbsp;{% endif %}
{{ articles.page.page_range }}
{% for page in articles.paginator.page_range %}
<a href="?page={{ page }}" class="btn btn-primary">{{ page }}</a>&nbsp;
{% endfor %}
{% if articles.has_next %}
<a href="?page={{ articles.next_page_number }}" class="btn btn-primary">&raquo;</a>
{% endif %}
</ul>
</div>

<section aria-label="pagination">
<div class="pagination-block">
<ul class="d-flex justify-content-center list-inline">
{% if articles.has_previous %}
<li class="list-inline-item">
<a href="?page={{ articles.previous_page_number }}" class="btn btn-primary">
{% include "elements/icons/page_previous.html" %}
</a>
</li>
{% endif %}
{{ articles.page.page_range }}
{% for page in articles.paginator.page_range %}
<li class="list-inline-item">
<a href="?page={{ page }}" class="btn btn-primary">{{ page }}</a>
</li>
{% endfor %}
{% if articles.has_next %}
<li class="list-inline-item">
<a href="?page={{ articles.next_page_number }}" class="btn btn-primary">
{% include "elements/icons/page_next.html" %}
</a>
</li>
{% endif %}
</ul>
</div>
</section>
</div>
<div class="col-md-4">
<div class="card">
Expand Down
Loading
Loading