mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-11 04:19:25 +00:00
Add old membership views
This commit is contained in:
@ -18,6 +18,14 @@
|
||||
>{% trans %}Members{% endtrans %}</a>
|
||||
{% endif %}
|
||||
|
||||
{% if can_view(club, user) %}
|
||||
<a href="{{ url('club:club_old_members', club_id=club.pk) }}"
|
||||
{%- if tab == "elderlies" -%}
|
||||
class="selected_tab"
|
||||
{%- endif -%}
|
||||
>{% trans %}Old members{% endtrans %}</a>
|
||||
{% endif %}
|
||||
|
||||
{% if can_view(club, user) %}
|
||||
<a href="{{ url('club:tools', club_id=club.id) }}"
|
||||
{%- if tab == "tools" -%}
|
||||
|
@ -8,6 +8,7 @@
|
||||
<td>{% trans %}User{% endtrans %}</td>
|
||||
<td>{% trans %}Role{% endtrans %}</td>
|
||||
<td>{% trans %}Description{% endtrans %}</td>
|
||||
<td>{% trans %}Since{% endtrans %}</td>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for m in club.members.filter(end_date=None).order_by('-role').all() %}
|
||||
@ -15,6 +16,10 @@
|
||||
<td>{{ user_profile_link(m.user) }}</td>
|
||||
<td>{{ settings.SITH_CLUB_ROLES[m.role] }}</td>
|
||||
<td>{{ m.description }}</td>
|
||||
<td>{{ m.start_date }}</td>
|
||||
{% if m.can_be_edited_by(user) %}
|
||||
<td><a href="{{ url('club:membership_set_old', membership_id=m.id) }}">{% trans %}Mark as old{% endtrans %}</a></td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
|
29
club/templates/club/club_old_members.jinja
Normal file
29
club/templates/club/club_old_members.jinja
Normal file
@ -0,0 +1,29 @@
|
||||
{% extends "club/club_base.jinja" %}
|
||||
{% from 'core/macros.jinja' import user_profile_link %}
|
||||
|
||||
{% block club %}
|
||||
<h2>{% trans %}Club old members{% endtrans %}</h2>
|
||||
<table>
|
||||
<thead>
|
||||
<td>{% trans %}User{% endtrans %}</td>
|
||||
<td>{% trans %}Role{% endtrans %}</td>
|
||||
<td>{% trans %}Description{% endtrans %}</td>
|
||||
<td>{% trans %}From{% endtrans %}</td>
|
||||
<td>{% trans %}To{% endtrans %}</td>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for m in club.members.exclude(end_date=None).order_by('-role', '-end_date').all() %}
|
||||
<tr>
|
||||
<td>{{ user_profile_link(m.user) }}</td>
|
||||
<td>{{ settings.SITH_CLUB_ROLES[m.role] }}</td>
|
||||
<td>{{ m.description }}</td>
|
||||
<td>{{ m.start_date }}</td>
|
||||
<td>{{ m.end_date }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user