{% extends "base.html" %}

{% load common bootstrap3 %}

{% block page_title %}OS Group - {{ osgroup }} {% endblock %}

{% block breadcrumbs %} {{ block.super }} <li><a href="{% url 'operatingsystems:os_list' %}">Operating Systems</a></li><li><a href="{% url 'operatingsystems:osgroup_list' %}">OS Groups</a></li><li class="active">{{ osgroup }}</li>{% endblock %}

{% block content_title %} OS Group - {{ osgroup }} {% endblock %}

{% block content %}

<div class="well well-sm">
  <table class="table table-striped table-bordered table-hover table-condensed table-responsive">
    <tr>
      <th>Name</th><td>{{ osgroup }}</td>
    </tr>
    <tr>
      <th class="col-sm-6">Operating Systems in this OS Group</th><td class="col-sm-6">{{ osgroup.os_set.select_related.count }}</td>
    </tr>
  </table>

  <div class="panel panel-danger">
    {% if user.is_authenticated and perms.is_admin %}
      <div class="panel-heading">
        Are you sure you want to delete this OS Group?
      </div>
      <div class="panel-body">
        <form action={{ request.path }} method="post">
          {% csrf_token %}
          <button name="delete" type="submit" class="btn btn-primary btn-sm">{% bootstrap_icon "trash" %} Delete</button>
          <button name="cancel" type="submit" class="btn btn-primary btn-sm">{% bootstrap_icon "stop" %} Cancel</button>
        </form>
      </div>
    {% else %}
      <div class="panel-heading">
        You do not have permission to delete this OS Group.
      </div>
      <div class="panel-body">
        <a class="btn btn-primary btn-sm" href="{{ osgroup.get_absolute_url }}">{% bootstrap_icon "arrow-left" %} Back</a>
      </div>
    {% endif %}
  </div>
</div>

{% endblock %}
