<div class="PNB">
  <div class="PNB header" style="height:40px;bottom:auto;">
    <table>
      <tr>
        <td style="width:230px;">
          <a href="#" class="back">
            <img src="/assets/prod/images/Basket/Browser/BASKET_LIST.png"/>
            {{ 'Back to basket list' | trans }}
          </a>
        </td>
        <td>
          <h1 class="title">
            <img class="loader" src="/assets/prod/images/Basket/Browser/loader.gif" />
            {% if Basket.getValidation() is empty or Basket.getValidation().isInitiator(app.getAuthenticatedUser()) %}
            <a href="{{ path('prod_baskets_basket_archive', { 'basket' : Basket.getId(), 'archive' : 1 }) }}" class="archiver archive_toggler" style="display:{{ Basket.getArchived ? 'none' : '' }};">
              <span>
                <img src="/assets/prod/images/Basket/Browser/archive.png"/>
              </span>
            </a>
            <a href="{{ path('prod_baskets_basket_archive', { 'basket' : Basket.getId(), 'archive' : 0 }) }}" class="unarchiver archive_toggler" style="display:{{ Basket.getArchived ? '' : 'none' }};">
              <span>
                <img src="/assets/prod/images/Basket/Browser/archived.png"/>
              </span>
            </a>
            {% endif %}
            <a class="basket_link" href="#">
              {{ Basket.getName() }}
            </a>
          </h1>
        </td>
      </tr>
    </table>
  </div>

  {% set top = 0 %}

  {% if Basket.getPusher() %}
    {% set top = top + 40 %}
    <div class="PNB" style="top:40px;bottom:auto;height:40px;background-color:#404040;">
      <div class="PNB10">
        <p>
          {% set user_name = '<a tooltipsrc="' ~ path('prod_tooltip_user', { 'usr_id' : Basket.getPusher().getId() }) ~ '" href="/user/' ~ Basket.getPusher(app).get_id() ~ '/" class="UserTips">' ~ Basket.getPusher(app).get_display_name() ~ '</a>' %}
          {% trans with {'%user_name%' : user_name} %}Received from %user_name%{% endtrans %}
        </p>
      </div>
    </div>
  {% endif %}

  {% if Basket.getValidation() %}
    {% set top = top + 160 %}
    <div class="PNB" style="top:40px;bottom:auto;height:160px;background-color:#404040;">
      <div class="PNB10">
        <p>
          {% set list_participants = '' %}
          {% for Participant in Basket.getValidation().getParticipants() %}

            {% if list_participants != '' %}
              {% set list_participants = list_participants ~ ', ' %}
            {% endif %}

            {% set list_participants = list_participants ~ '<a class="UserTips" tooltipsrc="' ~ path('prod_tooltip_user', { 'usr_id' : Participant.getUser().getId() }) ~ '" href="/user/'
                                        ~ Participant.getUser().getId() ~ '/">'
                                        ~ Participant.getUser().getDisplayName()
                                        ~ '</a>' %}
          {% endfor %}
          {% trans with {'%list_participants%' : list_participants} %}Sent for validation to %list_participants%{% endtrans %}
        </p>
      </div>
    </div>
  {% endif %}

  {% set top = top + 40 %}

  <div class="PNB" style="height:40px;bottom:auto;top:{{ top }}px;">
    <div class="PNB10">
    {% set ElementsCount = Basket.getElements().count() %}
    {% if ElementsCount == 0 %}
      {{ 'No records' | trans }}
    {% elseif ElementsCount == 1 %}
      {{ '1 record' | trans }}
    {% else %}
      {% trans with {'%ElementsCount%' : ElementsCount} %}%ElementsCount% records{% endtrans %}
    {% endif %}
    </div>
  </div>


  {% set top = top + 40 %}


  {% import 'common/thumbnail.html.twig' as thumbnail %}


  <div class="PNB" style="top:{{ top }}px;">
    <div class="PNB10">
    {% for BasketElement in Basket.getElements() %}
      {% set record = BasketElement.getRecord(app) %}
      <div class="diapo" style="width:150px; height:180px;">
        <div class='title'>
        {{record.get_original_name()}}
        </div>
        <div>
          {{thumbnail.format(record.get_thumbnail,140,140, '', true, false)}}
        </div>
        <div style='position:absolute; bottom:0px; left:0px; height:20px'>
          <div class="previewTips" tooltipsrc="{{ path('prod_tooltip_preview', { 'sbas_id' : record.get_sbas_id(), 'record_id' : record.get_record_id() }) }}"></div>
          <img class="infoTips" tooltipsrc="{{ path('prod_tooltip_technical_data', { 'sbas_id' : record.get_sbas_id(), 'record_id' : record.get_record_id() }) }}" src="/assets/common/images/icons/info.gif"/>
        </div>
      </div>
    {% endfor %}
    </div>
  </div>
</div>
