1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-31 22:54:11 +00:00

fixed pagination bug for repo_view_snapshot

This commit is contained in:
llj
2013-07-24 17:10:03 +08:00
parent 4a77847d08
commit e25bebe33e
3 changed files with 9 additions and 6 deletions

View File

@@ -54,9 +54,9 @@
{% if page_next %} {% if page_next %}
<a href="?page={{ next_page }}&per_page={{ per_page }}">{% trans "Next"%}</a> <a href="?page={{ next_page }}&per_page={{ per_page }}">{% trans "Next"%}</a>
{% endif %} {% endif %}
{% if current_page != 1 or page_next %} {% if current_page != 1 or page_next %}
| |
{% endif %} {% endif %}
<span>{% trans "Per page: "%}</span> <span>{% trans "Per page: "%}</span>
{% if per_page == 25 %} {% if per_page == 25 %}
<span> 25 </span> <span> 25 </span>

View File

@@ -47,10 +47,13 @@
</table> </table>
<div id="paginator"> <div id="paginator">
{% if current_page != 1 %} {% if current_page != 1 %}
<a href="?page={{ prev_page }}&per_page={{ per_page }}">{% trans "Previous"%}</a> | <a href="?page={{ prev_page }}&per_page={{ per_page }}">{% trans "Previous"%}</a>
{% endif %} {% endif %}
{% if page_next %} {% if page_next %}
<a href="?page={{ next_page }}&per_page={{ per_page }}">{% trans "Next"%}</a> | <a href="?page={{ next_page }}&per_page={{ per_page }}">{% trans "Next"%}</a>
{% endif %}
{% if current_page != 1 or page_next %}
|
{% endif %} {% endif %}
<span>{% trans "Per page: "%}</span> <span>{% trans "Per page: "%}</span>
{% if per_page == 25 %} {% if per_page == 25 %}

View File

@@ -655,7 +655,7 @@ def repo_view_snapshot(request, repo_id):
# don't show the current commit # don't show the current commit
commits_all = get_commits(repo_id, per_page * (current_page -1) + 1, commits_all = get_commits(repo_id, per_page * (current_page -1) + 1,
per_page + 2) per_page + 1)
commits = commits_all[:per_page] commits = commits_all[:per_page]
if len(commits_all) == per_page + 1: if len(commits_all) == per_page + 1: