<tr class="config_section"><td colspan="4">MQTT</td></tr>
    {% for t in o.MQTT %}
    <tr class="config_item">
        <td class="config_label">{{ t }}</td>
        {% if t=="enabled": %}
        <td class="config_input"><input type="checkbox" name="MQTT.{{ t }}" value="1" {{ 'checked ' if o.MQTT[t] else ' ' }}  > &nbsp;&nbsp;<em>(need restart)</em></td>
        {% else %}
        <td class="config_input"><input type="text" value="{{ o.MQTT[t] }}" class="form-control input-sm" name="MQTT.{{ t }}" ></td>
        {% endif %}
        <td colspan="2">
    </tr>
    {% endfor %}

<tr class="config_section"><td colspan="4">DOMAINS</td></tr>
    {% for t in o.components %}
    <tr class="config_item">
        <td class="config_label">{{ t }}</td>
        <td class="config_input"><input type="checkbox" name="components.{{ t }}" value="1" {{ 'checked ' if o.components[t] else ' ' }}  ></td>
        <td colspan="2">
    </tr>
    {% endfor %}

<tr class="config_section"><td colspan="4">TRANSLATIONS</td></tr>
    {% for t in o.translations %}
    <tr class="config_item">
        <td class="config_label">{{ t | replace("text_","") | upper }}</td>
        <td class="config_input"><input type="text" value="{{ o.translations[t] }}" class="form-control input-sm" name="translations.{{ t }}" ></td>
        <td colspan="2">
    </tr>
    {% endfor %}

<tr class="config_section"><td colspan="4">Misc</td></tr>
    <tr class="config_item">
        <td class="config_label">Max retry</td>
        <td class="config_input"><input type="text" value="{{ o.max_retry }}" class="form-control input-sm" name="max_retry" ></td>
        <td colspan="2">
    </tr>
    <tr class="config_item">
        <td class="config_label">Details uncovered</td>
        <td class="config_input"><input type="checkbox" name="details_uncovered" value="1" {{ 'checked ' if o.details_uncovered else ' ' }}  ></td>
        <td colspan="2">
    </tr>
    <tr class="config_item">
        <td class="config_label">Dark theme</td>
        <td class="config_input"><input type="checkbox" name="dark_theme" value="1" {{ 'checked ' if o.dark_theme else ' ' }}  ></td>
        <td colspan="2">
    </tr>
    <tr class="config_item">
        <td class="config_label">Debug mode</td>
        <td class="config_input"><input type="checkbox" name="debug" value="1" {{ 'checked ' if o.debug else ' ' }}  ></td>
        <td colspan="2">
    </tr>

<tr>
    <td colspan="4">
        <button type="submit" class="btn btn-default bg-success" id="save-config"><span class="mdi mdi-content-save" ></span> {{ o.translations.text_save }} </button>
        <button type="button" class="btn btn-secondary" id="close-config"><span class="mdi close-box-outline" ></span> Close </button>
    </td>
</tr>

