diff options
author | Pheng Heong TAN <phtan90@gmail.com> | 2018-04-08 08:54:21 +0800 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2018-04-08 08:54:21 +0800 |
commit | 1610296f54c767c28090b32e7e361931b2ac03b5 (patch) | |
tree | 66cad36b1ff4ccb9bb519e17ce2bac731be41ba1 /templates | |
parent | 7000b418510cc31b59bbfe9c9aae83a38211ccd3 (diff) | |
download | gitea-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.tmpl | 22 |
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 |