<tal:t define="collection view/collection;
               model view/model;
               batch model/Batch;
               client model/Client;
               reporter python:view.current_user;
               specification model/Specification;
               publication_specification model/PublicationSpecification;
               spec python:publication_specification or specification;"
       i18n:domain="senaite.impress">

  <div class="row section-summary no-gutters">
    <div class="w-100">

      <!-- Barcode -->
      <div class="text-center float-right barcode-container">
        <div class="barcode"
             data-code="code128"
             data-showHRI="true"
             data-barHeight="15"
             data-addQuietZone="true"
             tal:attributes="data-id model/getId">
        </div>
      </div>

      <h1 i18n:translate="">Summary</h1>

      <table class="table table-sm table-condensed">
        <tr>
          <td style="width:20%" class="label" i18n:translate="">Sample ID</td>
          <td>
            <a tal:content="model/getId"
               tal:attributes="href model/absolute_url;">
            </a>
          </td>
        </tr>
        <tr tal:condition="batch">
          <td class="label" i18n:translate="">Batch ID</td>
          <td>
            <a tal:content="batch/id"
               tal:attributes="href batch/absolute_url">
            </a>
          </td>
        </tr>
        <tr tal:condition="batch">
          <td class="label" i18n:translate="">Client Batch ID</td>
          <td tal:content="batch/ClientBatchID"></td>
        </tr>
        <tr>
          <td class="label" i18n:translate="">Client</td>
          <td>
            <a tal:attributes="href client/absolute_url"
               tal:content="client/Name"></a>
          </td>
        </tr>
        <tr>
          <td class="label" i18n:translate="">Client SID</td>
          <td tal:content="model/ClientSampleID"></td>
        </tr>
        <tr>
          <td class="label" i18n:translate="">Sample Type</td>
          <td tal:content="model/SampleType/title|nothing"></td>
        </tr>
        <tr>
          <td class="label" i18n:translate="">Specification</td>
          <td tal:content="spec/contextual_title|nothing"></td>
        </tr>
        <tr>
          <td class="label" i18n:translate="">Date Received</td>
          <td tal:content="python:view.to_localized_time(model.DateReceived)"></td>
        </tr>
        <tr>
          <td class="label" i18n:translate="">Date Verified</td>
          <td tal:content="python:view.to_localized_time(model.getDateVerified())"></td>
        </tr>
        <tr>
          <td class="label" i18n:translate="">Date Published</td>
          <td tal:content="python:view.to_localized_time(view.timestamp)"></td>
        </tr>
        <tr tal:condition="reporter">
          <td class="label" i18n:translate="">Published by</td>
          <td>
            <span tal:content="reporter/fullname|reporter/username"/>
            <tal:email tal:condition="reporter/email|nothing"
                       tal:define="email reporter/email">
              (<a tal:content="email"
                  tal:attributes="href string:mailto:${email}"></a>)
            </tal:email>
          </td>
        </tr>
        <tr tal:condition="python: batch and batch.BatchLabels">
          <td class="label" i18n:translate="">Batch Labels</td>
          <td tal:content="structure python:', '.join(batch.BatchLabels)"></td>
        </tr>
      </table>
    </div>
  </div>

</tal:t>
