aboutsummaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
authorjan <jan@ruken.pw>2015-12-30 08:27:55 (UTC)
committerjan <jan@ruken.pw>2015-12-30 08:27:55 (UTC)
commit9ab495abeec5e316adc2da4ac1afbd16d35826df (patch)
tree96f190a903b2365321db560821165fa1f78b47eb /views
parent10f014d5da7f1a35d2fc6cf0aa617a5ec4bb074f (diff)
krasse paginationberechnung (patent pending)
Diffstat (limited to 'views')
-rw-r--r--views/tag.html13
1 files changed, 10 insertions, 3 deletions
diff --git a/views/tag.html b/views/tag.html
index 3e89a7b..bc21fc3 100644
--- a/views/tag.html
+++ b/views/tag.html
@@ -1,4 +1,5 @@
1{{ define "tag" }} 1{{ define "tag" }}
2{{ $tagBaseURI := printf "/tag/%s/" .tag }}
2<html> 3<html>
3 <head> 4 <head>
4 {{ template "materialize" }} 5 {{ template "materialize" }}
@@ -17,9 +18,15 @@
17 {{ end }} 18 {{ end }}
18 </div> 19 </div>
19 <ul class="pagination center-align"> 20 <ul class="pagination center-align">
20 <li class="{{ if eq .currentPage 1 }}disabled{{ else }}waves-effect{{ end }}"><a href="/tag/{{ .tag }}/{{ sub .currentPage 1 }}"><i class="material-icons">chevron_left</i></a></li> 21 <li class="{{ if eq .pagination.Current 1 }}disabled{{ else }}waves-effect{{ end }}"><a href="{{ $tagBaseURI }}{{ sub .pagination.Current 1 }}"><i class="material-icons">chevron_left</i></a></li>
21 <li class="active"><a href="#!">{{ .currentPage }}</a></li> 22 {{ range .pagination.Before }}
22 <li class="{{ if eq .currentPage .pageCount }}disabled{{ else }}waves-effect{{ end }}"><a href="/tag/{{ .tag }}/{{ add .currentPage 1 }}"><i class="material-icons">chevron_right</i></a></li> 23 <li class="wave-effect"><a href="{{ $tagBaseURI }}{{ . }}">{{ . }}</a></li>
24 {{ end }}
25 <li class="active"><a href="#!">{{ .pagination.Current }}</a></li>
26 {{ range .pagination.After }}
27 <li class="wave-effect"><a href="{{ $tagBaseURI }}{{ . }}">{{ . }}</a></li>
28 {{ end }}
29 <li class="{{ if eq .pagination.Current .pagination.MaxPage }}disabled{{ else }}waves-effect{{ end }}"><a href="{{ $tagBaseURI }}{{ add .pagination.Current 1 }}"><i class="material-icons">chevron_right</i></a></li>
23 </ul> 30 </ul>
24 </div> 31 </div>
25 </div> 32 </div>