{% extends "admin/layout.html" %}
{% block title %}{{ _("Configuration Editor") }}{% endblock %}
{% block contents %}
  <h1>{{ _("Configuration Editor") }}</h1>
  <p>{% trans %}
    Here you can tune all registered configuration values. Note that some of
    them (especially the core configuration values) can easily break your
    installation if set to an illegal value. Don't alter any of those values
    if you don't know what effect they have. This editor is especially
    useful if you want to configure plugins that don't provide a configuration
    page (yet).
  {% endtrans %}</p>
  {% call form() %}
    {% if editor_enabled %}
      <table class="config-table">
      {% for category in form.values %}
        <tr>
          <th colspan="3">{{ category.localname }}</th>
        </tr>
        {% for field in category %}
        <tr>
          <td>{{ field.localname|e }}</td>
          <td>{{ field['value']() }}</td>
          <td class="default">{{ field.use_default() }}</td>
        </tr>
        {% endfor %}
      {% endfor %}
      </table>
      <div class="actions">
        <input type="submit" value="{{ _('Save') }}">
        <input type="submit" name="disable_editor" value="{{ _('Disable Editor') }}">
      </div>
    {% else %}
      <p>{% trans %}
        The configuration editor is disabled because of this. If you really want
        to use it, click the button to proceed.
      {% endtrans %}</p>
      <div class="actions">
        <input type="submit" name="enable_editor" value="{{ _('Enable Editor') }}">
      </div>
    {% endif %}
  {% endcall %}
{% endblock %}
