aboutsummaryrefslogtreecommitdiff
path: root/views/lib
diff options
context:
space:
mode:
Diffstat (limited to 'views/lib')
-rw-r--r--views/lib/pager.jade14
1 files changed, 14 insertions, 0 deletions
diff --git a/views/lib/pager.jade b/views/lib/pager.jade
new file mode 100644
index 0000000..a762735
--- /dev/null
+++ b/views/lib/pager.jade
@@ -0,0 +1,14 @@
+mixin pager(pager, length, f)
+ p
+ if pager.offset > 0
+ a(href=f(pager.prevOffset)) prev
+ |
+ else
+ | prev
+
+ - var nextOffset = pager.nextOffset(length)
+ if nextOffset > 0
+ a(href=f(nextOffset)) next
+ else
+ | next
+