Added highlighting for selected category
This commit is contained in:
22
templates/Car Parts.html
Normal file
22
templates/Car Parts.html
Normal file
@ -0,0 +1,22 @@
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/carparts.css') }}">
|
||||
|
||||
<div class="filter-pane">
|
||||
<form action="" class="filter-items">
|
||||
<div class="number-plate">
|
||||
<span class="country-identifier">
|
||||
<img src="https://mycarneedsa.com/assets/flint/img/flag_europe_gb.png" alt="">
|
||||
</span>
|
||||
<span class="vrn">
|
||||
<input type="text" class="vrn-text" placeholder="YOUR REG" name="vrn">
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<select class="product-filter not-required" name="filter">
|
||||
<option value="relevance">Most Relevant</option>
|
||||
<option value="price-lh">Price: Low -> High</option>
|
||||
<option value="price-hl">Price: High -> Low</option>
|
||||
</select>
|
||||
|
||||
<input type="submit" class="search-button" value="Filter">
|
||||
</form>
|
||||
</div>
|
@ -1,39 +0,0 @@
|
||||
|
||||
<div class="filter-pane">
|
||||
<form action="" class="filter-items">
|
||||
<div class="number-plate">
|
||||
<span class="country-identifier">
|
||||
<img src="https://mycarneedsa.com/assets/flint/img/flag_europe_gb.png" alt="">
|
||||
</span>
|
||||
<span class="vrn">
|
||||
<input type="text" class="vrn-text" placeholder="YOUR REG" name="vrn">
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<select class="product-filter not-required" name="filter">
|
||||
<option value="relevance">Most Relevant</option>
|
||||
<option value="price-lh">Price: Low -> High</option>
|
||||
<option value="price-hl">Price: High -> Low</option>
|
||||
</select>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="product-container">
|
||||
{% if products != None %}
|
||||
{% for product in products %}
|
||||
<div class="product">
|
||||
<div class="product-title">{{product.name}}</div>
|
||||
<div class="product-information">
|
||||
<div class="product-image">
|
||||
<img src="{{url_for('static', filename=product.image)}}" alt="Brake Disks"/>
|
||||
</div>
|
||||
<div class="product-details">
|
||||
<div class="product-price">£{{product.cost}}</div>
|
||||
<div class="product-description">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="product-add-to-cart"></div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</div>
|
@ -1,3 +1,5 @@
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/products.css') }}">
|
||||
|
||||
<div class="product-container">
|
||||
{% if products != None %}
|
||||
{% for product in products %}
|
||||
@ -9,7 +11,7 @@
|
||||
</div>
|
||||
<div class="product-details">
|
||||
<div class="product-price">£{{product.cost}}</div>
|
||||
<div class="product-description">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation</div>
|
||||
<div class="product-description">{{product.description}}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="product-add-to-cart"></div>
|
||||
|
@ -14,12 +14,14 @@
|
||||
|
||||
<centre>
|
||||
<div class="categories">
|
||||
<a href="/products/CarParts" class="category">Car Parts</a>
|
||||
<a href="/products/Animals" class="category">Animals</a>
|
||||
<a href="/products/Sports" class="category">Sports</a>
|
||||
<a href="/products/Books" class="category">Books</a>
|
||||
<a href="/products/Phones" class="category">Phones</a>
|
||||
<a href="/products/Music" class="category">Music</a>
|
||||
{# 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>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</centre>
|
||||
</div>
|
||||
|
@ -11,7 +11,14 @@
|
||||
</head>
|
||||
<body>
|
||||
{% include 'header.html' %}
|
||||
|
||||
|
||||
<div class="container">
|
||||
{% if category is defined %}
|
||||
{% set include_file = category+".html" %}
|
||||
{% include include_file ignore missing %}
|
||||
{% endif %}
|
||||
|
||||
{% include content %}
|
||||
</div>
|
||||
</body>
|
||||
|
Reference in New Issue
Block a user