Commit 1eeb586e authored by Christine Dela Rosa's avatar Christine Dela Rosa

Fix profile and store templates

parent 1aad80fe
...@@ -39,14 +39,40 @@ ...@@ -39,14 +39,40 @@
</div> </div>
</div> </div>
<!-- Purchase History -->
<div class="header-container">
<h2> Purchase History </h2>
</div>
<div class="event-container">
{% if won_auctions %}
{% for item in won_items %}
<div class="event">
<img src="https://www.kurin.com/wp-content/uploads/placeholder-square.jpg">
<div class="event-text">
<h3>{{ item.itemname }}</h3>
<p>Sold for: ₱ {{item.sellprice}}</p>
{% for wonauc in won_auctions %}
{% if wonauc.itemid == item %}
<p>{{ wonauc.auctionend }}</p>
{% endif %}
{% endfor %}
</div>
</div>
{% endfor %}
{% else %}
<h4> {{displayname}} has not won any bids.</h4>
{% endif %}
</div>
</div>
<!--Change auctions_now, auction to like favorites, favorite--> <!--Change auctions_now, auction to like favorites, favorite-->
<div class="header-container"> <div class="header-container">
<h2> Current Biddings</h2> <h2> Current Biddings</h2>
</div> </div>
<div class="event-container"> <div class="event-container">
{% if auctions_of_user %} {% if bidsByUser %}
{% for id in ids_of_auction %} {% for id in ids_of_auction %}
<div class="event"> <div class="event">
<img src="https://www.kurin.com/wp-content/uploads/placeholder-square.jpg"> <img src="https://www.kurin.com/wp-content/uploads/placeholder-square.jpg">
...@@ -56,7 +82,7 @@ ...@@ -56,7 +82,7 @@
</a> </a>
<p>{{ id.auctionend }}</p> <p>{{ id.auctionend }}</p>
</div> </div>
</div> </div>
{% endfor %} {% endfor %}
{% else %} {% else %}
......
...@@ -63,14 +63,8 @@ ...@@ -63,14 +63,8 @@
<h2> Current Biddings</h2> <h2> Current Biddings</h2>
</div> </div>
<div class="event-container"> <div class="event-container">
<<<<<<< HEAD
{% if auctions_of_user %} {% if auctions_of_user %}
{% for id in ids_of_auction %} {% for id in ids_of_auction %}
=======
{% if auctionsOfUser %}
{% for id in idsOfAuction %}
{% if id.auctionend > currentdate %}
>>>>>>> origin/xtine
<div class="event"> <div class="event">
<img src="http://via.placeholder.com/640x360" alt=""> <img src="http://via.placeholder.com/640x360" alt="">
<div class="event-text"> <div class="event-text">
......
...@@ -89,15 +89,13 @@ ...@@ -89,15 +89,13 @@
</div> </div>
</div> </div>
</div> </div>
</div>
{% endfor %} {% endfor %}
{% else %} {% else %}
<h4 text-align="center"> Your Inventory is empty. </h4> <h4 text-align="center"> Your Inventory is empty. </h4>
{% endif %} {% endif %}
</div>
......
# Generated by Django 4.0.3 on 2022-05-18 03:50 # Generated by Django 4.0.3 on 2022-03-12 07:26
from django.db import migrations, models from django.db import migrations, models
......
# Generated by Django 3.2.12 on 2022-05-18 09:48
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('main', '0004_delete_userfavorites'),
]
operations = [
migrations.DeleteModel(
name='Boodleuser',
),
]
...@@ -317,9 +317,9 @@ def profile(request, pk): ...@@ -317,9 +317,9 @@ def profile(request, pk):
if auctionend < current_date: if auctionend < current_date:
bids = AuctionBid.objects.filter(auctionid=aucid).order_by('-bidtime') bids = AuctionBid.objects.filter(auctionid=aucid).order_by('-bidtime')
highest_bidder = bids[0].boodleuserid highest_bidder = bids[0].userid
if highest_bidder.userid == current_user.userid: if highest_bidder.id == current_user.id:
itemid = aucid.itemid itemid = aucid.itemid
itemid.sellprice = bids[0].amount itemid.sellprice = bids[0].amount
won_auctions.append(aucid) won_auctions.append(aucid)
...@@ -351,6 +351,8 @@ def profile(request, pk): ...@@ -351,6 +351,8 @@ def profile(request, pk):
'store': current_storeid, 'store': current_storeid,
'bidsByUser' : bids_by_user, 'bidsByUser' : bids_by_user,
'auctions_of_user': auctions_of_user, 'auctions_of_user': auctions_of_user,
'won_items': won_itemids,
'won_auctions': won_auctions,
'auctions': auctions, 'auctions': auctions,
'ids_of_auction': ids_of_auction, 'ids_of_auction': ids_of_auction,
'createStoreForm': form 'createStoreForm': form
......
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