-
Notifications
You must be signed in to change notification settings - Fork 88
/
Copy pathdetails.html
61 lines (43 loc) · 1.77 KB
/
details.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
{% extends "base.html" %}{% load i18n comments fluent_comments_tags %}
{% block headtitle %}{{ article.title }}{% endblock %}
{% block extrahead %}{{ block.super }}
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}fluent_comments/css/ajaxcomments.css" />
{% endblock %}
{% block scripts %}{{ block.super }}
{% fluent_comments_js_tag %}
{% endblock %}
{% block main %}
<h1>{{ article.title }}</h1>
{{ article.content|linebreaks }}
{% comment %}
The minimal requirement to add comments is simply this:
<div>
{% render_comment_list for article %}
{% render_comment_form for article %}
</div>
However, to have a nice invitation to post comments,
you can use the following example below.
{% endcomment %}
{% get_comment_count for article as comments_count %}
<div id="comments-wrapper">
{% if comments_count %}
<h3 class="has-comments-title">{% blocktrans with entry_title=article.title count comments_count=comments_count %}{{ comments_count }} comment to {{ entry_title }}{% plural %}{{ comments_count }} comments to {{ entry_title }}{% endblocktrans %}</h3>
{% render_comment_list for object %}
{% if not article|comments_are_open %}
<p class="comments-closed">{% trans "Comments are closed." %}</p>
{% endif %}
{% else %}
{# no comments yet, invite #}
{% if article|comments_are_open %}
<h3 class="no-comments-title">{% trans "Leave a reply" %}</h3>
{# include the empty list, so the <div> is there for Ajax code #}
{% render_comment_list for object %}
{% endif %}
{% endif %}
</div>
{% if article|comments_are_open %}
<div id="comments-form-wrapper">
{% render_comment_form for object %}
</div>
{% endif %}
{% endblock %}