Completed functionality for user to Create products on the site

This commit is contained in:
2024-01-21 21:33:55 +00:00
parent 3ce5d16651
commit cd88926475
4 changed files with 46 additions and 37 deletions

View File

@ -7,7 +7,7 @@
<div class="product-title">{{product.name}}</div>
<div class="product-information">
<div class="product-image">
<img src="{{url_for('static', filename='assets/img/products/' + product.image)}}" alt="Brake Disks"/>
<img src="{{url_for('static', filename='assets/img/products/' + product.image)}}" alt="Brake Disks" height="auto" width="150px" />
</div>
<div class="product-details">
<div class="product-price">£{{product.cost}}</div>

View File

@ -11,15 +11,24 @@
<a href="/login">Login/Signup</a>
{% endif %}
</nav>
<centre>
{% if user != None and user.role == "Seller" %}
<div class="categories">
{# List all available seller tools #}
<a href="/products/add" class="category">Create Products</a>
<a href="/products/ownproducts" class="category">View My Products</a>
<a href="/products/stats" class="category">View Seller Stats</a>
</div>
{% endif %}
<div class="categories">
{# List all categories and ensure the selected one is highlighted #}
{% for c in categories %}
{% if category == c.name %}
<a style="color: cyan" href="/products/{{c.name}}" class="category">{{c.name}}</a>
{% else %}
<a href="/products/{{c.name}}" class="category">{{c.name}}</a>
<a href="/products/{{c.name}}" class="category">{{c.name}}</a>
{% endif %}
{% endfor %}
</div>