From dc3f40eab5b9ab848964a1ff262227b8b61c9e61 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Tue, 2 May 2017 21:41:44 +0300 Subject: juick-www: Pebble's strictVariables --- .../java/com/juick/www/configuration/WwwServletConfiguration.java | 1 + juick-www/src/main/java/com/juick/www/controllers/Home.java | 1 + juick-www/src/main/webapp/WEB-INF/layouts/content.html | 4 ++-- juick-www/src/main/webapp/WEB-INF/views/index.html | 2 +- juick-www/src/main/webapp/WEB-INF/views/partial/footer.html | 4 ++-- juick-www/src/main/webapp/WEB-INF/views/partial/navigation.html | 2 +- 6 files changed, 8 insertions(+), 6 deletions(-) (limited to 'juick-www/src') diff --git a/juick-www/src/main/java/com/juick/www/configuration/WwwServletConfiguration.java b/juick-www/src/main/java/com/juick/www/configuration/WwwServletConfiguration.java index 877c94ac..944fbb80 100644 --- a/juick-www/src/main/java/com/juick/www/configuration/WwwServletConfiguration.java +++ b/juick-www/src/main/java/com/juick/www/configuration/WwwServletConfiguration.java @@ -85,6 +85,7 @@ public class WwwServletConfiguration extends WebMvcConfigurationSupport { return new PebbleEngine.Builder() .loader(this.templateLoader()) .extension(springExtension()) + .strictVariables(true) .build(); } diff --git a/juick-www/src/main/java/com/juick/www/controllers/Home.java b/juick-www/src/main/java/com/juick/www/controllers/Home.java index a36d0d09..cde9e635 100644 --- a/juick-www/src/main/java/com/juick/www/controllers/Home.java +++ b/juick-www/src/main/java/com/juick/www/controllers/Home.java @@ -189,6 +189,7 @@ public class Home { String links = sape.getPageLinks(requestURI, sapeCookie).render(); model.addAttribute("links", links); } + model.addAttribute("isModerator", visitor.getUid() == 3694); return "views/index"; } } diff --git a/juick-www/src/main/webapp/WEB-INF/layouts/content.html b/juick-www/src/main/webapp/WEB-INF/layouts/content.html index 76662b5d..00614579 100644 --- a/juick-www/src/main/webapp/WEB-INF/layouts/content.html +++ b/juick-www/src/main/webapp/WEB-INF/layouts/content.html @@ -6,9 +6,9 @@ {% block headers %} - {{ headers | raw }} + {{ headers | default('') | raw }} {% endblock %} -