Skip to content

Commit

Permalink
Bootstrap card for comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Ekaterina-Vititneva committed Sep 20, 2024
1 parent 68edcff commit 67ed024
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions project_2/commerce/auctions/templates/auctions/listing.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,20 @@ <h4 class="listing-bid">{{ listing.bid }}€</h4>
<div class="comments">
<p class="listing-description-heading">Comments</p>
{% if user.is_authenticated %}
<form action="{% url 'listing' listing.title %}" method="post">
{% csrf_token %} {{ comment_form.as_p }}
<input type="hidden" name="form_type" value="comment_form" />
<button type="submit" class="btn btn-primary">Add Comment</button>
</form>
<div class="card">
<form action="{% url 'listing' listing.title %}" method="post">
{% csrf_token %} {{ comment_form.as_p }}
<input type="hidden" name="form_type" value="comment_form" />
<button type="submit" class="btn btn-primary">Add Comment</button>
</form>
</div>

{% endif %} {% for comment in comments %}
<div class="comment-item">
<p><strong>{{ comment.commenter.username }}</strong> ({{ comment.timestamp }}):</p>
<p>{{ comment.comment }}</p>
<div class="card">
<div class="comment-item">
<p><strong>{{ comment.commenter.username }}</strong> ({{ comment.timestamp }}):</p>
<p>{{ comment.comment }}</p>
</div>
</div>
{% empty %}
<p>No comments yet. Be the first to comment!</p>
Expand Down

0 comments on commit 67ed024

Please sign in to comment.