<tal:i18n omit-tag=""
          i18n:domain="ploneintranet"
>
  <metal:page define-macro="master">

    <metal:master use-macro="here/main_template/macros/master">

      <metal:slot fill-slot="portal-content" />

      <metal:content fill-slot="content">
        <div class="modal"
             id="modal-content"
        >
          <div class="pat-modal panel medium image-picker panel-image-picker"
               id="document-content"
          >
            <h1 class="panel-class-"
                i18n:translate=""
            >Image</h1>

            <div class="panel-body image-panel"
                 id="modal-panel-body"
            >
              <div class="container">

                <form class="canvas-toolbar pat-inject pat-autosubmit"
                      id="image-selection-panel-toolbar"
                      action="${here/absolute_url}/@@panel-image-search-result#image-panel-content"
                >
                  <div class="canvas-toolbar-section navigation">
                    <nav class="canvas-toolbar-subnav button-cluster pat-navigation">
                      <a class="pat-inject current"
                         href="${here/absolute_url}/@@panel-upload-image#image-panel-content"
                         i18n:translate=""
                      >Upload</a>
                      <a class="pat-inject"
                         href="${here/absolute_url}/@@panel-select-image-workspace#image-panel-content"
                         i18n:translate=""
                      >Workspace</a>
                    </nav>
                  </div>
                  <div class="canvas-toolbar-section quick-functions">
                    <label class="canvas-toolbar-function canvas-toolbar-search-field"
                           id="image-picker-search-field"
                    >
                      <input placeholder="Search images"
                             type="search"
                             i18n:attributes="placeholder"
                      />
                    </label>
                  </div>
                </form>

                <div class="image-panel-content"
                     id="image-panel-content"
                >
                  <p tal:condition="view/error">
                    <strong>${view/error}</strong>
                  </p>
                  <form class="image-panel-upload-form pat-inject pat-autosubmit"
                        action="${here/absolute_url}/${view/__name__}#image-panel-content"
                  >
                    <tal:loop repeat="it view/uploaded">
                      <img alt=""
                           src="${it/src}"
                      />
                      <input name="tiptap-src"
                             type="hidden"
                             value="${it/src}"
                      />
                    </tal:loop>
                  </form>
                </div>

                <div class="buttons button-bar pat-bumper"
                     id="modal-button-bar"
                >

                  <button class="pat-button tiptap-confirm default close-panel icon-ok-circle"
                          type="button"
                          i18n:translate="label_insert"
                  >
                  Insert
                  </button>

                  <button class="pat-button close-panel icon-cancel-circle"
                          type="button"
                          tal:condition="view/show_default_cancel_button|nothing"
                          i18n:translate=""
                  >Cancel</button>

                </div>

              </div>
            </div>
          </div>
        </div>
      </metal:content>
    </metal:master>
  </metal:page>
</tal:i18n>
