<tal:show condition="view/available">
  <tal:button define="
                working_copy python:view.working_copy;
              ">
    <a class="pat-modal pat-button"
       href="${here/absolute_url}/@@panel-check-out#document-content"
       data-pat-modal="class: small panel"
       tal:condition="python: not working_copy"
       i18n:translate=""
    >
      Edit
    </a>
    <tal:working_copy condition="python: working_copy">
      <a class="pat-inject pat-button"
         href="${working_copy/absolute_url}/@@edit.html"
         data-pat-inject=".document-body"
         tal:condition="python: working_copy and working_copy != here and view.can_edit_original()"
         i18n:translate=""
      >
        Edit
      </a>
      <a class="pat-modal pat-button"
         href="${working_copy/absolute_url}/@@panel-check-in#document-content"
         data-pat-modal="class: small panel"
         tal:condition="python: working_copy == here and view.iterate_control_view.checkin_allowed()"
         i18n:translate=""
      >
        Check in
      </a>
    </tal:working_copy>

  </tal:button>
</tal:show>
