65 lines
3.6 KiB
Twig
65 lines
3.6 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.updated_at }}">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">
|
|
{% 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.lowestPrice.price != product.price.last.price %}{{ product.lowestPrice.price | format_currency('PLN', {}, 'pl') }}{% endif %}</td>
|
|
<td class="align-middle text-end">{{ product.price.last.price | format_currency('PLN', {}, 'pl') }}</td>
|
|
<td class="align-middle">
|
|
<div class="d-flex flex-row">
|
|
{% if product.price.last.price != product.price.last.productStandardPrice %}<span
|
|
class="badge text-bg-warning text-decoration-line-through flex-fill">{{ product.price.last.productStandardPrice | format_currency('PLN', {}, 'pl') }}</span> <span
|
|
class="badge text-bg-success flex-fill">{{ ((1 - product.price.last.price / product.price.last.productStandardPrice)*100)|number_format(0) }}%</span>
|
|
{% endif %}
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</table>
|
|
</div>
|
|
{% endcache %}
|
|
{% endblock %}
|