{% load i18n %}

<div class="table_title">
  <h3>{% trans "Security Groups" %}</h3>
  <div class="table_actions">

    <a id="security_groups_create_link" class="btn primary small" href="{{ create_sec_url }}">{% trans "Create Security Group" %}</a>
    
    <div class="security_group table_search">
      <form action="#">
        <input class="span3" type="text">
      </form>
    </div>
    <a class="inspect" href="#">{% trans "inspect" %}</a>
  </div>
</div>

<table id="security_groups" class="zebra-striped sortable">
  <thead>
    <tr>
      <th></th>
      <th>{% trans "Name"%}</th>
      <th>{% trans "Description"%}</th>
      <th colspan="2">{% trans "Actions"%}</th>
    </tr>
  </thead>
  <tbody>
    {% for security_group in security_groups %}
    <tr class="{% cycle 'odd' 'even' %}">
      <td class="select">
        <input type="checkbox" name="security_group_{{security_group.id}}" value="security_group_{{security_group.id}}" id="security_group_select_{{security_group.id}}" />
      </td>
      <td><a href="{% url horizon:nova:access_and_security:security_groups:edit_rules security_group.id %}">{{ security_group.name }}</a></td>
      <td>{{ security_group.description }}</td>
      <td>
        <a class="btn primary small" href="{% url horizon:nova:access_and_security:security_groups:edit_rules security_group.id %}">{% trans "Edit Rules"%}</a>
      </td>
      <td id="name_{{security_group.name}}" class="actions">
        {% if security_group.name != 'default' %}      
          <a class="more-actions" href="#">More</a>
          <ul>
              <li class="form">{% include "nova/access_and_security/security_groups/_delete.html" with form=delete_form %}</li>
          </ul>
        {% endif %}
      </td>
    </tr>
    {% endfor %}
  </tbody>
</table>
