-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
da6e59e
commit 93672d0
Showing
8 changed files
with
158 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 4.1.5 on 2023-02-07 14:05 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('auctions', '0008_listing_favorite'), | ||
] | ||
|
||
operations = [ | ||
migrations.RenameField( | ||
model_name='comment', | ||
old_name='text', | ||
new_name='comment', | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 4.1.5 on 2023-02-07 14:12 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('auctions', '0009_rename_text_comment_comment'), | ||
] | ||
|
||
operations = [ | ||
migrations.RenameField( | ||
model_name='comment', | ||
old_name='comment', | ||
new_name='text', | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,70 +1,81 @@ | ||
{% extends "auctions/layout.html" %} | ||
|
||
{% block body %} | ||
{% if user.is_authenticated %} | ||
{% if listing.seller != user %} | ||
{% if is_favorite %} | ||
<a href="{% url 'favorite' listing.id %}">Remove from watchlist</a> | ||
{% elif listing.active %} | ||
<a href="{% url 'favorite' listing.id %}">Add to watchlist</a> | ||
{% endif %} | ||
<div class="details"> | ||
<img class="details-img" src="{{ listing.photo_url }}"> | ||
|
||
<div> | ||
{% if user.is_authenticated %} | ||
{% if listing.seller != user %} | ||
{% if is_favorite %} | ||
<a href="{% url 'favorite' listing.id %}">Remove from watchlist</a> | ||
{% elif listing.active %} | ||
<a href="{% url 'favorite' listing.id %}">Add to watchlist</a> | ||
{% endif %} | ||
|
||
{% if bidings and last_bid.buyer == user %} | ||
<h5>You won this auction!</h5> | ||
{% if bidings and last_bid.buyer == user and not listing.active %} | ||
<h5>You won this auction!</h5> | ||
{% endif %} | ||
|
||
{% elif listing.active %} | ||
<a href="{% url 'close' listing.id %}">Close auction</a> | ||
{% endif %} | ||
{% endif %} | ||
|
||
{% elif listing.active %} | ||
<a href="{% url 'close' listing.id %}">Close auction</a> | ||
{% endif %} | ||
{% endif %} | ||
|
||
<h2>{{ listing.title }}</h2> | ||
<img src="{{ listing.photo_url }}" width="256"> | ||
<ul> | ||
<li>Description: {{ listing.description }}</li> | ||
<li>Seller: {{ listing.seller }}</li> | ||
{% if listing.category %} | ||
<li>Category: {{ listing.category }}</li> | ||
{% else %} | ||
<li>Category: Category not listed</li> | ||
{% endif %} | ||
<li>Price: {{ listing.price }}</li> | ||
</ul> | ||
<h2>{{ listing.title }}</h2> | ||
|
||
<ul class="details-text"> | ||
<li><strong>Description:</strong> {{ listing.description }}</li> | ||
<li><strong>Seller:</strong> {{ listing.seller }}</li> | ||
{% if listing.category %} | ||
<li><strong>Category:</strong> {{ listing.category }}</li> | ||
{% else %} | ||
<li><strong>Category not listed</li> | ||
{% endif %} | ||
<li class="details-price" ><strong>Price:</strong> {{ listing.price }}</li> | ||
</ul> | ||
|
||
{% if listing.active %} | ||
<h2>Place bid</h2> | ||
<form action="{% url 'listing' listing.id %}" method="post"> | ||
{% csrf_token %} | ||
{{ bid_form }} | ||
<input type="submit" name="bid"> | ||
</form> | ||
{% if listing.active %} | ||
<div class="details-bid"> | ||
<h3>Place bid</h3> | ||
<form action="{% url 'listing' listing.id %}" method="post"> | ||
{% csrf_token %} | ||
{{ bid_form }} | ||
<input type="submit" name="bid"> | ||
</form> | ||
</div> | ||
{% endif %} | ||
</div> | ||
</div> | ||
|
||
<div> | ||
{% if listing.active %} | ||
<h2>Comments</h2> | ||
|
||
<form action="{% url 'listing' listing.id %}" method="post"> | ||
{% csrf_token %} | ||
{{ comment_form }} | ||
<input type="submit" name="comment"> | ||
</form> | ||
|
||
<h2>Comments</h2> | ||
<form action="{% url 'listing' listing.id %}" method="post"> | ||
{% csrf_token %} | ||
{{ comment_form }} | ||
<input type="submit" name="comment"> | ||
</form> | ||
<ul> | ||
{% for comment in comments %} | ||
<li>{{ comment }}</li> | ||
<div class="details-comment"> | ||
<div><strong>{{ comment.user }}</strong></div> | ||
<div>{{ comment.text }}</div> | ||
</div> | ||
{% endfor %} | ||
</ul> | ||
{% else %} | ||
<h2>Comments</h2> | ||
<ul> | ||
|
||
{% else %} | ||
<h2>Comments</h2> | ||
|
||
{% for comment in comments %} | ||
<li>{{ comment }}</li> | ||
<div class="details-comment"> | ||
<div><strong>{{ comment.user }}</strong></div> | ||
<div>{{ comment.text }}</div> | ||
</div> | ||
{% endfor %} | ||
</ul> | ||
{% endif %} | ||
|
||
<h2>Bidings</h2> | ||
<ul> | ||
{% for bid in bidings %} | ||
<li>{{ bid }}</li> | ||
{% empty %} | ||
<li>Minimal bid: {{ listing.initial_bid }}</li> | ||
{% endfor %} | ||
</ul> | ||
{% endif %} | ||
</div> | ||
{% endblock %} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.