{% extends "inc/base.j2" %}
{% block content %}
  <div>

    <nav>
      <ul>
        <li><h3>settings</h3></li>
        <li><a href="/system/settings/toml">update</a></li>
        <li><a href="/api/system/settings/toml">view</a></li>
      </ul>

    </nav>
  </div>

  <form method="post">
    <table>
      <tr>
        <th>key</th>
        <th>type</th>
        <th>value</th>
      </tr>
      {% for key, value in info.settings.items() %}
        {% if key not in info.hidden %}
          <tr>
            <td title="{{ info.descriptions[key] }}">{{ key }}</td>
            <td>{{ info.types[key].value }}</td>
            <td>
              {% if info.types[key].value == "BOOLEAN" %}
                <input type="hidden" name="{{ key }}" value="false">
                <input type="checkbox" name="{{ key }}" {{ "checked" if value }} value="true">
              {% elif info.types[key].value =="MULTILINE" %}
                length: {{ info.settings[key] | length }} /
                <a href="/system/settings/multiline/{{ key }}">update</a>
              {% else %}
                <input name="{{ key }}" value="{{ value }}">
              {% endif %}
            </td>
          </tr>
        {% endif %}
      {% endfor %}
    </table>
    <input type="submit" value="Save">
  </form>
{% endblock %}
