Pārlūkot izejas kodu

Move COMMENTS_INTRO to _defaults file

Talha Mansoor 11 gadi atpakaļ
vecāks
revīzija
a377054266

+ 7 - 0
templates/_includes/_defaults.html

@@ -47,3 +47,10 @@
 {% set SHARE_POST_INTRO = SHARE_POST_INTRO %}
 {% endif %}
 
+{# Label to show before comments #}
+{% if not COMMENTS_INTRO %}
+{% set COMMENTS_INTRO = '' %}
+{% else %}
+{% set COMMENTS_INTRO = COMMENTS_INTRO %}
+{% endif %}
+

+ 4 - 1
templates/_includes/comments.html

@@ -3,8 +3,11 @@
 <section>
 {% if article.comments_intro %}
 <p id="comment-message">{{ article.comments_intro }} </p>
-{% elif COMMENTS_INTRO %}
+{% else %}
+    {% from '_includes/_defaults.html' import COMMENTS_INTRO with context %}
+    {%if COMMENTS_INTRO %}
 <p id="comment-message">{{ COMMENTS_INTRO }} </p>
+    {% endif %}
 {% endif %}
 <div class="accordion" id="accordion2">
     <div class="accordion-group">