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 /frontend | |
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 'frontend')
-rw-r--r-- | frontend/utility.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/frontend/utility.go b/frontend/utility.go index 28e7db1..6dbef6a 100644 --- a/frontend/utility.go +++ b/frontend/utility.go | |||
@@ -13,7 +13,7 @@ func PaginationFromPage(pageRange, currentPage, maxPage int) PaginationRange { | |||
13 | var after []int | 13 | var after []int |
14 | 14 | ||
15 | startPage := currentPage - pageRange | 15 | startPage := currentPage - pageRange |
16 | endPage := currentPage + pageRange + 1 | 16 | endPage := currentPage + pageRange |
17 | 17 | ||
18 | if startPage < 1 { | 18 | if startPage < 1 { |
19 | endPage += -startPage + 1 | 19 | endPage += -startPage + 1 |
@@ -36,7 +36,7 @@ func PaginationFromPage(pageRange, currentPage, maxPage int) PaginationRange { | |||
36 | before = append(before, i) | 36 | before = append(before, i) |
37 | } | 37 | } |
38 | 38 | ||
39 | for i := currentPage + 1; i < endPage; i++ { | 39 | for i := currentPage + 1; i < endPage+1; i++ { |
40 | after = append(after, i) | 40 | after = append(after, i) |
41 | } | 41 | } |
42 | 42 | ||