Updated participants list with permissions.
This commit is contained in:
parent
262304d1e5
commit
a6652e3fb4
@ -40,14 +40,13 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th><a href="?sort=first_name{% if 'first_name' in request.GET.sort and 'reverse' not in request.GET %}&reverse{%endif%}">{%trans "First Name" %}</a></th>
|
<th><a href="?sort=first_name{% if 'first_name' in request.GET.sort and 'reverse' not in request.GET %}&reverse{%endif%}">{%trans "First Name" %}</a></th>
|
||||||
<th><a href="?sort=last_name{% if 'last_name' in request.GET.sort and 'reverse' not in request.GET %}&reverse{%endif%}">{%trans "Last Name" %}</a></th>
|
<th><a href="?sort=last_name{% if 'last_name' in request.GET.sort and 'reverse' not in request.GET %}&reverse{%endif%}">{%trans "Last Name" %}</a></th>
|
||||||
<th><a href="?sort=gender{% if 'gender' in request.GET.sort and 'reverse' not in request.GET %}&reverse{%endif%}">{%trans "Gender" %}</a></th>
|
|
||||||
<th><a href="?sort=group{% if 'group' in request.GET.sort and 'reverse' not in request.GET %}&reverse{%endif%}">{%trans "Group" %}</a></th>
|
<th><a href="?sort=group{% if 'group' in request.GET.sort and 'reverse' not in request.GET %}&reverse{%endif%}">{%trans "Group" %}</a></th>
|
||||||
<th><a href="?sort=type{% if 'type' in request.GET.sort and 'reverse' not in request.GET %}&reverse{%endif%}">{%trans "Type" %}</a></th>
|
|
||||||
<th><a href="?sort=committee{% if 'committee' in request.GET.sort and 'reverse' not in request.GET %}&reverse{%endif%}">{%trans "Committee" %}</a></th>
|
<th><a href="?sort=committee{% if 'committee' in request.GET.sort and 'reverse' not in request.GET %}&reverse{%endif%}">{%trans "Committee" %}</a></th>
|
||||||
|
{% if perms.participant.can_manage_participants %}
|
||||||
|
<th><a href="?sort=type{% if 'type' in request.GET.sort and 'reverse' not in request.GET %}&reverse{%endif%}">{%trans "Type" %}</a></th>
|
||||||
<th><a href="?sort=username{% if 'username' in request.GET.sort and 'reverse' not in request.GET %}&reverse{%endif%}">{%trans "Username" %}</a></th>
|
<th><a href="?sort=username{% if 'username' in request.GET.sort and 'reverse' not in request.GET %}&reverse{%endif%}">{%trans "Username" %}</a></th>
|
||||||
<th><a href="?sort=email{% if 'email' in request.GET.sort and 'reverse' not in request.GET %}&reverse{%endif%}">{%trans "Email" %}</a></th>
|
<th><a href="?sort=email{% if 'email' in request.GET.sort and 'reverse' not in request.GET %}&reverse{%endif%}">{%trans "Email" %}</a></th>
|
||||||
<th><a href="?sort=last_login{% if 'last_login' in request.GET.sort and 'reverse' not in request.GET %}&reverse{%endif%}">{%trans "Last Login" %}</a></th>
|
<th><a href="?sort=last_login{% if 'last_login' in request.GET.sort and 'reverse' not in request.GET %}&reverse{%endif%}">{%trans "Last Login" %}</a></th>
|
||||||
{% if perms.participant.can_manage_participants %}
|
|
||||||
<th>{%trans "Actions" %}</th>
|
<th>{%trans "Actions" %}</th>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</tr>
|
</tr>
|
||||||
@ -55,22 +54,15 @@
|
|||||||
<tr class="{% cycle '' 'odd' %}">
|
<tr class="{% cycle '' 'odd' %}">
|
||||||
<td>{{ user.first_name }}</td>
|
<td>{{ user.first_name }}</td>
|
||||||
<td>{{ user.last_name }}</td>
|
<td>{{ user.last_name }}</td>
|
||||||
<td>{% if "none" not in user.profile.gender %}
|
|
||||||
{% if user.profile.gender == 'male' %}
|
|
||||||
{% trans "Male" %}
|
|
||||||
{% else %}
|
|
||||||
{% trans "Female" %}
|
|
||||||
{% endif %}
|
|
||||||
{% endif %}</td>
|
|
||||||
<td>{{ user.profile.group }}</td>
|
<td>{{ user.profile.group }}</td>
|
||||||
<td>{{ user.profile.type }}</td>
|
|
||||||
<td>{{ user.profile.committee }}</td>
|
<td>{{ user.profile.committee }}</td>
|
||||||
|
{% if perms.participant.can_manage_participants %}
|
||||||
|
<td>{{ user.profile.type }}</td>
|
||||||
<td>{{ user.username }}</td>
|
<td>{{ user.username }}</td>
|
||||||
<td>{{ user.email }}</td>
|
<td>{{ user.email }}</td>
|
||||||
<td>{% if user.last_login > user.date_joined %}
|
<td>{% if user.last_login > user.date_joined %}
|
||||||
{{ user.last_login }}
|
{{ user.last_login }}
|
||||||
{% endif %}</td>
|
{% endif %}</td>
|
||||||
{% if perms.participant.can_manage_participants %}
|
|
||||||
<td style="width: 1px; white-space: nowrap;"><a href="{% url user_edit user.id %}"><img src="/static/images/icons/document-edit.png" title="{%trans 'Edit participant' %}"></a>
|
<td style="width: 1px; white-space: nowrap;"><a href="{% url user_edit user.id %}"><img src="/static/images/icons/document-edit.png" title="{%trans 'Edit participant' %}"></a>
|
||||||
<a href="{% url user_delete user.id %}"><img src="/static/images/icons/edit-delete.png" title="{%trans 'Delete participant' %}"></a>
|
<a href="{% url user_delete user.id %}"><img src="/static/images/icons/edit-delete.png" title="{%trans 'Delete participant' %}"></a>
|
||||||
{% if user.is_active %}
|
{% if user.is_active %}
|
||||||
|
@ -46,7 +46,7 @@ def get_overview(request):
|
|||||||
sort = request.GET['sort']
|
sort = request.GET['sort']
|
||||||
if sort in ['first_name', 'last_name','username','last_login','email']:
|
if sort in ['first_name', 'last_name','username','last_login','email']:
|
||||||
query = query.order_by(sort)
|
query = query.order_by(sort)
|
||||||
elif sort in ['gender', 'group', 'type', 'committee']:
|
elif sort in ['group', 'type', 'committee']:
|
||||||
query = query.order_by('profile__%s' % sort)
|
query = query.order_by('profile__%s' % sort)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
pass
|
||||||
|
Loading…
Reference in New Issue
Block a user