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>
This commit is contained in:
parent
7000b41851
commit
1610296f54
1 changed files with 1 additions and 21 deletions
|
@ -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" .}}
|
Reference in a new issue