| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- {# section commentaire. prends en parametre un objet Story ou Epic #}
- {# l'objet en parametre doit avoir une propriete 'comments' et une propriete 'uuid' #}
- {% load martortags %}
- <div class="comment-section">
- <ul class="comment-list">
- {% for comment in obj.comments %}
- <li class="comment flex-col" data-id="{{ comment.id }}">
- <div class="flex-row">
- <span class="comment-header"><i class="fa fa-comment"></i> {{ comment.author }}, le {{ comment.created }}</span>
- {% if comment.author.id == request.user.id %}
- <a class="disabled comment-edit-btn" href="" style="margin-left: 20px;"><i class="fa fa-pencil"></i></a>
- <a class="comment-del-btn" href="{% url 'comment_del' comment_id=comment.id %}" style="margin-left: 10px;"><i class="fa fa-trash"></i></a>
- {% endif %}
- </div>
- <div class="comment-display">
- {{ comment.content|safe_markdown }}
- </div>
- </li>
- {% endfor %}
- </ul>
-
- <form action="{% url 'comment_post' obj_uuid=obj.uuid %}" method="post" accept-charset="utf-8" enctype="multipart/form-data">
- {% csrf_token %}
-
- {{ comment_form.as_p }}
-
- <div class="flex-row flex-end" style="margin-top: 10px;">
- <input type="submit">
- </div>
- </form>
-
- </div>
- <script>
- $(".comment-del-btn").click(function (event) {
- if (confirm('Êtes vous sûr de vouloir supprimer le commentaire?')) {
- return true;
- }
- });
- </script>
|