{% extends midtpl %}

{% block content %}

<table class="table">
	<thead>
		<tr>
			<th>Group name</th>
			<th>Permissions</th>
			<th>Enabled</th>
			
			<th>Action</th>
		</tr>
	</thead>
	<tbody>
		{% for e in elements %}
			<tr>
				<td>{{e.name}}</td>
				<td>{{e.permissions|join(", ", attribute='name')}}</td>
				<td>{{"Yes" if e.enabled else "No"}}</td>
				<td>
					<a class="btn btn-success" href="{{request.route_url('ppss:group:edit',elementid=e.id)}}">modify</a><br/>
				 </td>
			</tr>
		{% endfor %}

	</tbody>


</table>

<div>
	<a class="btn btn-success" href="{{request.route_url('ppss:group:edit',elementid = -1)}}">Add Group</a>
</div>

{% endblock content %}