{% extends "base_status.html" %}

{% block title %}{{ view }}{% endblock %}
{% block smallheader %}{{ view }}{% endblock %}
{% block adagios_hausinn %}
{% endblock %}
{% block largeheader %}Paneview
{% endblock %}
{% block nav1 %}{{ block.super }}{% endblock %}
{% block nav2 %}<a href="{% url status.views.status_paneview %}">Pane View</a>{% endblock %}
{% load adagiostags %}

{% block sidebar_outer %}
{% endblock %}

{% block toolbar %}
    <div class id="toolbar row-fluid" style="margin-bottom: 20px;">

        <div class="btn-group" style="font-size: 11px;">
            <a class="btn btn-small dropdown-toggle" title="Current View" data-toggle="dropdown" href="#">
                <i class="glyph-eye-open"> </i> {{ view }}
                <span class="caret"></span></a>
            <ul class="dropdown-menu">
                <li><a href="?view=hostgroups"> Hostgroups</a></li>
                <li><a href="?view=contactgroups"> Contactgroups</a></li>
                <li><a href="?view=networkparents"> Network Parents</a></li>
                <li><a href="?view=networkparents"> All Hosts</a></li>
                <hr>
                <li><a href="?view=servicetemplates"> Service Templates</a></li>
                <li><a href="?view=hosttemplates"> Host Templates</a></li>
            </ul>
        </div>

    </div>
{% endblock %}
{% block content %}
    <div style="border-style: groove;" class="span4">
    <table class="dtable" id="pane1">
        <thead>
            <th class="hide"></th>
            <th></th>
            <th >
                {% if pane1_object %}
                    {{ pane1_object.object_type }} {{ pane1_object.description }}
                {% else %}
                    All {{ view }}
                {% endif %}
            </th>

        </thead>

        <tbody>
            {% for i in pane1_objects %}
            <tr>
            <td class="hide">{{ forloop.counter0 }}</td>
            <td>
                <div title="{{ i.object_type }} {% if i.register == "0" %}template{% endif %}" class="object_tag state_{{ i.state }}">{{ i.tag }}</div>
            </td>
            <td>
                <a href="?view={{ view }}&pane1={{ pane1_id }}&pane2={{ i.id }}">
                    <span style="{% if i.register == "0" %}color: grey;{% endif %} {% if i.id == pane2_id %}color: red;{% endif %}">
                        {{ i.description }}
                    </span>
                </a>
            </td>
            </tr>
            {% endfor %}
        </tbody>
    </table>
    </div>
    <div style="border-style: groove;" class="span4">
        <table class="dtable" id="pane2">
            <thead>
            <th class=hide></th>
            <th></th>
            <th>{{ pane2_object.object_type }} {{ pane2_object.description }}</th>
            </thead>

            <tbody>
            {% for i in pane2_objects %}
                <tr>
                    <td class="hide">{{ forloop.counter0 }}</td>
                    <td>
                        <div title="{{ i.object_type }} {% if i.register == "0" %}template{% endif %}" class="object_tag state_{{ i.state }}">{{ i.tag }}</div>
                    </td>
                    <td>
                        <a href="?view={{ view }}&pane1={{ pane1_id }}&pane2={{ pane2_id }}&pane3={{ i.id }}">
                    <span style="{% if i.register == "0" %}color: grey;{% endif %} {% if i.id == pane3_id %}color: red;{% endif %}">
                        {{ i.description }}
                    </span>
                        </a>
                    </td>
                </tr>
            {% endfor %}
            </tbody>
        </table>
    </div>
    <div style="border-style: groove;" class="span4">
        <table class="dtable" id="pane3">
            <thead>
            <th class=hide></th>
            <th></th>
            <th>{{ pane3_object.object_type }} {{ pane3_object.description }}</th>
            </thead>

            <tbody>
            {% for i in pane3_objects %}
                <tr>
                    <td class="hide">{{ forloop.counter0 }}</td>
                    <td>
                        <div title="{{ i.object_type }} {% if i.register == "0" %}template{% endif %}" class="object_tag state_{{ i.state }}">{{ i.tag }}</div>
                    </td>
                    <td>
                        <a href="?view={{ view }}&pane1={{ pane2_id }}&pane2={{ pane3_id }}&pane3={{ i.id }}">
                    <span style="{% if i.register == "0" %}color: grey;{% endif %} {% if i.id == pane3_id %}color: red;{% endif %}">
                        {{ i.description }}
                    </span>
                        </a>
                    </td>
                </tr>
            {% endfor %}
            </tbody>
        </table>
    </div>

{% endblock %}


{% block header %}
    {{ block.super }}
    <style>
        .state_0 {
            color: #468847;
            background-color: #90ee90;
            border-color: #D6E9C6;
        }
        .state_1 {
            background-color: orange;
        }
        .state_2 {
            color: #B94A48;
            background-color: pink;
            border-color: #EED3D7;
        }
        .state_3 {
            background-color: #d3d3d3;
        }
        .table td {
            line-height: 10px;
        }
        .circle {
            border-radius: 50%;
            width: 12px;
            height: 12px;
            display: inline-block;
            /* width and height can be anything, as long as they're equal */
        }
        .object_tag {
            padding: 1px;
            display: inline-block;
            border-style: solid;
            border-width: 1px;
            border-color: black;
            /* width and height can be anything, as long as they're equal */
        }
        a {
            color:  black;
        }

        <style>

    <style>
        .input-append button.add-on {
            height: inherit !important;
        }
    </style>
    <style>
        form {
            margin: 0px;
        }
    </style>

{% endblock %}

{% block sidebar %}
    <h5>Go to</h5>
    <ul class="nav nav-list">
        <li><a href="{% url status.views.status_hostgroups %}">Hostgroup View</a></li>
        <li><a href="{% url status.views.services %}">Service View</a></li>
        <li><a href="{% url status.views.test_livestatus %}">Test Livestatus</a></li>
    </ul>

{% endblock %}


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