summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorPheng Heong TAN <phtan90@gmail.com>2018-04-08 08:54:21 +0800
committerLunny Xiao <xiaolunwen@gmail.com>2018-04-08 08:54:21 +0800
commit1610296f54c767c28090b32e7e361931b2ac03b5 (patch)
tree66cad36b1ff4ccb9bb519e17ce2bac731be41ba1 /templates
parent7000b418510cc31b59bbfe9c9aae83a38211ccd3 (diff)
downloadgitea-1610296f54c767c28090b32e7e361931b2ac03b5.tar.gz
gitea-1610296f54c767c28090b32e7e361931b2ac03b5.zip
Modify pagination. (#3766)
I wanted navigation to the page "first" and the page "last" of the pages of commits. I discovered this has already been implemented in one of the templates. Signed-off-by: Tan Pheng Heong <phtan90@gmail.com>
Diffstat (limited to 'templates')
-rw-r--r--templates/repo/commits_table.tmpl22
1 files changed, 1 insertions, 21 deletions
diff --git a/templates/repo/commits_table.tmpl b/templates/repo/commits_table.tmpl
index 8a8e2c369e..ec433974c9 100644
--- a/templates/repo/commits_table.tmpl
+++ b/templates/repo/commits_table.tmpl
@@ -79,24 +79,4 @@
</div>
{{end}}
-{{with .Page}}
- {{if gt .TotalPages 1}}
- <div class="center page buttons">
- <div class="ui borderless pagination menu">
- <a class="{{if not .HasPrevious}}disabled{{end}} item" {{if .HasPrevious}}href="{{$.RepoLink}}/commits/{{$.BranchNameSubURL}}{{if $.FileName}}/{{$.FileName}}{{end}}?page={{.Previous}}"{{end}}>
- <i class="left arrow icon"></i> {{$.i18n.Tr "repo.issues.previous"}}
- </a>
- {{range .Pages}}
- {{if eq .Num -1}}
- <a class="disabled item">...</a>
- {{else}}
- <a class="{{if .IsCurrent}}active{{end}} item" {{if not .IsCurrent}}href="{{$.RepoLink}}/commits/{{$.BranchNameSubURL}}{{if $.FileName}}/{{$.FileName}}{{end}}?page={{.Num}}"{{end}}>{{.Num}}</a>
- {{end}}
- {{end}}
- <a class="{{if not .HasNext}}disabled{{end}} item" {{if .HasNext}}href="{{$.RepoLink}}/commits/{{$.BranchNameSubURL}}{{if $.FileName}}/{{$.FileName}}{{end}}?page={{.Next}}"{{end}}>
- {{$.i18n.Tr "repo.issues.next"}} <i class="icon right arrow"></i>
- </a>
- </div>
- </div>
- {{end}}
-{{end}}
+{{template "base/paginate" .}} \ No newline at end of file