From 6cd0ff8d23a7d31924c833b9514ca7380e4a851b Mon Sep 17 00:00:00 2001 From: Oleg Baskakov Date: Tue, 15 Sep 2015 12:59:24 -0400 Subject: [PATCH] Previous/Next page buttons #619 *in progress* --- .../main/java/com/collective/celos/ui/UIServlet.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/celos-ui/src/main/java/com/collective/celos/ui/UIServlet.java b/celos-ui/src/main/java/com/collective/celos/ui/UIServlet.java index 7a8b66165..747e72a0e 100644 --- a/celos-ui/src/main/java/com/collective/celos/ui/UIServlet.java +++ b/celos-ui/src/main/java/com/collective/celos/ui/UIServlet.java @@ -154,8 +154,14 @@ private static Tag makeBody(UIConfiguration conf) { } private static Tag makePaginationButtons(UIConfiguration conf) { -// in progress - return div(); + List contents = new ArrayList<>(); + String tParam1 = TIME_PARAM + "=" + (conf.getTimeParam().plusMinutes(conf.getZoomLevelMinutes())); + String tParam2 = TIME_PARAM + "=" + (conf.getTimeParam().minusMinutes(conf.getZoomLevelMinutes())); + String urlPart = "/ui?" + ZOOM_PARAM + "=" + conf.getZoomLevelMinutes(); + contents.add(a("< Prev page").withHref(urlPart + "&" + ZOOM_PARAM + "=" + tParam2)); + contents.add(strong(" | ")); + contents.add(a("Next page >").withHref(urlPart + "&" + ZOOM_PARAM + "=" + tParam1)); + return div().with(contents).withClass("bigButtons"); } private static Tag makeZoomButtons(UIConfiguration conf) {