102 lines
6.8 KiB
Twig
102 lines
6.8 KiB
Twig
{% extends "template.html.twig" %}
|
|
|
|
{% block content %}
|
|
{% if listType starts with 'category_' %}
|
|
{{ renderCategoryTree(categoryTree, category) | raw }}
|
|
{% endif %}
|
|
|
|
{% if listType starts with 'promos' %}
|
|
<ul class="list-group list-group-flush">
|
|
{% for locale, promoByLocale in promos %}
|
|
<li class="list-group-item">
|
|
<h5 class="d-inline-block"><span class="badge bg-info">{{ locale | upper }}</span></h5>
|
|
{% for promo in promoByLocale %}
|
|
<a href="{{ path('app_promos', {'promo': promo.slug}) }}"><span
|
|
class="badge bg-info">PROMO: {{ promo.tag }} [{{ promo.locale | upper }}]</span></a>
|
|
{% endfor %}
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
{% endif %}
|
|
|
|
|
|
{% if (listType starts with 'category_' and category == null) or not (listType starts with 'category_') or (listType starts with 'category_' and category is not null) %}
|
|
<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>
|
|
<br>
|
|
{% if product.stock > 0 %}
|
|
<span class="badge text-bg-secondary">stock: {{ product.stock }}</span>
|
|
{% else %}
|
|
<span class="badge text-bg-warning">out of stock</span>
|
|
{% endif %}
|
|
{% if product.isDiscontinued() %}
|
|
<a href="{{ path('app_discontinued') }}"><span class="badge text-bg-secondary" data-bs-title="Last update: {{ product.lastSeen }}">is discontinued</span></a>
|
|
{% endif %}
|
|
{% if product.isNew() %}
|
|
<a href="{{ path('app_new') }}"><span class="badge text-bg-success">is new</span></a>
|
|
{% endif %}
|
|
<a href="{{ path('app_search', {'search': product.subTitle}) }}"><span class="badge text-bg-secondary">{{ product.subTitle }}</span></a>
|
|
{% if product.promotions is not null and product.promotions.hasPromotion %}<a href="{{ path('app_promos', {'promo': product.promotions.slug}) }}"><span class="badge bg-info">PROMO: {{ product.promotions.tag }}</span></a>{% endif %}
|
|
<span class="badge text-bg-secondary">{{ product.country.countryName }}</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://{{ product.country.locale }}.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(product.country.currency, {}, product.country.locale) }}
|
|
{% else %}
|
|
{% if product.priceLowest != product.priceCurrent %}{{ product.priceLowest | format_currency(product.country.currency, {}, product.country.locale) }}{% else %}
|
|
<span class="badge text-bg-info">now lowest</span>{% endif %}</td>
|
|
{% endif %}
|
|
|
|
<td class="align-middle text-end">{{ product.priceCurrent | format_currency(product.country.currency, {}, product.country.locale) }}</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(product.country.currency, {}, product.country.locale) }}</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>
|
|
{% endif %}
|
|
{% endblock %}
|