Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
klaus
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitHub Mirror
jonashaag
klaus
Commits
84fc5b0b
Commit
84fc5b0b
authored
13 years ago
by
Jonas Haag
Browse files
Options
Downloads
Patches
Plain Diff
Implemented history pagination.
parent
5feae5c1
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
templates/history.html
+11
-4
11 additions, 4 deletions
templates/history.html
templates/history.inc.html
+5
-2
5 additions, 2 deletions
templates/history.inc.html
with
16 additions
and
6 deletions
templates/history.html
+
11
−
4
View file @
84fc5b0b
...
...
@@ -3,11 +3,18 @@
{% block content %}
{% from 'history.inc.html' import history %}
{% call history(repo, path, max_length=30, skip=30*page) %}
{% call
(have_more_commits)
history(repo, path, max_length=30, skip=30*page) %}
<div
class=
pagination
>
<a
href=
"{{ urls.prev }}"
{%
if
page =
=
1%}
class=
inactive{%
endif
%}
>
« newer
</a>
<a
href=
"{{ urls.next }}"
>
» older
</a>
{% if page %}
<a
href=
"{{ urls.prev }}"
>
« newer
</a>
{% else %}
<a
href=
#
class=
inactive
>
« newer
</a>
{% endif %}
{% if have_more_commits %}
<a
href=
"{{ urls.next }}"
>
» older
</a>
{% else %}
<a
href=
#
class=
inactive
>
» older
</a>
{% endif%}
</div>
{% endcall %}
...
...
This diff is collapsed.
Click to expand it.
templates/history.inc.html
+
5
−
2
View file @
84fc5b0b
{% macro history(repo, path, max_length, skip=0) %}
<div
class=
history
>
{% set history = repo.history(max_commits=max_length+1, path=path, skip=skip) %}
<ul>
{% for commit in repo.history(max_commits=max_length, path=path, skip=skip) %}
{% for commit in history %}
{% if not loop.last or history|length
<
max_length
%}
<
li
>
<span
class=
id
>
<a
href=
"{{ build_url('view_commit', repo=repo.name, id=commit.id) }}"
>
...
...
@@ -11,8 +13,9 @@
<span
class=
message
>
{{ commit.message.decode('utf-8')|shorten_message }}
</span>
<span
class=
datetime
>
{{ commit.commit_time|timesince }} ago
</span>
</li>
{% endif %}
{% endfor %}
</ul>
{% if caller %}{{ caller() }}{% endif %}
{% if caller %}{{ caller(
history|length == max_length+1
) }}{% endif %}
</div>
{% endmacro %}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment