{% load i18n %}{% spaceless %}
<div class="cms_toolbar-item cms_toolbar-item-buttons cms_toolbar-item_switch_save-edit">
    {% if request.toolbar.edit_mode %}
    <a class="cms_btn cms_btn-switch-save" href="?{{ request.toolbar.edit_mode_url_off }}">
        {% trans "Save and close" %}
    </a>
    {% else %}
    <a class="cms_btn cms_btn-active cms_btn-switch-edit" href="?{{ request.toolbar.edit_mode_url_on }}">
        {% trans "Edit" %}
    </a>
    {% endif %}
</div>
{% endspaceless %}

{% load i18n %}{% spaceless %}
<div class="cms_toolbar-item cms_toolbar-item-buttons cms_toolbar-item_switch_save-edit">
    {% if request.toolbar.edit_mode %}
    <a class="cms_btn cms_btn-switch-save" href="{{ request.toolbar.get_object_public_url }}?{{ request.toolbar.edit_mode_url_off }}">
        {% trans "Save and close" %}
    </a>
    {% else %}
    <a class="cms_btn cms_btn-active cms_btn-switch-edit" href="{{ request.toolbar.get_object_draft_url }}?{{ request.toolbar.edit_mode_url_on }}">
        {% trans "Edit" %}
    </a>
    {% endif %}
</div>
{% endspaceless %}

Use get_object_draft_url / get_object_public_url for mode switcher
Use get_object_draft_url / get_object_public_url for mode switcher
