Templates¶
This page details the list of templates provided by django-comments-xtd. They are located under the django_comments_xtd/
templates directory.
email_confirmation_request
¶
As .html
and .txt
, this template represents the confirmation message sent to the user when the Send button is clicked to post a comment. Both templates are sent in a multipart message, or only in text format if the COMMENTS_XTD_SEND_HTML_EMAIL
setting is set to False
.
In the context of the template the following objects are expected:
The
site
object (django-contrib-comments, and in turn django-comments-xtd, use the Django Sites Framework).The
comment
object.The
confirmation_url
the user has to click on to confirm the comment.
user_feedback.html
¶
This template is expected to be in the directory includes/django_comments_xtd/
, and it provides a way to customized the look of the like and dislike buttons as long as the list of users who clicked on them. It is included from comment_tree.html
. The template is rendered only when the Tag render_xtdcomment_tree is used with the argument allow_feedback
.
In the context of the template is expected:
The boolean variable
show_feedback
, which will be set toTrue
when passing the argumentshow_feedback
to the Tag render_xtdcomment_tree. IfTrue
the template will show the list of users who liked the comment and the list of those who disliked it.A comment
item
.
Look at the section Show the list of users to read on this particular topic.
like.html
¶
This template is rendered when the user clicks on the like button of a comment.
The context of the template expects:
A boolean
already_liked_it
that indicates whether the user already clicked on the like button of this comment. In such a case, if the user submits the form a second time the liked-it flag is withdrawn.The
comment
subject to be liked.
liked.html
¶
This template is rendered when the user click on the submit button of the form presented in the like.html
template. The template is meant to thank the user for the feedback. The context for the template doesn’t expect any specific object.
dislike.html
¶
This template is rendered when the user clicks on the dislike button of a comment.
The context of the template expects:
A boolean
already_disliked_it
that indicates whether the user already clicked on the dislike button for this comment. In such a case, if the user submits the form a second time the disliked-it flag is withdrawn.The
comment
subject to be liked.
disliked.html
¶
This template is rendered when the user click on the submit button of the form presented in the dislike.html
template. The template is meant to thank the user for the feedback. The context for the template doesn’t expect any specific object.
discarded.html
¶
This template gets rendered if any receiver of the signal confirmation_received
returns False
. Informs the user that the comment has been discarded. Read the subsection Signal and receiver in the Control Logic to know about the confirmation_received
signal.
email_followup_comment
¶
As .html
and .txt
, this template represents the mail message sent to notify that comments have been sent after yours. It’s sent to the user who posted the comment in the first place, when another comment arrives in the same thread or in a not nested list of comments. To receive this email the user must tick the box Notify me follow up comments via email.
The template expects the following objects in the context:
The
site
object.The
comment
object about which users are being informed.The
mute_url
to offer the notified user the chance to stop receiving notifications on new comments.
comment.html
¶
This template is rendered under any of the following circumstances:
When using the Tag render_last_xtdcomments.
When a logged in user sends a comment via Ajax. The comment gets rendered immediately. JavaScript client side code still has toe handle the response.
posted.html
¶
Rendered when a not authenticated user sends a comment. It informs the user that a confirmation message has been sent and that the link contained in the mail must be clicked to confirm the publication of the comment.
muted.html
¶
Rendered when a user clicks on the mute link received in a follow-up notification message. It informs the user that the site will not send more notifications on new comments sent to the object.
only_users_can_post.html
¶
django-comments-xtd can be customize so that only registered users can post comments. Read the use case Only registered users can post, for details. The purpose of this template is to allow customizing the HTML message displayed when a non-registered visitor gets to the comments page. The message is displayed instead of the comment form.
This template expects a context variable html_id_suffix
.
comment_tree.html
¶This template is rendered by the Tag render_xtdcomment_tree to represent the comments posted to an object.
In the context of the template the following objects are expected:
A list of dictionaries called
comments
in which each element is a dictionary like:Optionally the following objects can be present in the template:
A boolean
allow_flagging
to indicate whether the user will have the capacity to suggest comment removal.A boolean
allow_feedback
to indicate whether the user will have the capacity to like/dislike comments. WhenTrue
the special templateuser_feedback.html
will be rendered.