{% trans_default_domain 'preorders' %}
<div {{ attributes }}>
   {% block content %}
      {% if this.empty %}
         <p>{{ 'past.nonecreated'|trans }}</p>
      {% else %}
         {% for year, preorders in this.groupedByYear %}
            <section class="preorders-group">
               <div class="year-header">
                  <p class="header-title">{{ year }}</p>
               </div>
               <table class="table preorder-list">
                  <tbody>
                  {% for preorder in preorders %}
                     <twig:Preorders:UserPreordersTable:Preorder preorder="{{ preorder }}"/>
                  {% else %}
                     <tr>
                        <td>Není žádná předobjednávka</td>
                     </tr>
                  {% endfor %}
                  </tbody>
               </table>
            </section>
         {% endfor %}
      {% endif %}
   {% endblock %}
</div>
