<h3>{{ _t('EDIT_CONFIG_TITLE') }}</h3>

<form action="" method="post" name="edit-config" id="edit-config" class="form-horizontal">
  <div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
    {% for group, data in keysList %}
      <div class="panel panel-{{ group == 'core' ? 'primary' : 'default' }}">
        <button class="panel-heading collapsed" id="head_{{ group }}" data-parent="#accordion" data-toggle="collapse" href="#{{ group }}">
          <h4 class="panel-title">
            {% set groupTitle = 'EDIT_CONFIG_GROUP_' ~ group|upper %}
            {{ (_t(groupTitle) == groupTitle) ? group|upper : _t(groupTitle) }}
          </h4>
        </button>
        <div id="{{ group }}" class="panel-collapse collapse">
          <div class="panel-body">
            {% for key,value in data %}
              <div class="field-container">
                <label for="{{ key }}">{{ help[key] ?? key }}</label>
                {% if help[key] %}<span> - {{ key }}</span>{% endif %}
                <input type="text" class="form-control" id="{{ key }}" name="{{ key }}" value="{{ value }}"
                  {{ help[key] ? 'aria-describedby="' ~ key ~ 'Help"' }}
                  {% if placeholders[key] is not null -%}placeholder="{{ _t('EDIT_CONFIG_CURRENT_VALUE') }}: {{ placeholders[key] }}"{%- endif %}
                  />
              </div>
            {% endfor %}
          </div>
        </div>
      </div>      
    {% endfor %}
  </div>

  {# DO NOT REMOVE THE FOLLOWING LINE THAT IS DEFINED FOR POST ACTIONS__.php#}
  <!-- end of #edit-config form -->
  <input type="hidden" name="{{ SAVE_NAME }}" value="1">
  <div class="form-group">
    <div class="col-sm-9 col-sm-offset-3">
      <button type="submit" name="valider" class="btn btn-primary">
        {{ _t('BAZ_VALIDER') }}
      </button>
    </div>
  </div>
</form>

<style>
  #edit-config { margin-top: 2rem; }
  .field-container { margin: 1rem 0; }
</style>
