Changeset View
Changeset View
Standalone View
Standalone View
comments/templates/comments/components/comment.html
| Show All 14 Lines | <div | ||||
| {% if comment.delete_url is not None %} data-delete-url="{{ comment.delete_url }}" {% endif %} | {% if comment.delete_url is not None %} data-delete-url="{{ comment.delete_url }}" {% endif %} | ||||
| {% if comment.archive_tree_url is not None %} data-archive-url="{{ comment.archive_tree_url }}" {% endif %}> | {% if comment.archive_tree_url is not None %} data-archive-url="{{ comment.archive_tree_url }}" {% endif %}> | ||||
| <div class="comment-name-date-wrapper"> | <div class="comment-name-date-wrapper"> | ||||
| <div | <div | ||||
| style="background-image:url('{{ profile_image_url }}');" | style="background-image:url('{{ profile_image_url }}');" | ||||
| class="profile col-profile"></div> | class="profile col-profile"></div> | ||||
| <h4 class="comment-name">{{ comment.full_name }}</h4> | <h4 class="comment-name">{{ comment.full_name }}</h4> | ||||
| {% if comment.badges %} | {% if comment.badges %} | ||||
| <p class="badges"> | <p class="badges"> | ||||
| {% with width=16 badges=comment.badges %} | {% with width=16 badges=comment.badges %} | ||||
| {% include 'users/components/badges.html' %} | {% include 'users/components/badges.html' %} | ||||
| {% endwith %} | {% endwith %} | ||||
| </p> | </p> | ||||
| {% endif %} | {% endif %} | ||||
| <p class="comment-date">{{ comment.date|date:"jS F Y - H:i" }}</p> | <p class="comment-date">{{ comment.date|date:"jS F Y - H:i" }}</p> | ||||
| {% if comment.is_archived %} | {% if comment.is_archived %} | ||||
| <p class="badge archived-badge">Archived</p> | <p class="badge archived-badge">Archived</p> | ||||
| {% if comment.is_top_level %} | {% if comment.is_top_level %} | ||||
| <a class="comment-expand-archived" data-toggle="collapse" href="#collapse-{{ comment.id }}" role="button" | <a class="comment-expand-archived" data-toggle="collapse" href="#collapse-{{ comment.id }}" role="button" | ||||
| aria-expanded="false" aria-controls="collapseExample">Show | aria-expanded="false" aria-controls="collapseExample">Show | ||||
| comment{% if comment.replies|length >= 1 %}s{% endif %}</a> | comment{% if comment.replies|length >= 1 %}s{% endif %}</a> | ||||
| {% endif %} | {% endif %} | ||||
| {% endif %} | {% endif %} | ||||
| </div> | </div> | ||||
| {% if comment.is_archived and comment.is_top_level %} | {% if comment.is_archived and comment.is_top_level %} | ||||
| <div class="collapse" id="collapse-{{ comment.id }}"> | <div class="collapse" id="collapse-{{ comment.id }}"> | ||||
| {% endif %} | {% endif %} | ||||
| <div class="col comment-content"> | <div class="col comment-content"> | ||||
| <div class="row comment-content-inner"> | <div class="row comment-content-inner"> | ||||
| <div class="comment-body"> | <div class="comment-body"> | ||||
| <div class="comment-text markdown-text">{% with_shortcodes comment.message_html %}</div> | <div class="comment-text markdown-text">{% with_shortcodes comment.message_html %}</div> | ||||
| {% if not comment.is_deleted %} | {% if not comment.is_deleted %} | ||||
| <div class="comment-toolbar row"> | <div class="comment-toolbar row"> | ||||
| <div class="col d-flex align-items-center"> | <div class="col d-flex align-items-center"> | ||||
| <button | <button | ||||
| class="btn btn-transparent btn-xs btn-icon comment-material-button checkbox-like {% if not user.is_authenticated %}disabled{% endif%}" | class="btn btn-transparent btn-xs btn-icon comment-material-button checkbox-like {% if not user.is_authenticated %}disabled{% endif%}" | ||||
| {% if not user.is_authenticated %}disabled{% endif%} {% if comment.liked %}data-checked="checked" | {% if not user.is_authenticated %}disabled{% endif%} {% if comment.liked %}data-checked="checked" | ||||
| {% endif %}> | {% endif %}> | ||||
| <i class="material-icons checkbox-like-icon-checked text-primary">favorite</i> | <i class="material-icons checkbox-like-icon-checked text-primary">favorite</i> | ||||
| <i class="material-icons checkbox-like-icon-unchecked">favorite_border</i> | <i class="material-icons checkbox-like-icon-unchecked">favorite_border</i> | ||||
| {% if comment.likes != 0 %}<span class="likes-count">{{ comment.likes }}</span>{% endif %} | {% if comment.likes != 0 %}<span class="likes-count">{{ comment.likes }}</span>{% endif %} | ||||
| </button> | </button> | ||||
| <button class="btn btn-transparent btn-xs comment-action comment-reply {% if not user.is_authenticated %}disabled{% endif%}" | <button class="btn btn-transparent btn-xs comment-action comment-reply {% if not user.is_authenticated %}disabled{% endif%}" | ||||
| {% if not user|has_active_subscription %}disabled{% endif%}>Reply</button> | {% if not user|has_active_subscription %}disabled{% endif%}>Reply</button> | ||||
| {% if comment.edit_url or comment.archive_tree_url %} | {% if comment.edit_url or comment.archive_tree_url %} | ||||
| <button class="btn btn-transparent btn-xs btn-icon comment-material-button comment-dropdown" | <button class="btn btn-transparent btn-xs btn-icon comment-material-button comment-dropdown" | ||||
| data-toggle="dropdown"> | data-toggle="dropdown"> | ||||
| <i class="material-icons">more_horiz</i> | <i class="material-icons">more_horiz</i> | ||||
| </button> | </button> | ||||
| <div class="dropdown-menu"> | <div class="dropdown-menu"> | ||||
| {% if comment.edit_url %} | {% if comment.edit_url %} | ||||
| <button class="dropdown-item comment-edit"> | <button class="dropdown-item comment-edit"> | ||||
| <i class="material-icons">create</i> | <i class="material-icons">create</i> | ||||
| <span>Edit</span> | <span>Edit</span> | ||||
| </button> | </button> | ||||
| {% endif %} | {% endif %} | ||||
| {% if comment.delete_url %} | {% if comment.delete_url %} | ||||
| <a href="" class="dropdown-item comment-delete"> | <a href="" class="dropdown-item comment-delete"> | ||||
| <i class="material-icons">delete</i> | <i class="material-icons">delete</i> | ||||
| <span>Delete</span> | <span>Delete</span> | ||||
| </a> | </a> | ||||
| {% endif %} | {% endif %} | ||||
| {% comment %} <a href="" class="dropdown-item comment-report"> | {% comment %} <a href="" class="dropdown-item comment-report"> | ||||
| <i class="material-icons">flag</i> | <i class="material-icons">flag</i> | ||||
| <span>Report</span> | <span>Report</span> | ||||
| </a> {% endcomment %} | </a> {% endcomment %} | ||||
| {% if comment.delete_tree_url %} | {% if comment.delete_tree_url %} | ||||
| <a href="" class="dropdown-item comment-delete-tree"> | <a href="" class="dropdown-item comment-delete-tree"> | ||||
| <i class="material-icons">account_tree</i> | <i class="material-icons">account_tree</i> | ||||
| <span>Delete Tree</span> | <span>Delete Tree</span> | ||||
| </a> | </a> | ||||
| {% endif %} | {% endif %} | ||||
| {% if comment.hard_delete_tree_url %} | {% if comment.hard_delete_tree_url %} | ||||
| <a href="" class="dropdown-item comment-hard-delete-tree"> | <a href="" class="dropdown-item comment-hard-delete-tree"> | ||||
| <i class="material-icons">delete_forever</i> | <i class="material-icons">delete_forever</i> | ||||
| <span>Hard Delete Tree</span> | <span>Hard Delete Tree</span> | ||||
| </a> | </a> | ||||
| {% endif %} | {% endif %} | ||||
| {% if comment.archive_tree_url %} | {% if comment.archive_tree_url %} | ||||
| <a href="" class="dropdown-item comment-archive"> | <a href="" class="dropdown-item comment-archive"> | ||||
| {% if comment.is_archived and comment.is_top_level %} | {% if comment.is_archived and comment.is_top_level %} | ||||
| <i class="material-icons">unarchive</i> | <i class="material-icons">unarchive</i> | ||||
| <span class="comment-archive-text">Un-archive comment</span> | <span class="comment-archive-text">Un-archive comment</span> | ||||
| {% else %} | {% else %} | ||||
| <i class="material-icons">archive</i> | <i class="material-icons">archive</i> | ||||
| <span class="comment-archive-text">Archive comment</span> | <span class="comment-archive-text">Archive comment</span> | ||||
| {% endif %} | {% endif %} | ||||
| </a> | </a> | ||||
| {% endif %} | {% endif %} | ||||
| </div> | </div> | ||||
| {% endif %} | {% endif %} | ||||
| {% comment %} <a href="" class="btn btn-transparent btn-ctrl-xs comment-action comment-edit">Edit</a> | {% comment %} <a href="" class="btn btn-transparent btn-ctrl-xs comment-action comment-edit">Edit</a> | ||||
| <a href="" class="btn btn-transparent btn-ctrl-xs comment-action comment-delete">Delete</a> {% endcomment %} | <a href="" class="btn btn-transparent btn-ctrl-xs comment-action comment-delete">Delete</a> {% endcomment %} | ||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| {% endif %} | {% endif %} | ||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| <div class="comment-edit-inputs"> | <div class="comment-edit-inputs"> | ||||
| </div> | </div> | ||||
| <div class="comment-reply-inputs"> | <div class="comment-reply-inputs"> | ||||
| </div> | </div> | ||||
| <div class="replies"> | <div class="replies"> | ||||
| <div class="comments"> | <div class="comments"> | ||||
| {% if comment.is_top_level %} | {% if comment.is_top_level %} | ||||
| {% if comment.is_top_level %} | {% if comment.is_top_level %} | ||||
| {% include 'comments/components/comment_tree.html' with comment_trees=c.replies|slice:':1' %} | {% include 'comments/components/comment_tree.html' with comment_trees=c.replies|slice:':1' %} | ||||
| {% if c.replies|length > 1 %} | {% if c.replies|length > 1 %} | ||||
| <a class="btn btn-dark btn-sm more-comments-button collapsed" data-toggle="collapse" | <a class="btn btn-dark btn-sm more-comments-button collapsed" data-toggle="collapse" | ||||
| href="#replies-collapse-{{ comment.id }}" role="button" aria-expanded="false" | href="#replies-collapse-{{ comment.id }}" role="button" aria-expanded="false" | ||||
| aria-controls="replies-collapse-{{ comment.id }}"> | aria-controls="replies-collapse-{{ comment.id }}"> | ||||
| Show more replies | Show more replies | ||||
| </a> | </a> | ||||
| <div class="collapse" id="replies-collapse-{{ comment.id }}"> | <div class="collapse" id="replies-collapse-{{ comment.id }}"> | ||||
| {% include 'comments/components/comment_tree.html' with comment_trees=c.replies|slice:'1:' %} | {% include 'comments/components/comment_tree.html' with comment_trees=c.replies|slice:'1:' %} | ||||
| </div> | </div> | ||||
| {% endif %} | {% endif %} | ||||
| {% else %} | {% else %} | ||||
| {% include 'comments/components/comment_tree.html' with comment_trees=c.replies %} | {% include 'comments/components/comment_tree.html' with comment_trees=c.replies %} | ||||
| {% endif %} | {% endif %} | ||||
| {% endif %} | {% endif %} | ||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| {% if comment.is_archived and comment.is_top_level %} | {% if comment.is_archived and comment.is_top_level %} | ||||
| </div> | </div> | ||||
| {% endif %} | {% endif %} | ||||
| </div> | </div> | ||||
| {% if comment.is_top_level is not True %} | {% if comment.is_top_level is not True %} | ||||
| {% include 'comments/components/comment_tree.html' with comment_trees=c.replies %} | {% include 'comments/components/comment_tree.html' with comment_trees=c.replies %} | ||||
| {% endif %} | {% endif %} | ||||