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 }}
|
|
|
|
|
2018-03-27 17:13:12 +02:00
|
|
|
span {{comment.properties | markdowned('content') }}
|
2017-09-25 00:39:34 +02:00
|
|
|
|
|
|
|
// 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 %}")
|
2017-10-27 00:04:38 +02:00
|
|
|
.comment-rating-value(title="{{ _('Number of likes') }}") {{ comment._rating }}
|
2017-09-25 00:39:34 +02:00
|
|
|
|
|
|
|
| {% if not comment._is_own %}
|
2017-10-27 00:04:38 +02:00
|
|
|
.comment-action-rating.up(title="{{ _('Like comment') }}")
|
2017-09-25 00:39:34 +02:00
|
|
|
| {% endif %}
|
|
|
|
|
2017-10-27 00:04:38 +02:00
|
|
|
.comment-action-reply(title="{{ _('Reply to this comment') }}")
|
|
|
|
span {{ _("Reply") }}
|
2017-09-25 00:39:34 +02:00
|
|
|
|
|
|
|
| {% if comment._is_own %}
|
|
|
|
.comment-action-edit
|
2017-10-27 00:04:38 +02:00
|
|
|
span.edit_mode(title="{{ _('Edit comment') }}")
|
|
|
|
| {{ _("Edit") }}
|
|
|
|
span.edit_save(title="{{ _('Save comment') }}")
|
2017-09-25 00:39:34 +02:00
|
|
|
i.pi-check
|
2017-10-27 00:04:38 +02:00
|
|
|
| {{ _("Save Changes") }}
|
|
|
|
span.edit_cancel(title="{{ _('Cancel changes') }}")
|
2017-09-25 00:39:34 +02:00
|
|
|
i.pi-cancel
|
2017-10-27 00:04:38 +02:00
|
|
|
| {{ _("Cancel") }}
|
2016-10-19 09:57:43 +02:00
|
|
|
| {% endif %}
|
|
|
|
|
2017-11-02 15:38:37 +01:00
|
|
|
.comment-time(title='{{ comment._created }}')
|
2017-09-25 00:39:34 +02:00
|
|
|
| {{ comment._created | pretty_date_time }}
|
|
|
|
| {% if comment._created != comment._updated %}
|
2017-10-27 00:04:38 +02:00
|
|
|
span(title="{{ _('edited') }} {{ comment._updated | pretty_date_time }}") *
|
2017-09-25 00:39:34 +02:00
|
|
|
| {% endif %}
|
2016-10-19 09:57:43 +02:00
|
|
|
|
|
|
|
| {% for reply in comment['_replies']['_items'] %}
|
|
|
|
| {{ render_comment(reply, True) }}
|
|
|
|
| {% endfor %}
|
|
|
|
| {%- endmacro -%}
|