<tal:button define="
              autosave_enabled view/autosave_enabled|nothing;
              can_edit view/can_edit;
              lock_info view/lock_info|nothing;
            "
            i18n:domain="ploneintranet"
>
  <tal:notlocked condition="not:lock_info">
    <tal:autosaveon condition="autosave_enabled">
      <button class="icon saving-badge pat-tooltip"
              id="saving-badge"
              title="${view/last_saved_label}"
              data-pat-tooltip="trigger: hover"
              tal:condition="can_edit"
              i18n:translate=""
      >
              Save
      </button>

    </tal:autosaveon>
    <tal:autosaveoff condition="not:autosave_enabled">
      <button class="pat-button default icon-floppy"
              id="save-button"
              type="submit"
              tal:condition="can_edit"
              i18n:translate=""
      >Save</button>
    </tal:autosaveoff>
  </tal:notlocked>
  <tal:locked condition="python:can_edit and lock_info">
    <a class="locked-tag pat-tooltip inactive"
       href="${here/absolute_url}/@@plone_lock_info/render_panel#locked-menu"
       title="${lock_info/lock_panel_link_title}"
       data-pat-tooltip="source: ajax; class: rich unlock-dialogue"
       i18n:translate=""
    >Locked</a>
  </tal:locked>
</tal:button>
