close listing fixes
This commit is contained in:
parent
141491e9dc
commit
42602ff2c7
|
@ -1,72 +1,72 @@
|
||||||
{% extends "auctions/layout.html" %}
|
{% extends "auctions/layout.html" %}
|
||||||
|
|
||||||
{% block body %}
|
{% block body %}
|
||||||
<h2>Active Listings</h2>
|
<h2>Active Listings</h2>
|
||||||
{% if Listings %}
|
{% if Listings %}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
{% for listing in Listings %}
|
{% for listing in Listings %}
|
||||||
{% if not listing.closed %}
|
{% if not listing.closed %}
|
||||||
<div class="col md-3 mb-4">
|
<div class="col md-3 mb-4">
|
||||||
<a href="listing/{{ listing.title}}" style = "color:inherit;text-decoration: none;">
|
<a href="listing/{{ listing.title}}" style = "color:inherit;text-decoration: none;">
|
||||||
<div class="card border-light" style="width: 18rem;">
|
<div class="card border-light" style="width: 18rem;">
|
||||||
<div class="shadow p-2 mb-2 bg-white rounded">
|
<div class="shadow p-2 mb-2 bg-white rounded">
|
||||||
<img class="card-img-top" src="{{ listing.picture }}" alt="Preview not found">
|
<img class="card-img-top" src="{{ listing.picture }}" alt="Preview not found">
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<h4>{{ listing.title }}</h4><br>
|
<h4>{{ listing.title }}</h4><br>
|
||||||
|
|
||||||
<p class="card-text" style="font-size: medium;">
|
<p class="card-text" style="font-size: medium;">
|
||||||
{% for bidding in listing.bidding_listing.all %}
|
{% for bidding in listing.bidding_listing.all %}
|
||||||
<b>bid price</b> : <strong style="color:darkgreen;">${{bidding.bid_value}}</strong><br>
|
<b>bid price</b> : <strong style="color:darkgreen;">${{bidding.bid_value}}</strong><br>
|
||||||
<b>Last bid by</b>: <strong style="color:navy;">{{ bidding.user }}</strong>
|
<b>Last bid by</b>: <strong style="color:navy;">{{ bidding.user }}</strong>
|
||||||
<br>
|
<br>
|
||||||
<b>Description</b>: {{ listing.desc }}<br>
|
<b>Description</b>: {{ listing.desc }}<br>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
<small class="text-muted"><i> created on {{listing.date_added}}</i> </small>
|
<small class="text-muted"><i> created on {{listing.date_added}}</i> </small>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class = "text-right">
|
<div class = "text-right">
|
||||||
|
|
||||||
{% if user.is_authenticated %}
|
{% if user.is_authenticated %}
|
||||||
|
|
||||||
<form action="{% url 'watch' listing.title %}" method="POST">
|
<form action="{% url 'watch' listing.title %}" method="POST">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
{% if user not in listing.watchlists.all %}
|
{% if user not in listing.watchlists.all %}
|
||||||
<button type="submit" name="watch", value="{{user}}", class="btn btn-primary btn-sm">Watch</button>
|
<button type="submit" name="watch", value="{{user}}", class="btn btn-primary btn-sm">Watch</button>
|
||||||
{% else %}
|
{% else %}
|
||||||
<button type="submit" name="watch", value="{{user}}", class="btn btn-secondary btn-sm">Unwatch</button>
|
<button type="submit" name="watch", value="{{user}}", class="btn btn-secondary btn-sm">Unwatch</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<input type="hidden" name="previous" value="{{ request.path }}">
|
<input type="hidden" name="previous" value="{{ request.path }}">
|
||||||
</form>
|
</form>
|
||||||
{% else %}
|
{% else %}
|
||||||
<small>log in to watch this listing</small>
|
<small>log in to watch this listing</small>
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
<br/>
|
<br/>
|
||||||
<br/>
|
<br/>
|
||||||
<br/>
|
<br/>
|
||||||
<center>
|
<center>
|
||||||
<h3> Seems to be no listings in this Auction!!</h3>
|
<h3> Seems to be no listings in this Auction!!</h3>
|
||||||
</center>
|
</center>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
|
@ -5,7 +5,7 @@
|
||||||
<h2>Listing : {{ Listing.title}}</h2>
|
<h2>Listing : {{ Listing.title}}</h2>
|
||||||
|
|
||||||
<div class="text-right">
|
<div class="text-right">
|
||||||
{% if user.username|stringformat:"s" == Listing.user|stringformat:"s" %}
|
{% if user.username|stringformat:"s" == Listing.user|stringformat:"s" and not Listing.closed %}
|
||||||
|
|
||||||
<a class="btn btn-danger" href="{% url 'close_bid' Listing.title %}" role="button" style="display:inline;">Close this Listing</a>
|
<a class="btn btn-danger" href="{% url 'close_bid' Listing.title %}" role="button" style="display:inline;">Close this Listing</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
BIN
db.sqlite3
BIN
db.sqlite3
Binary file not shown.
Loading…
Reference in New Issue