{% extends "base.html" %}
{% set section = "users" %}
{% block body %}
	{% if users %}
		<table width="100%" class="list" border="0" cellspacing="0" cellpadding="0">
			<thead>
				<td width="18">&nbsp;</td>
				<td>Username</td>
				<td>Email</td>
				<td>Home Directory</td>
				<td>Role</td>
			</thead>
			<tbody>
			{% for u in users %}
				<tr>
					<td><a href="/users/{{ u.id }}/delete"
						onclick="return confirm('Are you sure you want to delete this user?');"
						><img src="/media/images/delete.png"/></a></td>
					<td><a href="/users/{{ u.id }}/edit">{{ u.username }}</a></td>
					<td><a href="mailto:{{ u.email }}">{{ u.email }}</a></td>
					<td>
						{% if user.directory %}
							{{ u.directory }}
						{% else %}
							{{ userdir }}/{{ u.username }}
						{% endif %}
					</td>
					<td>{% if u.admin %}Administrator{% else %}User{% endif %}</td>
				</tr>
			{% endfor %}
			</tbody>
		</table>
	{% else %}
		<p>No users have been created.</p>
	{% endif %}
	<a href="/users/add"><img src="/media/images/add.gif" /></a>
	<a href="/users/add">Add a new user</a>
{% endblock %}
