{% from 'include/input_macros.html' import checkbox %}
<table class="overview">
    {% if service == 'haproxy' %}
        {% if settings %}
            {% for s in settings %}
                {% if s.haproxy_enterprise != '' and s.setting == 'haproxy_enterprise' %}
                        <tr>
                            <td class="padding20 help_cursor" style="width: 70%"
                                title="If you use enterprise HAProxy, check this. The name of the service will be changed as it is required for the commercial version">HAProxy Enterprise</td>
                            <td>
                                {% if s.value == '1' and s.setting == 'haproxy_enterprise' %}
                                    {{ checkbox('haproxy_enterprise', checked='checked', title='This server uses HAProxy enterprise') }}
                                {% elif s.setting == 'haproxy_enterprise' %}
                                    {{ checkbox('haproxy_enterprise', title='This server uses HAProxy community') }}
                                {% endif %}
                            </td>
                        </tr>
                {% endif %}
                {% if s.dockerized != '' and s.setting == 'dockerized' %}
                    <tr>
                        <td class="padding20 help_cursor" style="width: 70%"
                            title="If you use HAProxy inside Docker, check this. Roxy-WI is starting managing it as Docker container">HAProxy dockerized</td>
                        <td>
                            {% if s.value == '1' and s.setting == 'dockerized' %}
                                {{ checkbox('haproxy_dockerized', checked='checked', title='This service is running inside a Docker container') }}
                            {% elif s.setting == 'dockerized' %}
                                {{ checkbox('haproxy_dockerized', title='This server will be used as Docker container') }}
                            {% endif %}
                        </td>
                    </tr>
                {% endif %}
                {% if s.restart != '' and s.setting == 'restart' %}
                    <tr>
                        <td class="padding20 help_cursor" style="width: 70%" title="If enabled, the restart button disabled">Disable restart</td>
                        <td>
                            {% if s.value == '1' and s.setting == 'restart' %}
                                {{ checkbox('haproxy_restart', checked='checked', title='Restart option is disabled for this server') }}
                            {% elif s.setting == 'restart' %}
                                {{ checkbox('haproxy_restart', title='Only the reload button will be active') }}
                            {% endif %}
                        </td>
                    </tr>
                {% endif %}
            {% endfor %}
        {% else %}
             <tr>
                <td class="padding20 help_cursor" style="width: 70%"
                    title="If you use enterprise HAProxy, check this. The name of the service will be changed as it is required for the commercial version">HAProxy Enterprise</td>
                <td>
                    {{ checkbox('haproxy_enterprise', title='This server uses HAProxy community') }}
                </td>
            </tr>
            <tr>
                <td class="padding20 help_cursor" style="width: 70%"
                    title="If you use HAProxy inside Docker, check this. Roxy-WI is starting managing it as Docker container">HAProxy dockerized</td>
                <td>
                    {{ checkbox('haproxy_dockerized', title='This server will be used as Docker container') }}
                </td>
            </tr>
            <tr>
                <td class="padding20 help_cursor" style="width: 70%"
                    title="If enabled, the restart button disabled">Disable restart</td>
                <td>
                    {{ checkbox('haproxy_restart', title='Only the reload button will be active') }}
                </td>
            </tr>
        {% endif %}
    {% endif %}
    {% if service == 'nginx' %}
        {% if settings %}
            {% for s in settings %}
                {% if s.dockerized != '' and s.setting == 'dockerized' %}
                    <tr>
                        <td class="padding20 help_cursor" style="width: 70%"
                            title="If you use NGINX inside Docker, check this. Roxy-WI is starting managing it as Docker container">NGINX dockerized</td>
                        <td>
                            {% if s.value == '1' and s.setting == 'dockerized' %}
                                {{ checkbox('nginx_dockerized', checked='checked', title='This service is running inside a Docker container') }}
                            {% else %}
                                {{ checkbox('nginx_dockerized', title='This server will be used as Docker container') }}
                            {% endif %}
                        </td>
                    </tr>
                {% endif %}
                {% if s.restart != '' and s.setting == 'restart' %}
                    <tr>
                        <td class="padding20 help_cursor" style="width: 70%" title="If enabled, the restart button disabled">Disable restart</td>
                        <td>
                            {% if s.value == '1' and s.setting == 'restart' %}
                                {{ checkbox('nginx_restart', checked='checked', title='Restart option is disabled for this server') }}
                            {% elif s.setting == 'restart' %}
                                {{ checkbox('nginx_restart', title='Only the reload button will be active') }}
                            {% endif %}
                        </td>
                    </tr>
                {% endif %}
            {% endfor %}
        {% else %}
        <tr>
            <td class="padding20 help_cursor" style="width: 70%"
                title="If you use NGINX inside Docker, check this. Roxy-WI is starting managing it as Docker container">NGINX dockerized</td>
            <td>
                {{ checkbox('nginx_dockerized', title='This server will be used as Docker container') }}
            </td>
        </tr>
        <tr>
            <td class="padding20 help_cursor" style="width: 70%" title="If enabled, the restart button disabled">Disable restart</td>
            <td>
                {{ checkbox('nginx_restart', title='Only the reload button will be active') }}
            </td>
        </tr>
        {% endif %}
    {% endif %}
    {% if service == 'apache' %}
        {% if settings %}
            {% for s in settings %}
                {% if s.dockerized != '' and s.setting == 'dockerized' %}
                    <tr>
                        <td class="padding20 help_cursor" style="width: 70%"
                            title="If you use Apache inside Docker, check this. Roxy-WI is starting managing it as Docker container">Apache dockerized</td>
                        <td>
                            {% if s.value == '1' and s.setting == 'dockerized' %}
                                {{ checkbox('apache_dockerized', checked='checked', title='This service is running inside a Docker container') }}
                            {% else %}
                                {{ checkbox('apache_dockerized', title='This server will be used as Docker container') }}
                            {% endif %}
                        </td>
                    </tr>
                {% endif %}
                {% if s.restart != '' and s.setting == 'restart' %}
                    <tr>
                        <td class="padding20 help_cursor" style="width: 70%" title="If enabled, the restart button disabled">Disable restart</td>
                        <td>
                            {% if s.value == '1' and s.setting == 'restart' %}
                                {{ checkbox('apache_restart', checked='checked', title='Restart option is disabled for this server') }}
                            {% elif s.setting == 'restart' %}
                                {{ checkbox('apache_restart', title='Only the reload button will be active') }}
                            {% endif %}
                        </td>
                    </tr>
                {% endif %}
            {% endfor %}
        {% else %}
        <tr>
            <td class="padding20 help_cursor" style="width: 70%"
                title="If you use Apache inside Docker, check this. Roxy-WI is starting managing it as Docker container">Apache dockerized</td>
            <td>
                {{ checkbox('apache_dockerized', title='This server will be used as Docker container') }}
            </td>
        </tr>
        <tr>
            <td class="padding20 help_cursor" style="width: 70%" title="If enabled, the restart button disabled">Disable restart</td>
            <td>
                {{ checkbox('apache_restart', title='Only the reload button will be active') }}
            </td>
        </tr>
        {% endif %}
    {% endif %}
</table>
