35 lines
2.0 KiB
Twig
35 lines
2.0 KiB
Twig
{% extends "template.html.twig" %}
|
|
|
|
{% block content %}
|
|
<table class='table table-hover'>
|
|
<thead>
|
|
<tr>
|
|
<th></th>
|
|
<th></th>
|
|
<th>Name</th>
|
|
<th class="d-none d-md-table-cell">Code</th>
|
|
<th>Categories</th>
|
|
<th></th>
|
|
<th>Price</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='border rounded p-1' alt='{{ product.name }}'/></td>
|
|
<td class="align-middle"><a href='{{ path('app_product', {'productId': product.id}) }}' class="text-decoration-none">{{ product.name }}</a></td>
|
|
<td class="align-middle d-none d-md-table-cell">{{ product.subTitle }}</td>
|
|
<td class="align-middle">
|
|
<ul class='nav'>
|
|
{% for category in product.categories %}
|
|
<li class="nav-item"><a class="nav-link" href="{{ path('app_category', {'category': category}) }}"> {{ category }} </a></li>
|
|
{% endfor %}
|
|
</ul>
|
|
</td>
|
|
<td class="align-middle"><a href='https://pl.ryobitools.eu/{{ product.url }}'>link</a></td>
|
|
<td class="align-middle">{{ product.price.last.price }}</td>
|
|
<td class="align-middle">{% if product.price.last.price != product.price.last.productStandardPrice %}<span class="text-decoration-line-through text-warning">{{ product.price.last.productStandardPrice }}</span> <span class="text-success">{{ ((1 - product.price.last.price / product.price.last.productStandardPrice)*100)|number_format(0) }}%</span>{% else %}{% endif %}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</table>
|
|
{% endblock %} |