aboutsummaryrefslogtreecommitdiff
path: root/juick-www/src
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2017-05-02 21:41:44 +0300
committerGravatar Vitaly Takmazov2017-05-05 12:07:17 +0300
commitdc3f40eab5b9ab848964a1ff262227b8b61c9e61 (patch)
tree1badaecd6ac7e7a2f20bb914ab9a3a4c74e7d83a /juick-www/src
parent045ca0848c8ee7c771541a5829157531c782cf30 (diff)
juick-www: Pebble's strictVariables
Diffstat (limited to 'juick-www/src')
-rw-r--r--juick-www/src/main/java/com/juick/www/configuration/WwwServletConfiguration.java1
-rw-r--r--juick-www/src/main/java/com/juick/www/controllers/Home.java1
-rw-r--r--juick-www/src/main/webapp/WEB-INF/layouts/content.html4
-rw-r--r--juick-www/src/main/webapp/WEB-INF/views/index.html2
-rw-r--r--juick-www/src/main/webapp/WEB-INF/views/partial/footer.html4
-rw-r--r--juick-www/src/main/webapp/WEB-INF/views/partial/navigation.html2
6 files changed, 8 insertions, 6 deletions
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 @@
<script type="text/javascript" src="/scripts.js"></script>
<link rel="stylesheet" type="text/css" href="/style.css" />
{% block headers %}
- {{ headers | raw }}
+ {{ headers | default('') | raw }}
{% endblock %}
- <title>{{ title }}</title>
+ <title>{{ title | default('Juick') }}</title>
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no" />
<link rel="icon" href="//i.juick.com/favicon.png" />
</head>
diff --git a/juick-www/src/main/webapp/WEB-INF/views/index.html b/juick-www/src/main/webapp/WEB-INF/views/index.html
index 09297ef9..da2117a5 100644
--- a/juick-www/src/main/webapp/WEB-INF/views/index.html
+++ b/juick-www/src/main/webapp/WEB-INF/views/index.html
@@ -63,7 +63,7 @@
</nav>
</article>
{% endfor %}
-{% if next is not empty %}
+{% if (next | default('')) is not empty %}
{{ next | raw }}
{% endif %}
{% endblock %}
diff --git a/juick-www/src/main/webapp/WEB-INF/views/partial/footer.html b/juick-www/src/main/webapp/WEB-INF/views/partial/footer.html
index 491cf140..61267396 100644
--- a/juick-www/src/main/webapp/WEB-INF/views/partial/footer.html
+++ b/juick-www/src/main/webapp/WEB-INF/views/partial/footer.html
@@ -11,7 +11,7 @@
<a href="https://www.facebook.com/JuickCom" rel="nofollow" class="ico32-fb">Facebook</a>
</div>
<div id="footer-left">juick.com &copy; 2008-2017
- {% if links is not empty %}
+ {% if links | default ('') is not empty %}
<br/>{{ i18n("messages","label.sponsors") }}: {{ links }}
{% endif %}
</div>
@@ -24,7 +24,7 @@
ga('create','UA-385578-4','juick.com');
ga('require','displayfeatures');
ga('send','pageview');
- {% if (sapeon) %}
+ {% if (sapeon | default(false)) %}
var _acic={dataProvider:10};
(function(){
var e=document.createElement('script');e.type='text/javascript';e.async=true;e.src='//www2.aci'+'nt.net/aci.js';
diff --git a/juick-www/src/main/webapp/WEB-INF/views/partial/navigation.html b/juick-www/src/main/webapp/WEB-INF/views/partial/navigation.html
index 3fbfaf5a..998aa422 100644
--- a/juick-www/src/main/webapp/WEB-INF/views/partial/navigation.html
+++ b/juick-www/src/main/webapp/WEB-INF/views/partial/navigation.html
@@ -9,7 +9,7 @@
</nav>
<div id="search">
<form action="/">
- <input type="text" name="search" class="text" placeholder="Поиск" value="{{ search }}"/>
+ <input type="text" name="search" class="text" placeholder="Поиск" value="{{ search | default('') }}"/>
</form>
</div>
<section id="headdiv">