notification: update comment and api endpoint for marking as read/unread

This commit is contained in:
2021-12-29 17:36:14 +01:00
parent 9d638fe897
commit 8fe94bd117
7 changed files with 302 additions and 16 deletions

View File

@@ -18,7 +18,9 @@
{% if notification.comments|length > 0 %}
{% for comment in notification.comments %}
{% if editedCommentForm is null or editedCommentId != comment.id %}
<div>
<a id="comment-{{ comment.id }}"></a>
<blockquote class="chill-user-quote">
{{ comment.content|chill_markdown_to_html }}
</blockquote>
@@ -26,11 +28,30 @@
{% if is_granted('CHILL_MAIN_NOTIFICATION_COMMENT_EDIT', comment) %}
<ul class="record_actions">
<li>
<a href="#" class="btn btn-edit"></a>
<a href="{{ chill_path_forward_return_path('chill_main_notification_show', { '_fragment': 'comment-'~comment.id, 'edit': comment.id, 'id': notification.id }) }}" class="btn btn-edit"></a>
</li>
</ul>
{% endif %}
</div>
{% else %}
<div>
<a id="comment-{{ comment.id }}"></a>
{{ form_start(editedCommentForm) }}
{{ form_widget(editedCommentForm) }}
<input type="hidden" name="form" value="edit" />
<ul class="record_actions">
<li class="cancel">
<a href="{{ chill_path_forward_return_path('chill_main_notification_show', { '_fragment': 'comment-'~comment.id, 'id': notification.id }) }}" class="btn btn-cancel"></a>
</li>
<li>
<button type="submit" class="btn btn-save"></button>
</li>
</ul>
{{ form_end(editedCommentForm) }}
</div>
{% endif %}
{% endfor %}
{% endif %}
@@ -38,6 +59,9 @@
<div>
{{ form_start(appendCommentForm) }}
{{ form_widget(appendCommentForm) }}
<input type="hidden" name="form" value="append" />
<ul class="record_actions">
<li>
<button type="submit" class="btn btn-save">{{ 'notification.append_comment'|trans }}</button>