summaryrefslogtreecommitdiffstats
path: root/templates/base
diff options
context:
space:
mode:
authorKim "BKC" Carlbäcker <kim.carlbacker@gmail.com>2016-11-07 11:44:49 +0100
committerKim "BKC" Carlbäcker <kim.carlbacker@gmail.com>2016-11-07 12:44:29 +0100
commit562f9b6eae72e3f952a2ce1e74249bcd44e69272 (patch)
tree4646fa27320196cf547a9081ccbf83b9a6484e6a /templates/base
parent86fb1a0cb13de00a5ba49e29efa35573c01c9821 (diff)
downloadgitea-562f9b6eae72e3f952a2ce1e74249bcd44e69272.tar.gz
gitea-562f9b6eae72e3f952a2ce1e74249bcd44e69272.zip
Merge all pagination-templates into 'base/paginate'
to reduce code-duplicity
Diffstat (limited to 'templates/base')
-rw-r--r--templates/base/paginate.tmpl23
1 files changed, 23 insertions, 0 deletions
diff --git a/templates/base/paginate.tmpl b/templates/base/paginate.tmpl
new file mode 100644
index 0000000000..afe34c632f
--- /dev/null
+++ b/templates/base/paginate.tmpl
@@ -0,0 +1,23 @@
+{{with .Page}}
+ {{if gt .TotalPages 1}}
+ <div class="center page buttons">
+ <div class="ui borderless pagination menu">
+ <a class="{{if .IsFirst}}disabled{{end}} item" href="{{$.Link}}?q={{$.Keyword}}"><i class="angle double left icon"></i> {{$.i18n.Tr "admin.first_page"}}</a>
+ <a class="{{if not .HasPrevious}}disabled{{end}} item" {{if .HasPrevious}}href="{{$.Link}}?page={{.Previous}}&q={{$.Keyword}}"{{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="{{$.Link}}?page={{.Num}}&q={{$.Keyword}}"{{end}}>{{.Num}}</a>
+ {{end}}
+ {{end}}
+ <a class="{{if not .HasNext}}disabled{{end}} item" {{if .HasNext}}href="{{$.Link}}?page={{.Next}}&q={{$.Keyword}}"{{end}}>
+ {{$.i18n.Tr "repo.issues.next"}}&nbsp;<i class="icon right arrow"></i>
+ </a>
+ <a class="{{if .IsLast}}disabled{{end}} item" href="{{$.Link}}?page={{.TotalPages}}&q={{$.Keyword}}">{{$.i18n.Tr "admin.last_page"}}&nbsp;<i class="angle double right icon"></i></a>
+ </div>
+ </div>
+ {{end}}
+{{end}}