-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a view for "no category assigned"
- Loading branch information
1 parent
c9f569d
commit fc423c5
Showing
4 changed files
with
48 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
project_2/commerce/auctions/templates/auctions/no_category_listings.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{% extends "auctions/layout.html" %} | ||
|
||
{% block body %} | ||
<h2>{{ category }}</h2> | ||
|
||
<div class="listings-grid"> | ||
{% for listing in listings %} | ||
<a class="listing-card-link link-offset-2 link-underline link-underline-opacity-0" href="{% url 'listing' listing.title %}"> | ||
<div class="card" style="width: 18rem;"> | ||
{% if listing.imageURL %} | ||
<img src="{{ listing.imageURL }}" alt="listing image" height="200" class="listing-image"> | ||
{% else %} | ||
<div class="placeholder-rectangle"></div> | ||
{% endif %} | ||
<div class="card-body"> | ||
<h5 class="card-title">{{ listing.title }}</h5> | ||
<h6 class="card-subtitle mb-2 text-body">Price: {{ listing.bid }}€</h6> | ||
<p class="card-text">{{ listing.description }}</p> | ||
</div> | ||
<div class="card-footer text-body-secondary"> | ||
<div>Created time: {{ listing.created_at }}</div> | ||
</div> | ||
</div> | ||
</a> | ||
{% empty %} | ||
<p>No listings available without a category.</p> <!-- Message for no listings --> | ||
{% endfor %} | ||
</div> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters