{% extends "base_status.html" %}

{% block title %}Status Overview{% endblock %}
{% block smallheader %}{% endblock %}
{% block adagios_hausinn %}
{% endblock %}
{% block largeheader %}Service Overview
{% endblock %}
{% block nav1 %}{{ block.super }}{% endblock %}
{% block nav2 %}<a href="{% url status.views.status_boxview %}">Box view</a>{% endblock %}
{% load adagiostags %}

{% block sidebar_outer %}
{% endblock %}

{% block content %}
    {% if objects %}

        {% for object in objects %}
            {% if object.children %}
                <div style="width: 20%; min-height: 65px;  border-style: groove; padding: 2px; margin: 10px" class="pull-left state_{{ object.worst_service_state }}">
                    <div style="color: black; font: bolder; text-align: center;">
                        <a href="">{{ object.alias }}</a>
                    </div>
                    <hr style="margin-top: 0px; margin-bottom: 2px;">
                    <div>
                        {% for child in object.children %}
                            <div style="border-color: #808080; {% if child.1 == 0 %} background-color: green;{% endif %}{% if child.1 == 1 %} background-color: yellow;{% endif %}{% if child.1 == 2 %} background-color: red;{% endif %}" title="{{ child.0 }} {{ child.1 }}" class="circle state_{{ child.1 }}"></div>
                        {% endfor %}

                    </div>

                </div>
            {% endif %}
        {% endfor %}
    {% else %}

        <div class="row-fluid">
            {% for host in hosts %}
                <div style="width: 20%; min-height: 65px;  border-style: groove; padding: 2px; margin: 10px" class="pull-left state_{{ host.state }}">
                    <div>
                        {{ host.name }}
                    </div>
                <hr style="margin-top: 0px; margin-bottom: 2px;">
                    <div>
                        {% for service in host.services %}
                            <a href="{% url status.views.status_detail %}?host_name={{ host.name }}&service_description={{ service.description }}">
                            <div style="border-color: #808080; {% if service.state == 0 %} background-color: green;{% endif %}{% if service.state == 1 %} background-color: yellow;{% endif %}{% if service.state == 2 %} background-color: red;{% endif %}" title="{{ service.description }} - {{ service.plugin_output }}" class="circle state_{{ service.state }}"></div>
                            </a>
                        {% endfor %}

                    </div>

                </div>
            {% endfor %}

        </div>
    {% endif %}
{% endblock %}



{% block footer %} {{ block.super }} {% endblock %}