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 ++++- juick-www/src/main/resources/layouts/content.html | 24 +++++++-------- .../src/main/resources/views/partial/footer.html | 34 ++++++++++++++++++++++ .../src/main/resources/views/partial/tags.html | 6 +--- 4 files changed, 53 insertions(+), 19 deletions(-) create mode 100644 juick-www/src/main/resources/views/partial/footer.html (limited to 'juick-www') 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); } } diff --git a/juick-www/src/main/resources/layouts/content.html b/juick-www/src/main/resources/layouts/content.html index 4cc1e2bf..ef12382c 100644 --- a/juick-www/src/main/resources/layouts/content.html +++ b/juick-www/src/main/resources/layouts/content.html @@ -1,22 +1,19 @@ - - - + + + - + {% block headers %} {{ headers | raw }} {% endblock %} {{ title }} - - - - - -{% include "views/partial/navigation.html" %} + + + + + {% include "views/partial/navigation.html" %}
{% block content %} {% endblock %} @@ -25,5 +22,6 @@ {% block column %} {% endblock %} - + {% include "views/partial/footer.html" %} + \ No newline at end of file diff --git a/juick-www/src/main/resources/views/partial/footer.html b/juick-www/src/main/resources/views/partial/footer.html new file mode 100644 index 00000000..6978a2c0 --- /dev/null +++ b/juick-www/src/main/resources/views/partial/footer.html @@ -0,0 +1,34 @@ + + \ No newline at end of file diff --git a/juick-www/src/main/resources/views/partial/tags.html b/juick-www/src/main/resources/views/partial/tags.html index a2906ef0..4d05b7fb 100644 --- a/juick-www/src/main/resources/views/partial/tags.html +++ b/juick-www/src/main/resources/views/partial/tags.html @@ -1,7 +1,3 @@ {% for tag in tags %} - - - {{ tag.getName() }} - + {{ tag }} {% endfor %} \ No newline at end of file -- cgit v1.2.3