Team create, delete, leave, create invite
This commit is contained in:
61
rowers/templates/team.html
Normal file
61
rowers/templates/team.html
Normal file
@@ -0,0 +1,61 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Team {% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="grid_12 alpha">
|
||||
<h1>{{ team.name }}</h1>
|
||||
<p>{{ team.notes }}</p>
|
||||
<div class="grid_2 suffix_10 alpha">
|
||||
<a class="button red small" href="/rowers/team/{{ team.id }}/leaveconfirm">Leave this team</a>
|
||||
</div>
|
||||
<div class="grid_6 alpha">
|
||||
<p>
|
||||
<h2>Members</h2>
|
||||
<table width="100%" class="listtable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for member in members %}
|
||||
<tr>
|
||||
<td> {{ member.user.first_name }} {{ member.user.last_name }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="grid_6 omega">
|
||||
{% if team.manager == user %}
|
||||
<p>Use the form to add a new user. You can either select a user from the slist, or you can type his email address, which also works for users who have not registered to the site yet.</p>
|
||||
{% if inviteform.errors %}
|
||||
<p style="color: red;">
|
||||
Please correct the error{{ inviteform.errors|pluralize }} below.
|
||||
</p>
|
||||
{% endif %}
|
||||
<form enctype="multipart/form-data" action="{{ formloc }}" method="post">
|
||||
<table>
|
||||
{{ inviteform.as_table }}
|
||||
</table>
|
||||
{% csrf_token %}
|
||||
<div id="formbutton" class="grid_1 prefix_4 suffix_1">
|
||||
<input class="button green" type="submit" value="Submit">
|
||||
</div>
|
||||
</form>
|
||||
{% else %}
|
||||
<p>
|
||||
|
||||
</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
{% endblock %}
|
||||
28
rowers/templates/teamcreate.html
Normal file
28
rowers/templates/teamcreate.html
Normal file
@@ -0,0 +1,28 @@
|
||||
{% extends "base.html" %}
|
||||
{% load staticfiles %}
|
||||
|
||||
{% block title %}New Team{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<form enctype="multipart/form-data" action="{{ formloc }}" method="post">
|
||||
<div id="left" class="grid_6 alpha">
|
||||
<h1>Create a new Team</h1>
|
||||
{% if form.errors %}
|
||||
<p style="color: red;">
|
||||
Please correct the error{{ form.errors|pluralize }} below.
|
||||
</p>
|
||||
{% endif %}
|
||||
|
||||
<table>
|
||||
{{ form.as_table }}
|
||||
</table>
|
||||
{% csrf_token %}
|
||||
<div id="formbutton" class="grid_1 prefix_4 suffix_1">
|
||||
<input class="button green" type="submit" value="Submit">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</form>
|
||||
{% endblock %}
|
||||
43
rowers/templates/teamdeleteconfirm.html
Normal file
43
rowers/templates/teamdeleteconfirm.html
Normal file
@@ -0,0 +1,43 @@
|
||||
{% extends "base.html" %}
|
||||
{% load staticfiles %}
|
||||
{% load rowerfilters %}
|
||||
|
||||
{% block title %}Leave Team {% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div id="workouts" class="grid_6 alpha">
|
||||
|
||||
{% if form.errors %}
|
||||
<p style="color: red;">
|
||||
Please correct the error{{ form.errors|pluralize }} below.
|
||||
</p>
|
||||
{% endif %}
|
||||
|
||||
<h1>Confirm Deleting the team {{ team.name }}</h1>
|
||||
<p>This will remove the team. Your team members and their workouts
|
||||
will not be deleted.
|
||||
</p>
|
||||
|
||||
|
||||
<div class="grid_2 alpha">
|
||||
<p>
|
||||
<a class="button green small" href="/rowers/team/{{ team.id }}">Cancel</a>
|
||||
</div>
|
||||
|
||||
<div class="grid_2">
|
||||
<p>
|
||||
<a class="button red small" href="/rowers/team/{{ team.id }}/delete">Delete</a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="images" class="grid_6 omega">
|
||||
<p>
|
||||
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
{% endblock %}
|
||||
45
rowers/templates/teamleaveconfirm.html
Normal file
45
rowers/templates/teamleaveconfirm.html
Normal file
@@ -0,0 +1,45 @@
|
||||
{% extends "base.html" %}
|
||||
{% load staticfiles %}
|
||||
{% load rowerfilters %}
|
||||
|
||||
{% block title %}Leave Team {% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div id="workouts" class="grid_6 alpha">
|
||||
|
||||
{% if form.errors %}
|
||||
<p style="color: red;">
|
||||
Please correct the error{{ form.errors|pluralize }} below.
|
||||
</p>
|
||||
{% endif %}
|
||||
|
||||
<h1>Confirm Leaving the team {{ team.name }}</h1>
|
||||
<p>This will remove you and all your workouts from the team. If this
|
||||
is a closed team, you can only return when the team manager
|
||||
reinvites you.
|
||||
If this is an open team, you can return by applying for team membership.
|
||||
</p>
|
||||
|
||||
|
||||
<div class="grid_2 alpha">
|
||||
<p>
|
||||
<a class="button green small" href="/rowers/team/{{ team.id }}">Cancel</a>
|
||||
</div>
|
||||
|
||||
<div class="grid_2">
|
||||
<p>
|
||||
<a class="button red small" href="/rowers/team/{{ team.id }}/leave">Leave</a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="images" class="grid_6 omega">
|
||||
<p>
|
||||
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
{% endblock %}
|
||||
@@ -6,10 +6,33 @@
|
||||
<div class="grid_12 alpha">
|
||||
<div class="grid_6 alpha">
|
||||
<p>
|
||||
<h2>Teams</h2>
|
||||
|
||||
Future teams page
|
||||
|
||||
<h2>My Teams</h2>
|
||||
{% if teams %}
|
||||
<table width="70%" class="listtable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th> </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for team in teams %}
|
||||
<tr>
|
||||
<td>
|
||||
<a href="/rowers/team/{{ team.id }}/">{{ team.name }}</a>
|
||||
</td>
|
||||
<td>
|
||||
<div class="grid_1">
|
||||
<a class="button small red" href="/rowers/team/{{ team.id }}/leaveconfirm">Leave</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% else %}
|
||||
<p>You are not a member of any team.</p>
|
||||
{% endif %}
|
||||
</p>
|
||||
|
||||
|
||||
@@ -21,7 +44,40 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{% if user.rower.rowerplan == 'coach' %}
|
||||
<div class="grid_12 alpha">
|
||||
<div class="grid_6 alpha">
|
||||
<h2>Teams I manage</h2>
|
||||
{% if myteams %}
|
||||
<table width="70%" class="listtable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th> </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for team in myteams %}
|
||||
<tr>
|
||||
<td>
|
||||
<a href="/rowers/team/{{ team.id }}/">{{ team.name }}</a>
|
||||
</td>
|
||||
<td>
|
||||
<div class="grid_1">
|
||||
<a class="button small red" href="/rowers/team/{{ team.id }}/deleteconfirm">Delete</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endif %}
|
||||
<div class="grid_2 suffix_2 prefix_2 alpha">
|
||||
<a class="button green" href="/rowers/team/create">New Team</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user