diff options
Diffstat (limited to 'views/lib')
-rw-r--r-- | views/lib/pager.jade | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/views/lib/pager.jade b/views/lib/pager.jade index a762735..1a47e12 100644 --- a/views/lib/pager.jade +++ b/views/lib/pager.jade @@ -1,14 +1,17 @@ -mixin pager(pager, length, f) +mixin pager(pager, f) p - if pager.offset > 0 - a(href=f(pager.prevOffset)) prev - | + if typeof pager.prevOffset == 'number' + a(href=f(pager.prevOffset)) << Previous else - | prev + | Previous - - var nextOffset = pager.nextOffset(length) - if nextOffset > 0 - a(href=f(nextOffset)) next + | + | #{pager.offset / pager.pageSize + 1} / + | #{Math.round(pager.count / pager.pageSize)} + | + + if typeof pager.nextOffset == 'number' + a(href=f(pager.nextOffset)) Next >> else - | next + | Next |