Skip to content

Commit

Permalink
Update listing.html
Browse files Browse the repository at this point in the history
  • Loading branch information
Ekaterina-Vititneva committed Oct 10, 2024
1 parent f565eb9 commit bea2e1f
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions project_2/commerce/auctions/templates/auctions/listing.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,16 @@ <h4 class="listing-bid">{{ listing.bid }}€</h4>
<p class="listing-description-heading">Comments</p>

{% if user.is_authenticated %}

<form action="{% url 'listing' listing.title %}" method="post">
{% csrf_token %}
<input type="hidden" name="form_type" value="comment_form" />
<!-- Ensure this is present -->
<div class="mb-3">{{ comment_form.comment }}</div>
<button type="submit" class="btn btn-primary">Add Comment</button>
</form>
<div class="card mt-3">
<div class="card-body">
<form action="{% url 'listing' listing.title %}" method="post">
{% csrf_token %}
<input type="hidden" name="form_type" value="comment_form" />
<div class="mb-3">{{ comment_form.comment }}</div>
<button type="submit" class="btn btn-primary">Add Comment</button>
</form>
</div>
</div>

{% endif %} {% for comment in comments %}
<div class="card">
Expand Down

0 comments on commit bea2e1f

Please sign in to comment.