diff options
author | luxagraf <sng@luxagraf.net> | 2015-07-10 11:23:31 +0000 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2015-07-10 11:23:31 +0000 |
commit | 66e3ed2c34a8e751eb200b9c8e3c593208a2afa2 (patch) | |
tree | ba86ceed762928aa6233e16c891dac950a428941 /design | |
parent | 157298ce0fba338dd15edb9a23388e8ad107c4fe (diff) |
fixed some bugs in enable_comments
Diffstat (limited to 'design')
-rw-r--r-- | design/templates/details/entry.html | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/design/templates/details/entry.html b/design/templates/details/entry.html index 1641ace..ce71987 100644 --- a/design/templates/details/entry.html +++ b/design/templates/details/entry.html @@ -71,22 +71,26 @@ class="{%if t == 0 or t == 2 %}single{%endif%}{%if t == 1 or t == 3 %}double{%en {% include 'mailing_list.html' %} </div> {% endcomment %} </main> - -{% get_comment_count for object as comment_count %}. + {% if object.enable_comments %} +{% get_comment_count for object as comment_count %} {%if comment_count > 0 %} <p class="comments--header">{{comment_count}} Comment{{ comment_count|pluralize }}</p> {% render_comment_list for object %} {%endif%} {% render_comment_form for object %} +{% else %} +<p class="comments--header" style="text-align: center">Sorry, comments have been disabled for this post.</p> +{%endif%} {% endblock %} {% block js %} {% with object.get_template_name_display as t %}{%if t == "single" or t == "single-dark" %} <script src="/media/js/leaflet-master/leaflet-mod.js"></script> <script src="/media/js/detail.min.js"></script> {%endif%}{%endwith%} - <script type="text/javascript"> window.onload = function() { + {% if object.enable_comments %} +{% get_comment_count for object as comment_count %} {%if comment_count > 0 %} //delay loading of gravatar images using noscript data-hash attribute dataattr = document.getElementsByClassName("datahashloader"); @@ -98,6 +102,7 @@ window.onload = function() { c.insertBefore(img, c.childNodes[3]); } {%endif%} +{%endif%} {% with object.get_template_name_display as t %}{%if t == "single" or t == "single-dark" %} createMap(); var open = false; |