53 lines
2.1 KiB
HTML
53 lines
2.1 KiB
HTML
{% extends "auctions/layout.html" %}
|
|
|
|
{% block body %}
|
|
<h2>WatchList </h2>
|
|
{% if Watchlistings %}
|
|
<div class="row">
|
|
{% for listing in Watchlistings %}
|
|
<div class="col-sm-3">
|
|
<a href="listing/{{ listing.title}}" style = "color:inherit;text-decoration: none;">
|
|
<div class="card border-light" style="width: 18rem;">
|
|
<div class="shadow p-2 mb-2 bg-white rounded">
|
|
<img class="card-img-top" src="{{ listing.picture }}" alt="Preview not found">
|
|
|
|
<hr>
|
|
<div class="card-body">
|
|
<h4>{{ listing.title }}</h4><br>
|
|
|
|
|
|
<p class="card-text" style="font-size: large;">
|
|
<b>bid price</b> : ${{listing.price}}<br>
|
|
<b>created by</b>: {{listing.user}}<br>
|
|
|
|
<small><i> created at {{listing.date_added}}</i> </small>
|
|
</p>
|
|
<div class = "text-right">
|
|
<form action = "{% url 'watch' listing.title %}" method="POST">
|
|
{% csrf_token %}
|
|
{% if user not in listing.watchlists.all %}
|
|
<button type="submit" name="watch", value="{{user}}", class="btn btn-primary btn-sm">Watch</button>
|
|
{% else %}
|
|
<button type="submit" name="watch", value="{{user}}", class="btn btn-secondary btn-sm">Unwatch</button>
|
|
{% endif %}
|
|
|
|
<input type="hidden" name="previous" value="{{ request.path }}">
|
|
</form>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</a>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
{% else %}
|
|
<center><h3>There seems to be no listing you are watching !!
|
|
</h3></center>
|
|
{% endif %}
|
|
|
|
{% endblock %} |