{% extends "network/base.html" %}
{% load render_table from django_tables2 %}
{% load i18n %}
{% load l10n %}
{% load static %}
{% load crispy_forms_tags %}

{% block title-page %}{{ form.name.value }} | {% trans "host group" %}{% endblock %}

{% block content %}
<div class="page-header">
    <a href="{% url "network.group_delete" pk=group.pk %}" class="btn btn-danger pull-right"><i class="fa fa-times-circle"></i> {% trans "Delete this group" %}</a>
    <h2>{{ form.name.value }}</h2>
</div>

<div class="row">
    <div class="col-sm-6">
        {% crispy form %}
    </div>
    <div class="col-sm-5 col-sm-offset-1">
        <div class="page-header">
            <a href="{% url "network.rule_create" %}?hostgroup={{ group_pk }}" class="btn btn-success pull-right btn-xs"><i class="fa fa-plus-circle"></i> {% trans "Add new rule" %}</a>
            <h3>{% trans "Rules" %}</h3>
        </div>
        {% if rule_list.data.data.count > 0 %}
            {% render_table rule_list %}
        {% else %}
            {% trans "No rules associated with this host group!" %}
        {% endif %}
    </div>
</div>
{% endblock %}
