{% extends "master.html" %}
{% block title %}Groups{% endblock %}
{%block tag %}groups{% endblock %}
{% block content %}
<h2>Groups</h2>
{% if total_page and total_page > 1 %}
<table>
<tr>
<td>
{% if page > 1%}
<a href="{{ url_for('view_groups') }}?page={{page - 1}}">
< Previous
</a>
{% else %}
< Previous
{% endif %}
</td>
<td>{{ page }} / {{ total_page }}</td>
<td>
{% if page < total_page %}
<a href="{{ url_for('view_groups') }}?page={{page + 1}}">
Next >
</a>
{% else %}
Next >
{% endif %}
</td>
</tr>
</table>
{% endif %}
{% if authenticated %}
<section class="add_users">
<h4>Create a group</h4>
<form action="{{ url_for('.add_group') }}" method="post">
<input id="group_name" name="group_name" title="Group name" />
{%- if admin %}
{{ form.group_type()|safe }}
{%- endif %}
{{ form.csrf_token }}
<input type="submit" class="submit positive button" value="Add">
</form>
</section>
{% endif %}
<p>{{ groups | length }} groups.</p>
<section class="user_list">
{% if groups %}
<ul>
{% for group in groups %}
<li>
<a href="{{ url_for('view_group', group=group.group_name)}}">
{{ group.group_name }}
</a>
</li>
{% endfor %}
</ul>
{% else %}
<p>No groups have been created on this pagure instance yet</p>
{% endif %}
</section>
{% endblock %}