<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:tal="http://xml.zope.org/namespaces/tal"
      xmlns:metal="http://xml.zope.org/namespaces/metal"
      xmlns:i18n="http://xml.zope.org/namespaces/i18n"
      metal:use-macro="here/main_template/macros/master"
      i18n:domain="senaite.core">

  <body tal:define="form_id view/form_id;
                    table_only python:hasattr(view, 'table_only') and view.table_only or view.request.get('table_only','') == form_id;"
        tal:omit-tag="python:table_only">

    <metal:content-title fill-slot="content-title"
                         tal:define="form_id view/form_id;
                                     checkPermission nocall: context/portal_membership/checkPermission;
                                     table_only python:hasattr(view, 'table_only') and view.table_only or view.request.get('table_only','') == form_id;"
                         tal:condition="python:not table_only">
      <h1>
        <img tal:condition="view/icon | nothing"
             tal:attributes="src view/icon"
             style="height:32px;width:auto;"/>
        <span tal:content="python:view.context.translate(view.title)"/>
          <span tal:condition="python:checkPermission('Add portal content', context)"
                style="padding-left:0.5em;display:inline-block;">
          <form method="GET" class="form-inline" action="ar_add">
            <input type="number"
                   name="ar_count"
                   min="1"
                   style="width:4em;vertical-align:middle;"
                   class="form-control input-sm"
                   tal:attributes="value view/getDefaultAddCount|1"/>
            <button type="submit"
                    class="btn btn-link">
              <img src="#"
                   style="height:16px;width:auto;"
                   tal:attributes="src string:${context/absolute_url}/++resource++bika.lims.images/add.png"/>
              <span i18n:translate="">Add</span>
            </button>
          </form>
        </span>
      </h1>
    </metal:content-title>

    <metal:content-description fill-slot="content-description"
                               tal:define="form_id view/form_id;
                                           table_only python:hasattr(view, 'table_only') and view.table_only or view.request.get('table_only','') == form_id;"
                               tal:condition="python:not table_only">
      <div class="documentDescription"
                  tal:content="structure view/description"
		              tal:condition="view/description"/>
    </metal:content-description>

    <metal:content-core fill-slot="content-core">

      <!-- Listing Table -->
	    <div id="folderlisting-main-table"
           tal:content="structure view/contents_table"/>

    </metal:content-core>

  </body>
</html>
