diff options
author | jan <jan@ruken.pw> | 2015-12-30 08:32:47 (UTC) |
---|---|---|
committer | jan <jan@ruken.pw> | 2015-12-30 08:32:47 (UTC) |
commit | 36d7f9a0551a98eda1ff2a871254ff19128e7f63 (patch) | |
tree | 779403f4086c32ecf0397c341bee3ba4f406c497 /modules | |
parent | 9ab495abeec5e316adc2da4ac1afbd16d35826df (diff) |
jetzt auch mit korrekter lastPage berechnung. ich sollte diese krasse funktion nach mir benennen, damit auch ich in die geschichtsbücher eingehen kann.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/tags/tags.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/tags/tags.go b/modules/tags/tags.go index 650fa4e..4019f8a 100644 --- a/modules/tags/tags.go +++ b/modules/tags/tags.go | |||
@@ -2,6 +2,7 @@ package tags | |||
2 | 2 | ||
3 | import ( | 3 | import ( |
4 | "log" | 4 | "log" |
5 | "math" | ||
5 | "net/http" | 6 | "net/http" |
6 | "strconv" | 7 | "strconv" |
7 | 8 | ||
@@ -77,7 +78,7 @@ func (m *Module) viewTagPage(w http.ResponseWriter, r *http.Request, p httproute | |||
77 | http.Redirect(w, r, "/", 302) | 78 | http.Redirect(w, r, "/", 302) |
78 | return | 79 | return |
79 | } | 80 | } |
80 | pageCount := (int)((float64)(pageNum)/12.0 + 0.5) | 81 | pageCount := (int)(math.Ceil(float64(pageNum) / 12.0)) |
81 | 82 | ||
82 | if pageNumber > pageCount { | 83 | if pageNumber > pageCount { |
83 | pageNumber = pageCount | 84 | pageNumber = pageCount |