Added a new view for favorite ongoing auctions.

Added a button to add to favorites.
Updated views, urls, base, auction python and HTML files accordingly.
parent 29a17ac0
...@@ -66,8 +66,9 @@ ...@@ -66,8 +66,9 @@
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#placeBidModal" <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#placeBidModal"
data-whatever="@mdo">Place Bid</button> data-whatever="@mdo">Place Bid</button>
<button type="button" class="btn btn-dark">Add to My favorites</button>
<!-- MODAL FOR BIDDING -->
<div class="modal fade" id="placeBidModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" <div class="modal fade" id="placeBidModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
aria-hidden="true"> aria-hidden="true">
<div class="modal-dialog" role="document"> <div class="modal-dialog" role="document">
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
background-color: pink; background-color: pink;
border: 2px dotted black; border: 2px dotted black;
} }
</style> </style>
</head> </head>
<body> <body>
...@@ -32,12 +32,13 @@ ...@@ -32,12 +32,13 @@
<nav id="main"> <nav id="main">
<ul> <ul>
<li class="logo"><a href="#">LOST.</a></li> <li class="logo"><a href="#">LOST.</a></li>
<li><a href="/">Home</a></li> <li><a href="/">Home</a></li>
<li><a href="#">About</a></li> <li><a href="#">About</a></li>
<li><a href="#">Help</a></li> <li><a href="#">Help</a></li>
<li><a href="#">My Profile</a></li> <li><a href="/myFavoriteAuctions">My Favorite Auctions</a></li>
<li><a href="/store">My Store</a></li> <li><a href="#">My Profile</a></li>
<li><a href="/store">My Store</a></li>
</ul> </ul>
</nav> </nav>
......
{% extends 'boodlesite\templates\base.html' %}
{% load static %}
{% block title %}My favorite ongoing auctions{% endblock %}
{% block styles %}
{% endblock %}
{% block content %}
<!--Change auctions_now, auction to like favorites, favorite-->
<div class="event-container">
{% if auctions_now %}
{% for auction in auctions_now %}
<div class="event">
{% comment %} <img src="http://via.placeholder.com/640x360" alt="">
<div class="event-text">
<a href="{% url 'auctionid' auction.auctionid %}">
<h3>{{ auction.title }}</h3>
</a>
<p>{{ auction.info }}</p>
</div> {% endcomment %}
</div>
{% endfor %}
{% else %}
<h3> No Favorites.</h3>
{% endif %}
</div>
</div>
{% endblock %}
...@@ -68,8 +68,7 @@ ...@@ -68,8 +68,7 @@
{% else %} {% else %}
<h3> no auctions happening yet.</h3> <h3> no auctions happening yet.</h3>
{% endif %} {% endif %}
</div>
</div>
</div> </div>
<div class="title-container"><h1> Upcoming Events </h1></div> <div class="title-container"><h1> Upcoming Events </h1></div>
......
...@@ -12,5 +12,5 @@ urlpatterns = [ ...@@ -12,5 +12,5 @@ urlpatterns = [
path('additem', addItem, name='additem'), path('additem', addItem, name='additem'),
path('additem/<int:pk>', addItem, name='additemid'), path('additem/<int:pk>', addItem, name='additemid'),
path('startauction', startAuction, name='startauction'), path('startauction', startAuction, name='startauction'),
path('myFavoriteAuctions', myFavoriteAuctions, name='myFavoriteAuctions')
] ]
\ No newline at end of file
...@@ -136,3 +136,8 @@ def startAuction(request): ...@@ -136,3 +136,8 @@ def startAuction(request):
return render(request, "boodlesite/templates/startauction.html", context) return render(request, "boodlesite/templates/startauction.html", context)
def myFavoriteAuctions(request):
# filter the favorites i think from auction tapos
# we need to add things like .add() and .remove()
return render(request, "boodlesite/templates/favorites.html")
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