{% extends 'index.html.twig' %}

{% block content %}
   <twig:Account>
      <twig:block name="account_content">
         <div style="display: flex; flex-direction: column; gap: 2em;">
            {% if body.preorders is defined %}
               <h1>{{ view.title }}</h1>
               <div>
                  {% if body.hasOpenDates %}
                     <a class="btn btn-primary" href="{{ path('kupshop_preorders_show_active') }}">
                        {{- 'createnew'|trans([], 'preorders') -}}
                     </a>
                  {% endif %}
               </div>
               <twig:Preorders:UserPreordersTable preorders="{{ body.preorders }}" />
            {% else %}
               <twig:Account:OrderDetail id_order="{{ body.ID }}">
                  <twig:block name="order_buttons">
                     <a href="#download" class="btn btn-outline" style="margin-bottom: 30px">{{ 'attachments.download_attachments_title'|trans([], 'orders') }}</a>
                  </twig:block>
                  <twig:block name="order_manuals">
                     <twig:Preorders:PreorderDetail:Attachments id_order="{{ body.ID }}" id="download" />
                  </twig:block>
               </twig:Account:OrderDetail>
            {% endif %}
         </div>
      </twig:block>
   </twig:Account>
{% endblock %}
