{% extends "cluster/base.html" %}
{% load bootstrap_toolkit %}

{% block subtitle %}Nodes / {% endblock %}

{% block content %}
<ul class="breadcrumb">
    <li class="active">
        Nodes
    </li>
</ul>

<div class="form-actions">
    <a class="btn btn-primary" href="{% url cluster:node_edit %}">Добавить</a>
</div>

<table class="table table-striped">
    <thead>
        <tr>
            <th>Hostname</th>
            <th>Type</th>
        </tr>
    </thead>
    <tbody>
        {% for node in nodes %}
        <tr>
            <td><a href="{% url cluster:node node.id %}">{{ node.key }}</a></td>
            <td>
                {% if node.doc.is_db %}<span class="badge badge-info">DB</span>{% endif %}
                {% if node.doc.is_application %}<span class="badge badge-success">Application</span>{% endif %}
            </td>
            <td><a class="btn" href="{% url cluster:node_edit node.id %}">редактировать</a></td>
        </tr>
        {% endfor %}
    </tbody>
</table>

{% endblock %}
