{% trans_default_domain 'products' %}
<div {{ attributes }}>
   {% block delivery_time_info %}{% endblock %}
   <div class="table-wrapper">
      <table>
         {% for type, group in this.deliveries.groupsByType %}
            {# 1 - na adresu
            2 - osobní převzetí
            3 - pointy
            4 - virtuálně (poukazy)
            #}
            <tr class="title">
               <td>
                  {% if type == 1 %}
                     {{ this.title_delivery|default('delivery.title'|trans) }}
                  {% elseif type == 2 %}
                     {{ this.title_inperson|default('delivery.title.inperson'|trans) }}
                  {% elseif type == 3 %}
                     {{ this.title_point|default('delivery.title.point'|trans) }}
                  {% endif %}
               </td>
               {% if this.inStore %}
                  <td>{{ 'delivery.date'|trans }}</td>
               {% endif %}
               <td class="price-title">{{ 'delivery.price'|trans }}</td>
            </tr>

            {% for delivery in group %}
               <tr>
                  <td class="name">
                     {% if delivery.photo %}
                        <twig:Picture class="img-responsive" thumbnail="{{ this.thumbnail(delivery.photo) }}" type="delivery"></twig:Picture>
                     {% else %}
                        <img src="{{ delivery.defaultIcon }}" width="{{ this.deliveryPhotoConfig[0] }}" height="{{ this.deliveryPhotoConfig[1] }}"  alt="" class="img-responsive">
                     {% endif %}
                     {{ delivery.name }}
                  </td>
                  {% if this.inStore %}
                     <td class="date">{{ delivery.date|formatDate('d.M.') }}</td>
                  {% endif %}
                  <td class="price">
                     {% if not delivery.getPrice().getPriceWithVat().isZero() %}
                        {{ delivery.getPrice()|formatPrice(withVat: true, ceil: true) }}
                     {% else %}
                        {{ 'price.free'|trans }}
                     {% endif %}
                  </td>
               </tr>
            {% endfor %}
         {% endfor %}
      </table>
   </div>
   {% if this.deliveries.groupsByType %}
      <p class="info">{{ 'delivery.info'|trans }}</p>
   {% endif %}
</div>
