diff default/blog/item.html @ 30:69a2e3bf5e17

blog/item: if item is not in same language as current locale, item is hidden but will be shown on click.
author Goffi <goffi@goffi.org>
date Sat, 24 Jun 2017 20:27:12 +0200
parents 2496887339f6
children 16818343fc43
line wrap: on
line diff
--- a/default/blog/item.html	Sat Jun 24 20:25:39 2017 +0200
+++ b/default/blog/item.html	Sat Jun 24 20:27:12 2017 +0200
@@ -1,5 +1,15 @@
 {% block item %}
-<article id="{{ item.id }}" class="box" onclick="this.classList.toggle('clicked')">
+
+{% if item.language and locale and locale != item.language %}
+    {# we may display items in different language in a specific way #}
+    {% set other_lang = " other_lang" %}
+{% endif %}
+
+<article id="{{ item.id }}" class="init box{{other_lang}}" onclick="clicked_cls(this)">
+    {% if other_lang is defined %}
+        <div class="info"><p>{% trans language=locale.language_name %}This message is not in {{language}}, click to display anyway{% endtrans %}</p></div>
+    {% endif %}
+
     <header>
         {% block header %}
         <div class="title">{% block blog_title %}{{ item.title_xhtml or item.title or '' }}{% endblock %}</div>
@@ -24,5 +34,7 @@
             {% trans %}Click to to expand…{% endtrans %}
         </p>
     </div>
+
 </article>
+
 {% endblock item %}