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

Limit pagination include to index. Fix pagination calc #7

Merged
merged 1 commit into from
Mar 14, 2016
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: 1 addition & 1 deletion Resources/views/Mapping/_pagination.html.twig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% set totalPages = (paginator.count / pageSize)|ceil %}
{% set currentPage = page %}
{% if totalPages > pageSize %}
{% if totalPages > 1 %}
<div class="pagination">
<ul>
{% for page in 1..totalPages %}
Expand Down
5 changes: 5 additions & 0 deletions Resources/views/Mapping/index.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@
{% endfor %}
</tbody>
</table>

{% block armb_pagination %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this in a block?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to allow it to be overridden, not particularly useful any more though. We have tried to keep changes backward compatible

{% include "AstinaRedirectManagerBundle:Mapping:_pagination.html.twig" %}
{% endblock %}

{% else %}
<div class="alert alert-block">
<h4>{{ 'list.no_redirects.title' | trans }}</h4>
Expand Down
1 change: 0 additions & 1 deletion Resources/views/base_layout.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
<h1>{{ 'redirects' | trans }}</h1>
</div>
{% block armb_content %}{% endblock %}
{% block armb_pagination %}{% endblock %}
</div>
</div>
</body>
Expand Down
4 changes: 0 additions & 4 deletions Resources/views/content_layout.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,3 @@
{{ parent() }}

{% endblock armb_content %}

{% block armb_pagination %}
{% include "AstinaRedirectManagerBundle:Mapping:_pagination.html.twig" %}
{% endblock %}