{% include 'doctype.html'%}
    <head>
		<meta charset="utf-8" />
		<title>Health check - {{config.name}}</title>

		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<link rel="shortcut icon" type="image/ico" href="{{STATIC_URL}}img/favicon.ico" />
        <link href="{{STATIC_URL}}data_sniffer/css/style.css" rel="stylesheet" type="text/css" />
	</head>

	<body>
        <div class="page-wrap">
            <h1>{{config.name}}</h1>
            <div class="table-header">
                <div class="count">
                    Scanned <b>{{count_total}}</b> row{% if count_total != 1 %}s{% endif %} for <b>{{config.alerts|length}}</b> condition{% if config.alerts|length != 1 %}s{% endif %}
                    <br>
                    <span>{{count_alerts}}</span> alert{% if count_alerts != 1 %}s{% endif %} & <span>{{count_warnings}}</span> warning{% if count_warnings != 1 %}s{% endif %}
                </div>
                <div class="buttons">
                    {% if show_all %}
                        <a href="{% url 'data_sniffer_health_check' key=key %}">
                            <button>Show unhealthy</button>
                        </a>
                    {% else %}
                        <a href="{% url 'data_sniffer_health_check' key=key %}?all=1">
                            <button>Show all</button>
                        </a>
                    {% endif %}
                </div>
            </div>

            {% if categories|length > 0 %}
                {% for category in categories %}
                     <h3 id="{{category.value}}">{{category.value}}</h3>
                     <div class="table-container">
                        <div class="table">
                            {% for object in category.objects %}
                                {% include "data_sniffer/row.html" %}
                            {% endfor %}
                            {% include "data_sniffer/empty.html" %}
                        </div>
                     </div>
                {% endfor %}
            {% else %}
                <div class="table-container">
                    <div class="table">
                        {% for object in objects %}
                            {% include "data_sniffer/row.html" %}
                        {% endfor %}
                        {% include "data_sniffer/empty.html" %}
                    </div>
                </div>
            {% endif %}
        </div>
	</body>
</html>
