2016-10-19 09:57:43 +02:00
|
|
|
| {%- macro render_comment(comment, is_reply) -%}
|
|
|
|
.comment-container(
|
|
|
|
id="{{ comment._id }}",
|
|
|
|
data-node-id="{{ comment._id }}",
|
|
|
|
class="{% if is_reply %}is-reply{% else %}is-first{% endif %}")
|
|
|
|
|
2017-09-25 00:39:34 +02:00
|
|
|
.comment-avatar
|
|
|
|
img(src="{{ comment._user.email | gravatar }}")
|
|
|
|
|
|
|
|
.comment-content
|
|
|
|
.comment-body
|
|
|
|
p.comment-author {{ comment._user.full_name }}
|
|
|
|
|
|
|
|
| {{comment.properties.content_html | safe }}
|
|
|
|
|
|
|
|
// TODO: Markdown preview when editing
|
|
|
|
|
|
|
|
.comment-meta
|
|
|
|
.comment-rating(
|
|
|
|
class="{% if comment._current_user_rating is not none %}rated{% if comment._current_user_rating %} positive{% endif %}{% endif %}")
|
|
|
|
.comment-rating-value(title="Number of likes") {{ comment._rating }}
|
|
|
|
|
|
|
|
| {% if not comment._is_own %}
|
|
|
|
.comment-action-rating.up(title="Like comment")
|
|
|
|
| {% endif %}
|
|
|
|
|
|
|
|
.comment-action-reply(title="Reply to this comment")
|
2017-09-25 01:24:30 +02:00
|
|
|
span Reply
|
2017-09-25 00:39:34 +02:00
|
|
|
|
|
|
|
| {% if comment._is_own %}
|
|
|
|
.comment-action-edit
|
2017-09-25 01:24:30 +02:00
|
|
|
span.edit_mode(title="Edit comment")
|
|
|
|
| Edit
|
2017-09-25 00:39:34 +02:00
|
|
|
span.edit_save(title="Save comment")
|
|
|
|
i.pi-check
|
2017-09-25 01:24:30 +02:00
|
|
|
| Save Changes
|
2017-09-25 00:39:34 +02:00
|
|
|
span.edit_cancel(title="Cancel changes")
|
|
|
|
i.pi-cancel
|
2017-09-25 01:24:30 +02:00
|
|
|
| Cancel
|
2016-10-19 09:57:43 +02:00
|
|
|
| {% endif %}
|
|
|
|
|
2017-09-25 00:39:34 +02:00
|
|
|
.comment-time
|
|
|
|
| {{ comment._created | pretty_date_time }}
|
|
|
|
| {% if comment._created != comment._updated %}
|
|
|
|
span(title="edited {{ comment._updated | pretty_date_time }})") *
|
|
|
|
| {% endif %}
|
2016-10-19 09:57:43 +02:00
|
|
|
|
|
|
|
| {% for reply in comment['_replies']['_items'] %}
|
|
|
|
| {{ render_comment(reply, True) }}
|
|
|
|
| {% endfor %}
|
|
|
|
| {%- endmacro -%}
|