71 lines
3.9 KiB
Twig
71 lines
3.9 KiB
Twig
{% extends "template.html.twig" %}
|
|
|
|
{% block content %}
|
|
{% cache 'list_' ~ listType %}
|
|
<div class="table-responsive">
|
|
<table class='table table-hover'>
|
|
<thead>
|
|
<tr>
|
|
<th></th>
|
|
<th></th>
|
|
<th>Name</th>
|
|
<th>Categories</th>
|
|
<th></th>
|
|
<th class="text-end">Lowest Price</th>
|
|
<th class="text-end">Current Price</th>
|
|
<th></th>
|
|
</tr>
|
|
</thead>
|
|
{% for product in products %}
|
|
<tr>
|
|
<td class="align-middle font-weight-bold h3"><a class="text-warning text-decoration-none"
|
|
href="{{ path('app_star', {'productId': product.id}) }}">{% if product.starred == true %}★{% else %} ☆ {% endif %}</a></td>
|
|
<td class="align-middle" style="width: 120px;"><img src='{{ product.image }}&width=70' class='img-thumbnail' alt='{{ product.name }}'/></td>
|
|
<td class="align-middle">
|
|
<a href='{{ path('app_product', {'productId': product.id}) }}' class="text-decoration-none">{{ product.name }}</a>
|
|
{% if product.currentStock.stock > 0 %}
|
|
<span class="badge text-bg-light">stock: {{ product.currentStock.stock }}</span>
|
|
{% else %}
|
|
<span class="badge text-bg-warning">out of stock</span>
|
|
{% endif %}
|
|
{% if product.isDiscontinued() %}
|
|
<span class="badge text-bg-secondary" data-bs-toggle="tooltip" data-bs-title="Last update: {{ product.lastSeen }}">is discontinued</span>
|
|
{% endif %}
|
|
{% if product.isNew() %}
|
|
<span class="badge text-bg-success">is new</span>
|
|
{% endif %}
|
|
<span class="badge text-bg-light">{{ product.subTitle }}</span>
|
|
</td>
|
|
<td class="align-middle">
|
|
<nav aria-label="breadcrumb" style="--bs-breadcrumb-divider: '>';" >
|
|
<ol class="breadcrumb mb-0">
|
|
{% for category in product.categories %}
|
|
<li class="breadcrumb-item" aria-current="page"><a class="breadcrumb-item text-decoration-none" href="{{ path('app_category', {'category': category}) }}">{{ category }}</a></li>
|
|
{% endfor %}
|
|
</ol>
|
|
</nav>
|
|
</td>
|
|
<td class="align-middle"><a href='https://pl.ryobitools.eu/{{ product.url }}'>link</a></td>
|
|
<td class="align-middle text-end">
|
|
{% if product.isDiscontinued() or product.priceCurrent == product.productStandardPrice %}
|
|
{{ product.priceLowest | format_currency('PLN', {}, 'pl') }}
|
|
{% else %}
|
|
{% if product.priceLowest != product.priceCurrent %}{{ product.priceLowest | format_currency('PLN', {}, 'pl') }}{%else%}<span class="badge text-bg-info">now lowest</span>{% endif %}</td>
|
|
{% endif %}
|
|
|
|
<td class="align-middle text-end">{{ product.priceCurrent | format_currency('PLN', {}, 'pl') }}</td>
|
|
<td class="align-middle">
|
|
<div class="d-flex flex-row">
|
|
{% if product.priceCurrent != product.productStandardPrice %}<span
|
|
class="badge text-bg-warning text-decoration-line-through flex-fill">{{ product.productStandardPrice | format_currency('PLN', {}, 'pl') }}</span> <span
|
|
class="badge text-bg-success flex-fill">{{ ((1 - product.priceCurrent / product.productStandardPrice)*100)|number_format(0) }}%</span>
|
|
{% endif %}
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</table>
|
|
</div>
|
|
{% endcache %}
|
|
{% endblock %}
|