From e6962670c778966b49620d6166581986fa54cf34 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Tue, 30 Aug 2016 14:38:28 +0300 Subject: fix templates --- juick-www/src/main/java/com/juick/www/PM.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'juick-www/src/main/java/com') diff --git a/juick-www/src/main/java/com/juick/www/PM.java b/juick-www/src/main/java/com/juick/www/PM.java index e64a3606..f912f0b6 100644 --- a/juick-www/src/main/java/com/juick/www/PM.java +++ b/juick-www/src/main/java/com/juick/www/PM.java @@ -39,6 +39,8 @@ import java.util.Map; import java.util.logging.Level; import java.util.logging.Logger; +import static com.juick.www.PageTemplates.sape; + /** * * @author Ugnich Anton @@ -51,7 +53,7 @@ public class PM { String title = "PM: Inbox"; List msgs = PMQueries.getLastPMInbox(sql, visitor.getUID()); msgs.forEach(m -> m.setText(Utils.formatMessage(m.getText()))); - + String links = sape.getPageLinks(request.getRequestURI(), request.getCookies()).render(); response.setContentType("text/html; charset=UTF-8"); try (PrintWriter out = response.getWriter()) { PebbleTemplate template = Utils.getEngine().getTemplate("views/pm_inbox.html"); @@ -60,6 +62,10 @@ public class PM { context.put("visitor", visitor); context.put("msgs", msgs); context.put("tags", TagQueries.getPopularTags(sql)); + if (visitor.getUID() == 0) { + context.put("showAdv", true); + context.put("links", links); + } template.evaluate(out, context); } } -- cgit v1.2.3