Commit 956452cb authored by Felizia Tiburcio's avatar Felizia Tiburcio

Display auction bids on auction page

parent 1b83d454
......@@ -17,13 +17,19 @@ a{% extends 'boodlesite\templates\base.html' %}
<div id="carouselExampleControls" class="carousel slide" data-ride="carousel">
<div class="carousel-inner">
<div class="carousel-item active">
<img class="d-block w-100" src="https://cdn.shopify.com/s/files/1/0502/6421/1616/products/Dream-Valentines-Heart-Beat-Pom-Pom-Beanie_-Limited-Edition-Dream-VD-ALL-Pom-Beanie-Heart_5000x.png?v=1643226660" alt="First slide">
<img class="d-block w-100"
src="https://cdn.shopify.com/s/files/1/0502/6421/1616/products/Dream-Valentines-Heart-Beat-Pom-Pom-Beanie_-Limited-Edition-Dream-VD-ALL-Pom-Beanie-Heart_5000x.png?v=1643226660"
alt="First slide">
</div>
<div class="carousel-item">
<img class="d-block w-100" src="https://cdn.shopify.com/s/files/1/0502/6421/1616/products/Dream-VD-Black-Pom-Beanie-Heart_5000x.png?v=1643226660" alt="Second slide">
<img class="d-block w-100"
src="https://cdn.shopify.com/s/files/1/0502/6421/1616/products/Dream-VD-Black-Pom-Beanie-Heart_5000x.png?v=1643226660"
alt="Second slide">
</div>
<div class="carousel-item">
<img class="d-block w-100" src="https://cdn.shopify.com/s/files/1/0502/6421/1616/products/Dream-VD-Pink-Pom-Beanie-Heart_5000x.png?v=1643226660" alt="Third slide">
<img class="d-block w-100"
src="https://cdn.shopify.com/s/files/1/0502/6421/1616/products/Dream-VD-Pink-Pom-Beanie-Heart_5000x.png?v=1643226660"
alt="Third slide">
</div>
</div>
<a class="carousel-control-prev" href="#carouselExampleControls" role="button" data-slide="prev">
......@@ -50,10 +56,12 @@ a{% extends 'boodlesite\templates\base.html' %}
<p>{{ item_specs }}</p>
</div>
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal" data-whatever="@mdo">Place Bid</button>
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal"
data-whatever="@mdo">Place Bid</button>
<h1>Latest Bids</h1>
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
......@@ -87,38 +95,22 @@ a{% extends 'boodlesite\templates\base.html' %}
</div>
</div>
<h1>This is the Bid: {{ item_bid }}</h1>
<!-- latest bids / history -->
<ul class="cards">
<li><img src="" alt="">
<p>Alice offered 500!</p>
<p>2 seconds ago</p>
</li>
{% if auction_bids %}
{% for bid in auction_bids %}
<li><img src="" alt="">
<p>Bob offered 400!</p>
<p>5 seconds ago</p>
</li>
<li><img src="" alt="">
<p>Charles offered 300!</p>
<p>30 seconds ago</p>
<p>Alice offered {{ bid.amount }}</p>
<p>{{bid.bidtime | timesince}} ago </p>
</li>
{% endfor %}
{% else %}
<h3> no bids placed yet.</h3>
{% endif %}
<li><img src="" alt="">
<p>Charles offered 300!</p>
<p>3 minutes ago</p>
</li>
<li><img src="" alt="">
<p>Charles offered 300!</p>
<p>5 mintues ago</p>
</li>
</ul>
</div>
</div>
......@@ -126,4 +118,3 @@ a{% extends 'boodlesite\templates\base.html' %}
</div>
{% endblock %}
\ No newline at end of file
......@@ -31,14 +31,19 @@ def homepage(request):
def auction(request, pk):
# Current auction ID
auction = Auction.objects.get(pk=pk)
auction_bid = AuctionBid.objects.filter(auctionid=pk)
auction_bids = AuctionBid.objects.filter(auctionid=pk)
auction_item = auction.itemid
print(auction_bids)
print(type(auction_bids))
for bid in auction_bids:
print(bid.amount)
context = {
'item_name':auction_item.itemname,
'item_specs': auction_item.itemspecs,
'item_bid' : auction_bid.amount,
'auction_bids' : auction_bids,
'item_floor_price': auction_item.floorprice
# need to make floor price object here
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment