{% for service in service_status %} {{ service.0 }} {% if service.2|int() >= 1 %} {% else %} {% endif %} {% if service.5.0|length() == 0 %} {% elif service.5.0 != '' and service.4|int() == 0 %} {% elif service.5.0 != '' and service.4|int() >= 1 %} {% endif %} {% endfor %}