{% extends request.ajax ? 'layout_blank.html.twig' : 'layout_default.html.twig' %}

{% import 'macro_functions.html.twig' as mf %}

{% block meta_title %}{{ 'WYSIWYG settings'|trans }}{% endblock %}

{% set active_menu = 'system' %}

{% block breadcrumbs %}
    <ol class="breadcrumb">
        <li class="breadcrumb-item">
            <a href="{{ '/'|alink }}">
                <svg class="icon">
                    <use xlink:href="#home" />
                </svg>
            </a>
        </li>
        <li class="breadcrumb-item">
            <a href="{{ 'system'|alink }}">{{ 'Settings'|trans }}</a>
        </li>
        <li class="breadcrumb-item active" aria-current="page">{{ 'WYSIWYG settings'|trans }}</li>
    </ol>
{% endblock %}

{% block content %}
    <div class="card">
        <form method="post" action="{{ 'api/admin/extension/config_save'|link }}" class="api-form" data-api-msg="{{ 'Configuration updated'|trans }}">
            <input type="hidden" name="ext" value="mod_wysiwyg">
            <div class="card-body">
                <h3 class="card-title">{{ 'WYSIWYG settings'|trans }}</h3>
                {% set params = admin.extension_config_get({ 'ext': 'mod_wysiwyg' }) %}
                <input type="hidden" name="CSRFToken" value="{{ CSRFToken }}"/>
                <div class="row">
                    <label class="form-label col-3 form-label">{{ 'Default editor'|trans }}</label>
                    <div class="col">
                        {% for editor, title in admin.wysiwyg_editors %}
                            <div class="form-check form-check-inline">
                                <input class="form-check-input" id="radioCheck" type="radio" name="editor"
                                       value="{{ editor }}"{% if params.editor == editor %} checked{% endif %}>
                                <label class="form-check-label" for="radioCheck">{{ title }}</label>
                            </div>
                        {% endfor %}
                    </div>
                </div>
            </div>
            <div class="card-footer text-end">
                <button class="btn btn-primary" type="submit">{{ 'Update'|trans }}</button>
            </div>
        </form>
    </div>
{% endblock %}
