<metal:page define-macro="master">
  <metal:master use-macro="here/main_template/macros/master">
    <metal:content fill-slot="content">
      <div class="button-bar document-attacher documents-panel-open"
           i18n:domain="ploneintranet"
           id="attach-documents-2"
      >
        <a class="pat-button small icon-plus-circle pat-toggle button-add-document"
           data-pat-toggle="selector: #attach-documents-2; value: documents-panel-open documents-panel-closed"
           i18n:translate=""
        >Attach a document</a>
        <fieldset class="documents-panel pat-autosubmit pat-subform pat-inject"
                  data-pat-autosubmit="delay: 200ms"
                  data-pat-inject="source: #attach-documents-2-results; target: #attach-documents-2-results; url: ${here/absolute_url}/@@panel_attachment_picker_search_results;"
        >
          <div class="row">
            <div class="documents">
              <input autofocus=""
                     name="SearchableText"
                     placeholder="Search documents to attach"
                     type="search"
                     i18n:attributes="placeholder"
              />
              <button formaction="${here/absolute_url}/@@panel_attachment_picker_search_results"
                      hidden
                      name="search button"
                      type="submit"
                      value="1"
                      i18n:translate=""
              >Search</button>
              <div class="document-search-results"
                   id="attach-documents-2-results"
              >
              </div>
            </div>
            <aside class="filters"
                   tal:define="
                     path_options view/path_options;
                   "
            >
              <fieldset class="pat-checklist radio">
                <label tal:repeat="path_option path_options">
                  <input checked="${path_option/checked|nothing}"
                         name="path"
                         type="radio"
                         value="${path_option/value}"
                  />
                  ${path_option/label}
                </label>
              </fieldset>
            </aside>
          </div>
          <button class="pat-switch close-button"
                  type="button"
                  data-pat-switch="selector: #attach-documents-2; remove: documents-panel-open; add: documents-panel-closed"
                  i18n:translate=""
          >Close panel</button>
        </fieldset>

        <a class="pat-scroll"
           hidden
           href="#generated-id-2"
           data-pat-scroll="trigger: auto"
           i18n:translate=""
        >Scroll up</a>
      </div>
    </metal:content>
  </metal:master>
</metal:page>
