]> source.dussan.org Git - gitea.git/commitdiff
Modify pagination. (#3766)
authorPheng Heong TAN <phtan90@gmail.com>
Sun, 8 Apr 2018 00:54:21 +0000 (08:54 +0800)
committerLunny Xiao <xiaolunwen@gmail.com>
Sun, 8 Apr 2018 00:54:21 +0000 (08:54 +0800)
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>
templates/repo/commits_table.tmpl

index 8a8e2c369e1853b88d3185f5e2d13f82e8066d8b..ec433974c923cd7f46a1e5f02faffb30800d8480 100644 (file)
        </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