-
Notifications
You must be signed in to change notification settings - Fork 43
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
Fix creating pager range #245
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
b3bf305
fix creating page range
serieznyi 3f58095
update default paginate template
serieznyi 721154a
make code more shortly and update view
serieznyi 18dc973
again fix paginate view
serieznyi b398150
fix pagination if maxPage is even
serieznyi d6d5f2a
update unit test for getPages
serieznyi 2c863ff
fix logic after error
serieznyi ca4dde9
calculate correction shortly
serieznyi a263ec2
update code and add new test
serieznyi f93236b
Merge branch '2.1' into fix-pager
serieznyi 8b69abb
add more data in test
serieznyi 496a199
fix code format
serieznyi b55ccc1
add new test
serieznyi 8fa1f87
fix algoritm
serieznyi 0c99bd0
remove throwing exception
serieznyi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,30 @@ | ||
<ul class="pagination"> | ||
{% if pager.isFirstPage == false %} | ||
<li class="first"><a href="{{ ongr_paginate_path(route, pager.getFirstPage, parameters) }}">«</a></li> | ||
<li class="previous"><a href="{{ ongr_paginate_path(route, pager.getPreviousPage, parameters) }}">‹</a></li> | ||
{% endif %} | ||
<li class="{% if 1 == pager.getCurrentPage %}active{% endif %}"> | ||
<a href="{{ ongr_paginate_path(route, 1, parameters) }}">1</a> | ||
</li> | ||
{% if 1 < pager.getPages.0 - 1%} | ||
<li> | ||
<span>...</span> | ||
{% if pager.isFirstPage %} | ||
<li class="previous">‹</li> | ||
{% else %} | ||
<li class="previous"> | ||
<a href="{{ ongr_paginate_path(route, pager.getPreviousPage, parameters) }}">‹</a> | ||
</li> | ||
{% endif %} | ||
|
||
{% set previous = false %} | ||
|
||
{% for page in pager.getPages %} | ||
{% if previous and page > previous + 1 %} | ||
<li> | ||
<span>...</span> | ||
</li> | ||
{% endif %} | ||
|
||
<li class="{% if page == pager.getCurrentPage %}active{% endif %}"> | ||
<a href="{{ ongr_paginate_path(route, page, parameters) }}">{{ page }}</a> | ||
</li> | ||
{% set previous = page %} | ||
{% endfor %} | ||
{% if pager.isLastPage == false %} | ||
|
||
{% if pager.isLastPage %} | ||
<li class="next">›</li> | ||
{% else %} | ||
<li class="next"><a href="{{ ongr_paginate_path(route, pager.getNextPage, parameters) }}">›</a></li> | ||
<li class="last"><a href="{{ ongr_paginate_path(route, pager.getLastPage, parameters) }}">»</a></li> | ||
{% endif %} | ||
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@saimaz I replace throwing exception on default minimum value because I afraid that my changes crash somebody app.