<div id="content"
     tal:define="
       dummy python:request.form.update({'origin': 'context-menu'});
       can_cut view/can_cut;
       can_delete view/can_delete;
       can_edit view/can_edit;
       is_trashed view/is_trashed;
       show_second_menu python: can_delete;
       absolute_url here/absolute_url;
       workspace_or_context python:view.workspace or context;
     "
>
  <div id="extra-options">
    <ul class="menu"
        i18n:domain="ploneintranet"
    >
      <li tal:condition="python:context.portal_type == 'Link' and context.content_type() == 'text/x-uri'">
        <a class="icon-globe icon"
           href="${context/remoteUrl}"
           target="External"
           title="Open web page in new window"
           i18n:attributes="title"
           i18n:translate=""
        >Open web page in new window</a>
      </li>
      <li>
        <a class="pat-inject icon-cog-many close-panel"
           href="${context/absolute_url}/@@panel-metadata"
           data-pat-inject="
                 source: #pat-modal-panel-space;
                 target: #pat-modal-panel-space;
                 url: ${context/absolute_url}/@@panel-metadata"
           i18n:translate=""
        >Metadata</a>
      </li>
      <li>
        <form class="pat-inject"
              action="${workspace_or_context/absolute_url}/@@cart-copy#global-statusmessage"
        >
          <button class="icon-copy"
                  name="items"
                  title="Copy this document"
                  type="submit"
                  value="${here/UID}"
                  i18n:attributes="title;"
                  i18n:translate=""
          >Copy</button>
        </form>
      </li>
      <li tal:condition="can_cut">
        <form class="pat-inject"
              action="${workspace_or_context/absolute_url}/@@cart-cut#global-statusmessage"
        >
          <button class="icon-cut"
                  name="items"
                  title="Cut this document"
                  type="submit"
                  value="${here/UID}"
                  i18n:attributes="title;"
                  i18n:translate=""
          >Cut</button>
        </form>
      </li>
      <li tal:condition="view/can_share">
        <a class="icon-share iconified pat-tooltip inactive"
           href="${absolute_url}/@@share-panel?fcm=1#share-panel"
           title="Share this document"
           data-pat-tooltip="source: ajax"
           i18n:attributes="title"
           i18n:translate=""
        >Share</a>
      </li>
      <li>
        <tal:bookmark replace="structure here/@@bookmark-link-iconified|nothing" />
      </li>
      <li tal:condition="view/is_versionable">
        <a class="iconified icon-restore pat-modal close-panel"
           href="${context/absolute_url}/contenthistorypopup#content"
           title="Version control"
           data-pat-inject="source: #content; target: body:after"
           data-pat-modal="class: large"
           i18n:attributes="title"
           i18n:translate=""
        >
          Version control
        </a>
      </li>
      <li tal:condition="nothing">
        <a class="icon-attach iconified pat-tooltip"
           href="/feedback/panel-event-attachments.html#content"
           title="Attach documents"
           data-pat-tooltip="source: ajax"
           i18n:attributes="title"
           i18n:translate=""
        >
          Attachments
        </a>
      </li>
      <li tal:define="
            action here/@@pinning-link-iconified|nothing;
          "
          tal:condition="action/strip|action"
          tal:content="structure action"
      ></li>
      <li tal:define="
            action here/@@app-audit-button|nothing;
          "
          tal:condition="action/strip|action"
          tal:content="structure action"
      ></li>
      <li>
        <a class="icon-rename pat-modal close-panel"
           href="${absolute_url}/@@panel-rename#document-content"
           data-pat-modal="class: panel small;"
           tal:condition="can_edit"
           i18n:translate=""
        >Rename</a>
      </li>
    </ul>
    <ul class="menu"
        tal:condition="show_second_menu"
    >
      <li tal:condition="can_delete">
        <tal:delete replace="structure here/@@delete-link" />
      </li>
      <li tal:define="
            action here/@@archive-link-iconified|nothing;
          "
          tal:condition="action/strip|action"
          tal:content="structure action"
      ></li>
    </ul>
  </div>
</div>
