aboutsummaryrefslogtreecommitdiffstats
path: root/templates/base
diff options
context:
space:
mode:
authorMario Lubenka <mario.lubenka@googlemail.com>2019-04-20 06:15:19 +0200
committertechknowlogick <matti@mdranta.net>2019-04-20 00:15:19 -0400
commitfcbac38d6fd8c91be0da5e7f37e7bc69b071253a (patch)
treecdf7c901df75d0d2f26567d1090ed0e3c1af138d /templates/base
parent40dc458bb69f9827e804e2fe51c9f42caf3d3ddc (diff)
downloadgitea-fcbac38d6fd8c91be0da5e7f37e7bc69b071253a.tar.gz
gitea-fcbac38d6fd8c91be0da5e7f37e7bc69b071253a.zip
Unifies pagination template usage (#6531) (#6533)
Diffstat (limited to 'templates/base')
-rw-r--r--templates/base/paginate.tmpl13
1 files changed, 7 insertions, 6 deletions
diff --git a/templates/base/paginate.tmpl b/templates/base/paginate.tmpl
index 4445a019d6..da07fd2ba1 100644
--- a/templates/base/paginate.tmpl
+++ b/templates/base/paginate.tmpl
@@ -1,22 +1,23 @@
-{{with .Page}}
+{{$paginationLink := .Page.GetParams}}
+{{with .Page.Paginater}}
{{if gt .TotalPages 1}}
<div class="center page buttons">
<div class="ui borderless pagination menu">
- <a class="{{if .IsFirst}}disabled{{end}} item navigation" {{if not .IsFirst}}href="{{$.Link}}?sort={{$.SortType}}&q={{$.Keyword}}&tab={{$.TabName}}"{{end}}><i class="angle double left icon"></i><span class="navigation_label">&nbsp;{{$.i18n.Tr "admin.first_page"}}</span></a>
- <a class="{{if not .HasPrevious}}disabled{{end}} item navigation" {{if .HasPrevious}}href="{{$.Link}}?sort={{$.SortType}}&page={{.Previous}}&q={{$.Keyword}}&tab={{$.TabName}}"{{end}}>
+ <a class="{{if .IsFirst}}disabled{{end}} item navigation" {{if not .IsFirst}}href="{{$.Link}}{{if $paginationLink}}?{{$paginationLink}}{{end}}"{{end}}><i class="angle double left icon"></i><span class="navigation_label">&nbsp;{{$.i18n.Tr "admin.first_page"}}</span></a>
+ <a class="{{if not .HasPrevious}}disabled{{end}} item navigation" {{if .HasPrevious}}href="{{$.Link}}?page={{.Previous}}{{if $paginationLink}}&{{$paginationLink}}{{end}}"{{end}}>
<i class="left arrow icon"></i><span class="navigation_label">&nbsp;{{$.i18n.Tr "repo.issues.previous"}}</span>
</a>
{{range .Pages}}
{{if eq .Num -1}}
<a class="disabled item">...</a>
{{else}}
- <a class="{{if .IsCurrent}}active{{end}} item" {{if not .IsCurrent}}href="{{$.Link}}?sort={{$.SortType}}&page={{.Num}}&q={{$.Keyword}}&tab={{$.TabName}}"{{end}}>{{.Num}}</a>
+ <a class="{{if .IsCurrent}}active{{end}} item" {{if not .IsCurrent}}href="{{$.Link}}?page={{.Num}}{{if $paginationLink}}&{{$paginationLink}}{{end}}"{{end}}>{{.Num}}</a>
{{end}}
{{end}}
- <a class="{{if not .HasNext}}disabled{{end}} item navigation" {{if .HasNext}}href="{{$.Link}}?sort={{$.SortType}}&page={{.Next}}&q={{$.Keyword}}&tab={{$.TabName}}"{{end}}>
+ <a class="{{if not .HasNext}}disabled{{end}} item navigation" {{if .HasNext}}href="{{$.Link}}?page={{.Next}}{{if $paginationLink}}&{{$paginationLink}}{{end}}"{{end}}>
<span class="navigation_label">{{$.i18n.Tr "repo.issues.next"}}&nbsp;</span><i class="icon right arrow"></i>
</a>
- <a class="{{if .IsLast}}disabled{{end}} item navigation" {{if not .IsLast}}href="{{$.Link}}?sort={{$.SortType}}&page={{.TotalPages}}&q={{$.Keyword}}&tab={{$.TabName}}"{{end}}><span class="navigation_label">{{$.i18n.Tr "admin.last_page"}}&nbsp;</span><i class="angle double right icon"></i></a>
+ <a class="{{if .IsLast}}disabled{{end}} item navigation" {{if not .IsLast}}href="{{$.Link}}?page={{.TotalPages}}{{if $paginationLink}}&{{$paginationLink}}{{end}}"{{end}}><span class="navigation_label">{{$.i18n.Tr "admin.last_page"}}&nbsp;</span><i class="angle double right icon"></i></a>
</div>
</div>
{{end}}