Skip to content

Commit 1610296

Browse files
phtanlunny
authored andcommitted
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 <[email protected]>
1 parent 7000b41 commit 1610296

File tree

1 file changed

+1
-21
lines changed

1 file changed

+1
-21
lines changed

templates/repo/commits_table.tmpl

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -79,24 +79,4 @@
7979
</div>
8080
{{end}}
8181

82-
{{with .Page}}
83-
{{if gt .TotalPages 1}}
84-
<div class="center page buttons">
85-
<div class="ui borderless pagination menu">
86-
<a class="{{if not .HasPrevious}}disabled{{end}} item" {{if .HasPrevious}}href="{{$.RepoLink}}/commits/{{$.BranchNameSubURL}}{{if $.FileName}}/{{$.FileName}}{{end}}?page={{.Previous}}"{{end}}>
87-
<i class="left arrow icon"></i> {{$.i18n.Tr "repo.issues.previous"}}
88-
</a>
89-
{{range .Pages}}
90-
{{if eq .Num -1}}
91-
<a class="disabled item">...</a>
92-
{{else}}
93-
<a class="{{if .IsCurrent}}active{{end}} item" {{if not .IsCurrent}}href="{{$.RepoLink}}/commits/{{$.BranchNameSubURL}}{{if $.FileName}}/{{$.FileName}}{{end}}?page={{.Num}}"{{end}}>{{.Num}}</a>
94-
{{end}}
95-
{{end}}
96-
<a class="{{if not .HasNext}}disabled{{end}} item" {{if .HasNext}}href="{{$.RepoLink}}/commits/{{$.BranchNameSubURL}}{{if $.FileName}}/{{$.FileName}}{{end}}?page={{.Next}}"{{end}}>
97-
{{$.i18n.Tr "repo.issues.next"}} <i class="icon right arrow"></i>
98-
</a>
99-
</div>
100-
</div>
101-
{{end}}
102-
{{end}}
82+
{{template "base/paginate" .}}

0 commit comments

Comments
 (0)