Private
Public Access
1
0
Files
rowsandall/rowers/templates/teams.html
Sander Roosendaal 841b9b3b5b team create
2018-10-10 21:41:27 +02:00

185 lines
5.5 KiB
HTML

{% extends "newbase.html" %}
{% block title %}Teams {% endblock %}
{% block main %}
<ul class="main-content">
{% if teams %}
<li >
<h2>My Teams</h2>
<table width="100%" class="listtable">
<thead>
<tr>
<th>Name</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
{% for team in teams %}
<tr>
<td>
<a href="/rowers/team/{{ team.id }}/">{{ team.name }}</a>
</td>
<td>
<a class="button small red" href="/rowers/team/{{ team.id }}/leaveconfirm">Leave</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</li>
{% endif %}
{% if otherteams %}
<li >
<h2>Other Teams</h2>
<table width="100%" class="listtable">
<thead>
<tr>
<th>Name</th>
<th>Manager</th>
</tr>
</thead>
<tbody>
{% for team in otherteams %}
<tr>
<td>
<a href="/rowers/team/{{ team.id }}/">{{ team.name }}</a>
</td>
<td>
{{ team.manager.first_name }} {{ team.manager.last_name }}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</li>
{% endif %}
{% if user.rower.rowerplan == 'coach' %}
<li >
<h2>Teams I manage</h2>
<p>Number of members: {{ clubsize }}</p>
<p>Maximum club size: {{ max_clubsize }}</p>
{% if myteams %}
<table width="100%" class="listtable">
<thead>
<tr>
<th>Name</th>
<th>Manager</th>
</tr>
</thead>
<tbody>
{% for team in myteams %}
<tr>
<td>
<a href="/rowers/team/{{ team.id }}/">{{ team.name }}</a>
</td>
<td>
<a class="button small red" href="/rowers/team/{{ team.id }}/deleteconfirm">Delete</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
<a class="button green" href="/rowers/team/create">New Team</a>
</li>
{% endif %}
{% if invites or requests or myrequests or myinvites %}
<li class="grid_2">
<h2>Invitations and Requests</h2>
<p>This section lists open invites to join a team. By accepting
a team invite, you are agreeing with the sharing
of personal data between team members and coaches according to
our <a href="/rowers/legal">privacy policy</a>.
</p>
<p>As a team manager, by accepting a team invite, you are agreeing
with our <a href="/rowers/legal">privacy policy</a> regarding teams and
personal data owned by team members.</p>
<table width="90%" class="listtable">
<thead>
<tr>
<th>Team</th>
<th>Manager</th>
<th>User</th>
<th>Action</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
{% for i in invites %}
<tr>
<td><a href="/rowers/team/{{ i.team.id }}">{{ i.team.name }}</a></td>
<td>{{ i.team.manager.first_name }} {{ i.team.manager.last_name }}</td>
<td>{{ user.first_name }} {{ user.last_name }}</td>
<td><a class="button small green" href="/rowers/me/invitation/{{ i.code }}">Accept</a>
</td>
<td>
<a class="button small red" href="/rowers/me/invitation/{{ i.id }}/reject">Reject</a>
</td>
</tr>
{% endfor %}
{% for i in requests %}
<tr>
<td><a href="/rowers/team/{{ i.team.id }}">{{ i.team.name }}</a></td>
<td>{{ i.team.manager.first_name }} {{ i.team.manager.last_name }}</td>
<td>{{ user.first_name }} {{ user.last_name }}</td>
<td></td>
<td><a class="button red small" href="/rowers/me/request/{{ i.id }}/revoke">Revoke</a>
</tr>
{% endfor %}
{% for i in myrequests %}
<tr>
<td><a href="/rowers/team/{{ i.team.id }}">{{ i.team.name }}</a></td>
<td>{{ i.team.manager.first_name }} {{ i.team.manager.last_name }}</td>
<td>{{ i.user.first_name }} {{ i.user.last_name }}</td>
<td><a class="button small green" href="/rowers/me/request/{{ i.code }}">Accept</a>
<td>
<a class="button small red" href="/rowers/me/request/{{ i.id }}/reject">Reject</a>
</td>
</tr>
{% endfor %}
{% for i in myinvites %}
<tr>
<td><a href="/rowers/team/{{ i.team.id }}">{{ i.team.name }}</a></td>
<td>{{ i.team.manager.first_name }} {{ i.team.manager.last_name }}</td>
{% if i.user %}
<td>{{ i.user.first_name }} {{ i.user.last_name }}</td>
{% else %}
<td>{{ i.email }}</td>
{% endif %}
<td>&nbsp;
<td>
<a class="button small red" href="/rowers/me/invitation/{{ i.id }}/revoke">Revoke</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<h3>Manual code redeem</h3>
<form enctype="multipart/form-data" action="{{ formloc }}" method="post">
{% if form.errors %}
<p style\"color: red;">
Please correct the error{{ form.errors|pluralize }} below.
</p>
{% endif %}
{% csrf_token %}
<table>
{{ form.as_table }}
</table>
<input class="button green" type="submit" value="Submit">
</form>
{% endif %}
</li>
</ul>
{% endblock %}
{% block sidebar %}
{% include 'menu_teams.html' %}
{% endblock %}