Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added accessibility for the pagination snippet #11591

Merged
Merged
Changes from 1 commit
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
24 changes: 12 additions & 12 deletions dojo/templates/dojo/paging_snippet.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
{% endblocktrans %}
</div>

<nav class="pull-right">
<nav class="pull-right" aria-label="Pagination navigation">
<ul class="pagination pagination-sm">
{% if page.has_other_pages %}
{% for num in page|paginate:5 %}
<li {% if num.is_current %}class="active"{% endif %}>
{% if num.page_number %}
<a href="?{% url_replace request page_param num.page_number %}"> {{ num.display }}</a>
<a href="?{% url_replace request page_param num.page_number %}" aria-label="{% trans 'Page' %} {{ num.display }}"> {{ num.display }}</a>
{% else %}
<a>{{ num.display }}</a>
<a href="#" role="presentation" aria-disabled="true" tabindex="-1">{{ num.display }}</a>
{% endif %}
</li>
{% endfor %}
Expand All @@ -28,21 +28,21 @@
<!-- Split button -->
&nbsp;
<div class="btn-group">
<button type="button" class="btn-sm btn-secondary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<button data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" aria-label="{% trans 'Page size selector' %}" id="pageSizeDropdown" class="btn-sm btn-secondary dropdown-toggle" type="button">
{% trans "Page Size" %}
<span class="caret"></span>
<span class="sr-only">{% trans "Toggle Dropdown" %}</span>
</button>
<ul class="dropdown-menu">
<li><a href="?{% url_replace request page_size_param 25 %}">25</a></li>
<li><a href="?{% url_replace request page_size_param 50 %}">50</a></li>
<li><a href="?{% url_replace request page_size_param 75 %}">75</a></li>
<li><a href="?{% url_replace request page_size_param 100 %}">100</a></li>
<li><a href="?{% url_replace request page_size_param 150 %}">150</a></li>
<ul class="dropdown-menu" role="menu" aria-labelledby="pageSizeDropdown">
<li role="presentation"><a href="?{% url_replace request page_size_param 25 %}" aria-label="{% trans '25 items per page' %}" role="menuitem">25</a></li>
<li role="presentation"><a href="?{% url_replace request page_size_param 50 %}" aria-label="{% trans '50 items per page' %}" role="menuitem">50</a></li>
<li role="presentation"><a href="?{% url_replace request page_size_param 75 %}" aria-label="{% trans '75 items per page' %}" role="menuitem" >75</a></li>
<li role="presentation"><a href="?{% url_replace request page_size_param 100 %}" aria-label="{% trans '100 items per page' %}" role="menuitem">100</a></li>
<li role="presentation"><a href="?{% url_replace request page_size_param 150 %}" aria-label="{% trans '150 items per page' %}" role="menuitem">150</a></li>
{% if page.paginator.count > 500 %}
<li><a href="?{% url_replace request page_size_param 500 %}">500</a></li>
<li role="presentation"><a href="?{% url_replace request page_size_param 500 %}" aria-label="{% trans '500 items per page' %}" role="menuitem" >500</a></li>
{% endif %}
<li><a href="?{% url_replace request page_size_param page.paginator.count %}">{% trans "All" %}</a></li>
<li role="presentation"><a href="?{% url_replace request page_size_param page.paginator.count %}" aria-label="{% trans 'All items per page' %}" role="menuitem">{% trans "All" %}</a></li>
kiblik marked this conversation as resolved.
Show resolved Hide resolved
</ul>
</div>
</li>
Expand Down
Loading