{% extends "base.html" %}

{% block title %}Groups{% endblock %}

{% block content %}
<h1>Groups</h1>

{% for group in groups %}
<h3>
  <a href="{{ urls.path("/-/acl/groups/" + group.name)}}">{{ group.name }}</a>
  ({{ group.size }})
  {% if dynamic_groups.get(group.name) %} <strong>dynamic</strong>{% endif %}
</h3>
<p>{{ ', '.join(group.actor_ids) }}</p>
{% if not group.actor_ids and not dynamic_groups.get(group.name) %}
  <p><em>No members</em></p>
{% endif %}
{% if dynamic_groups.get(group.name) %}
  <p>Users matching: <code>{{ dynamic_groups[group.name]|tojson }}</code></p>
{% endif %}
{% endfor %}

<h2>Create a group</h2>

<form action="{{ request.path }}" method="post">
  <input type="hidden" name="csrftoken" value="{{ csrftoken() }}">
  <p><label>Group name <input type="text" name="new_group"></label> <input type="submit" value="Create group"></p>
</form>

{% endblock %}
