{% if perms.editor.edit_site %}
<button class="btn" id="editor-switch" data-toggle="button" onclick="editor_toggle()">Activer l'éditeur</button>
<script>
  function editor_toggle() {
    if ($.cookie('editor_activated') != '1') {
      $.cookie('editor_activated', '1');
      editor_activate();
    } else{
      $.cookie('editor_activated', '0');
      window.location.href=window.location.href;
    }
  }
</script>
{% endif %}
