Skip to content

Commit 711a1d4

Browse files
committed
Fix comment list and form UI.
1 parent 2527186 commit 711a1d4

3 files changed

Lines changed: 20 additions & 18 deletions

File tree

colander/templates/comment/form.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@
33

44
{% if comment_form %}
55
<div class="card bg-secondary-light border-secondary">
6-
<div class="card-body">
6+
<form method="post" action="{% url "create_comment_view" %}" class="row align-items-end g-2">
7+
<div class="card-body pb-0 pt-2">
78
<h6>Post new comment (supports Markdown)</h6>
8-
<form method="post" action="{% url "create_comment_view" %}" class="row align-items-end g-2">
99
{% csrf_token %}
10-
<div class="col">
10+
<div>
1111
{# <small id="hint_id_content" class="form-text text-muted">Write your comment and click on save.</small>#}
1212
<textarea name="content" cols="20" rows="3" class="textarea form-control" required="" id="id_content"
1313
data-lt-tmp-id="lt-620893" spellcheck="false" data-gramm="false"></textarea>
1414
<input type="hidden" value="{{ elt_id }}" name="commented_object">
1515
</div>
16-
<div class="col-md-1 text-center">
17-
<button class="btn btn-primary" type="submit">{% translate "Save" %}</button>
18-
</div>
19-
</form>
2016
</div>
17+
<div class="card-footer bg-transparent border-0 m-0 small text-end">
18+
<button class="btn btn-primary btn-sm" type="submit">{% translate "Save" %}</button>
19+
</div>
20+
</form>
2121
</div>
2222
{% endif %}

colander/templates/comment/list_item.html

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,19 @@
2525
</form>
2626
</div>
2727
<div class="card-footer bg-transparent border-0 m-0 p-0 small text-muted row">
28-
<div class="col fst-italic">
28+
<div class="col-10 fst-italic">
2929
Posted {{ comment.created_at|timesince }} ago
3030
</div>
31-
<div class="col-1 text-end btn-group mb-1" role="group">
32-
<a href="#" comment-id="{{ comment.id }}" class="update-comment-btn btn btn-sm btn-primary text-white">
33-
<i class="nf nf-fa-pencil"></i>
34-
</a>
35-
<a href="{% url "delete_comment_view" pk=comment.id %}" class="delete-comment-btn btn btn-sm btn-danger text-white"
36-
is="vue:ConfirmButton">
37-
<i class="nf nf-fa-trash"></i>
38-
</a>
31+
<div class="col-2 text-end">
32+
<div class="btn-group mb-1" role="group">
33+
<a href="#" comment-id="{{ comment.id }}" class="update-comment-btn btn btn-sm btn-primary text-white">
34+
<i class="nf nf-fa-pencil"></i>
35+
</a>
36+
<a href="{% url "delete_comment_view" pk=comment.id %}" class="delete-comment-btn btn btn-sm btn-danger text-white"
37+
is="vue:ConfirmButton">
38+
<i class="nf nf-fa-trash"></i>
39+
</a>
40+
</div>
3941
</div>
4042
</div>
4143
</div>

colander/templates/helpers/entity_comments.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
<div class="col-12 mt-4">
44
<div class="row">
55
<h5>{% translate "Comments" %}</h5>
6-
<div class="col-6">
6+
<div class="col-lg-6 col-md-12">
77
{% for comment in entity.sorted_comments %}
88
{% include "comment/list_item.html" %}
99
{% empty %}
1010
{% translate "No comment" %}
1111
{% endfor %}
1212
</div>
13-
<div class="col-6">
13+
<div class="col-lg-6 col-md-12">
1414
{% include "comment/form.html" with elt_id=entity.id %}
1515
</div>
1616
</div>

0 commit comments

Comments
 (0)