{{!
    This file is part of Moodle - http://moodle.org/

    Moodle is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Moodle is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
}}
{{!

    @template theme_snap/editbutton

    This template renders the Turn editing on/ Turn editing off button for snap header.

    Example context (json):
    {
        "url": "http://localhost/",
        "sesskey": "sesskey",
        "checked": true,
        "string": "Turn editing on",
        "legacyseturl": "/editmode.php"
    }
}}
<div class="snap-editing-button"></div>
<form action="{{{legacyseturl}}}" method="post" class="d-flex align-items-center">
    <div class="input-group">
        {{#checked}}
            <button type="submit" name="setmode" value="0" class="btn btn-primary">
                {{#str}}turneditingoff, core{{/str}}
            </button>
        {{/checked}}
        {{^checked}}
            <button type="submit" name="setmode" value="1" class="btn btn-primary">
                {{#str}}turneditingon, core{{/str}}
            </button>
        {{/checked}}
    </div>
    <input type="hidden" name="sesskey" value="{{{sesskey}}}">
    <input type="hidden" name="pageurl" value="{{{pageurl}}}">
    <input type="hidden" name="context" value="{{{pagecontextid}}}">
</form>
