2024-01-05 21:16:02 +00:00
|
|
|
<div class="navbar">
|
|
|
|
<nav>
|
|
|
|
<a href="/"><img src="{{url_for('static', filename='assets/img/wmgzon.png')}}" id="logo" class="not-required" alt="WMGZON Logo"></a>
|
2024-01-15 21:47:18 +00:00
|
|
|
<form action="" method="get">
|
2024-01-05 21:16:02 +00:00
|
|
|
<input type="text" name="search" placeholder="Find your favourite products" class="search-bar">
|
|
|
|
<input type="submit" class="search-button">
|
|
|
|
</form>
|
2024-01-22 10:49:08 +00:00
|
|
|
{% if user != None: %}
|
2024-01-19 11:57:53 +00:00
|
|
|
<a href="/logout">Welcome, {{ user.username }}</a>
|
2024-01-05 21:16:02 +00:00
|
|
|
{% else %}
|
|
|
|
<a href="/login">Login/Signup</a>
|
|
|
|
{% endif %}
|
|
|
|
</nav>
|
2024-01-21 21:33:55 +00:00
|
|
|
|
2024-01-05 21:16:02 +00:00
|
|
|
<centre>
|
2024-01-22 10:49:08 +00:00
|
|
|
{% if user != None and user.role == "Seller" %}
|
2024-01-21 21:33:55 +00:00
|
|
|
<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 %}
|
|
|
|
|
2024-01-05 21:16:02 +00:00
|
|
|
<div class="categories">
|
2024-01-06 01:14:20 +00:00
|
|
|
{# 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 %}
|
2024-01-21 21:33:55 +00:00
|
|
|
<a href="/products/{{c.name}}" class="category">{{c.name}}</a>
|
2024-01-06 01:14:20 +00:00
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
2024-01-05 21:16:02 +00:00
|
|
|
</div>
|
2024-01-05 21:40:32 +00:00
|
|
|
</centre>
|
|
|
|
</div>
|
2023-12-31 16:59:53 +00:00
|
|
|
|
2024-01-27 22:08:15 +00:00
|
|
|
{% with messages = get_flashed_messages(with_categories=true)%}
|
2024-01-05 21:40:32 +00:00
|
|
|
{% if messages %}
|
2024-01-27 22:08:15 +00:00
|
|
|
{% for category, message in messages %}
|
2024-01-05 21:40:32 +00:00
|
|
|
<label>
|
|
|
|
<input type="checkbox" class="alertCheckbox" autocomplete="off" />
|
2024-01-27 22:08:15 +00:00
|
|
|
<div class="alert {{category}}">
|
2024-01-05 21:40:32 +00:00
|
|
|
<span class="alertClose">X</span>
|
|
|
|
<span class="alertText">{{message}}
|
|
|
|
<br class="clear"/></span>
|
|
|
|
</div>
|
|
|
|
</label>
|
|
|
|
{% endfor%}
|
|
|
|
{% endif %}
|
2024-01-19 12:37:51 +00:00
|
|
|
{% endwith %}
|