Style Customization
Some actual customizations has been done in the example project
1- Templates and default blocks:
BS classes, pagination and some other template values can be now customized from within your templates directory as follows:
Create
commentfolder inside templates directory.Create a new template file
.htmlgive it the same name of the default template that needs to be overridden and put it in the right directory.Templates tree:
comment └── templates └── comment ├── anonymous │ ├── confirmation_request.html │ ├── confirmation_request.txt │ └── discarded.html ├── comments │ ├── apply_icon.html │ ├── base.html │ ├── cancel_icon.html │ ├── child_comment.html │ ├── comment_body.html │ ├── comment_content.html │ ├── comment_form.html │ ├── comment_modal.html │ ├── content.html │ ├── create_comment.html │ ├── delete_icon.html │ ├── edit_icon.html │ ├── messages.html │ ├── pagination.html │ ├── parent_comment.html │ ├── reject_icon.html │ ├── resolve_icon.html │ ├── three_dots_menu.html │ ├── update_comment.html │ └── urlhash.html ├── email │ ├── email_template.html │ └── footer.html ├── flags │ ├── flag_icon.html │ ├── flag_modal.html │ └── flags.html ├── follow │ ├── follow.html │ ├── follow_icon.html │ └── follow_modal.html ├── notifications │ ├── notification.html │ └── notification.txt ├── reactions │ ├── dislike_icon.html │ ├── like_icon.html │ └── reactions.html ├── base.html ├── bootstrap.html └── static.html
for example to override the BS classes of submit buttons and pagination style do the following:
create
templates/comment/comments/create_comment.html{% extends "comment/comments/create_comment.html" %} {% block submit_button_cls %} btn btn-primary btn-block btn-sm {% endblock submit_button_cls %} {# override pagination style: #} {% block pagination %} {% include 'comment/comments/pagination.html' with active_btn='bg-danger' text_style='text-dark' li_cls='page-item rounded mx-1' %} {% endblock pagination %}
Email templates:
Responsive email templates are used from https://github.com/leemunroe/responsive-html-email-template
This can be overridden by creating base.html in templates/comment/email/ directory.
Both confirmation_request.html and notification.html extends the base email template and they have the following blocks
for partial customization:
{% extends "comment/notifications/notification.html" %}
{% block content %}
{# your custom email message/template here #}
{% endblock content %}
{% block footer %}
{# your footer here #}
{% endblock footer %}
PS: The footer template is disabled by default.
2- CSS file:
To customize the default style of comments app , you can create a comment.css file inside static/css directory.
The new created file will override the original file used in the app.