2015-10-16 17:53:02 +00:00
|
|
|
{% extends "site_base.html" %}
|
|
|
|
|
|
|
|
{% load bootstrap %}
|
|
|
|
|
|
|
|
{% block head_title %}{{ team.name }}{% endblock %}
|
|
|
|
|
2020-11-29 04:36:56 +00:00
|
|
|
{% block content %}
|
|
|
|
<div class="jumbotron">
|
|
|
|
<h1>{{ team.name }}</h1>
|
2015-10-16 17:53:02 +00:00
|
|
|
|
2020-11-29 04:36:56 +00:00
|
|
|
{% if team.description %}<p>{{ team.description }}</p>{% endif %}
|
2015-10-16 17:53:02 +00:00
|
|
|
|
2020-11-29 04:36:56 +00:00
|
|
|
<div>
|
|
|
|
<h2>Your Status {% if state %} <span class="badge badge-pill badge-primary">{{ state }}</span>{% endif %}</h2>
|
|
|
|
{% if state == "invited" %}
|
|
|
|
<p>
|
|
|
|
You have been invited to join this team.
|
|
|
|
<form class="form-horizontal" method="post" action="{% url "team_join" team.slug %}">
|
|
|
|
{% csrf_token %}
|
|
|
|
<input type="submit" class="btn btn-primary" value="Accept">
|
|
|
|
</form>
|
|
|
|
</p>
|
|
|
|
{% endif %}
|
2015-10-16 17:53:02 +00:00
|
|
|
|
2020-11-29 04:36:56 +00:00
|
|
|
{% if can_join %}
|
|
|
|
<p>
|
|
|
|
You are <strong>not</strong> a member of this team.
|
|
|
|
<form class="form-horizontal" method="post" action="{% url "team_join" team.slug %}">
|
|
|
|
{% csrf_token %}
|
|
|
|
<input type="submit" class="btn btn-primary" value="join">
|
|
|
|
</form>
|
|
|
|
</p>
|
|
|
|
{% endif %}
|
2015-10-16 17:53:02 +00:00
|
|
|
|
2020-11-29 04:36:56 +00:00
|
|
|
{% if can_leave %}
|
|
|
|
<p>
|
|
|
|
You are a member of this team.
|
|
|
|
<form class="form-horizontal" method="post" action="{% url "team_leave" team.slug %}">
|
|
|
|
{% csrf_token %}
|
|
|
|
<input type="submit" class="btn btn-secondary" value="leave">
|
|
|
|
</form>
|
|
|
|
</p>
|
|
|
|
{% endif %}
|
2015-10-16 17:53:02 +00:00
|
|
|
|
2020-11-29 04:36:56 +00:00
|
|
|
{% if can_apply %}
|
|
|
|
<p>
|
|
|
|
You are <strong>not</strong> a member of this team.
|
|
|
|
<form class="form-horizontal" method="post" action="{% url "team_apply" team.slug %}">
|
|
|
|
{% csrf_token %}
|
|
|
|
<input type="submit" class="btn btn-primary" value="apply">
|
|
|
|
</form>
|
|
|
|
</p>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
2015-10-16 17:53:02 +00:00
|
|
|
|
|
|
|
{% if user.is_staff or state == "manager" %}
|
|
|
|
{% if team.managers %}
|
|
|
|
<h2>Managers</h2>
|
|
|
|
<table class="table table-striped">
|
|
|
|
{% for membership in team.managers %}
|
|
|
|
<tr>
|
2020-11-29 04:36:56 +00:00
|
|
|
<td>{{ membership.user.get_full_name }} <{{ membership.user.email }}>{% if user == membership.user %} <span class="badge badge-info">you</span>{% endif %}</td>
|
2015-10-16 17:53:02 +00:00
|
|
|
<td>
|
2020-11-29 04:36:56 +00:00
|
|
|
<form class="form-horizontal" style="margin: 0;" method="post" action="{% url "team_demote" membership.pk %}">{% csrf_token %}<button type="submit" class="btn btn-sm btn-primary">demote</button></form>
|
2015-10-16 17:53:02 +00:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
</table>
|
|
|
|
{% endif %}
|
|
|
|
{% if team.members %}
|
|
|
|
<h2>Team Members</h2>
|
|
|
|
<table class="table table-striped">
|
|
|
|
{% for membership in team.members %}
|
|
|
|
<tr>
|
2020-11-29 04:36:56 +00:00
|
|
|
<td>{{ membership.user.get_full_name }} <{{ membership.user.email }}>{% if user == membership.user %} <span class="badge badge-info">you</span>{% endif %}</td>
|
2015-10-16 17:53:02 +00:00
|
|
|
<td>
|
2020-11-29 04:36:56 +00:00
|
|
|
<form class="form-horizontal" style="margin: 0;" method="post" action="{% url "team_promote" membership.pk %}">{% csrf_token %}<button type="submit" class="btn btn-sm btn-primary">promote</button></form>
|
2015-10-16 17:53:02 +00:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
</table>
|
|
|
|
{% endif %}
|
|
|
|
{% if team.applicants and team.access == "application" %}
|
|
|
|
<h2>Applicants</h2>
|
|
|
|
<table class="table table-striped">
|
|
|
|
{% for membership in team.applicants %}
|
|
|
|
<tr>
|
2020-11-29 04:36:56 +00:00
|
|
|
<td>{{ membership.user.get_full_name }} <{{ membership.user.email }}></td>
|
2015-10-16 17:53:02 +00:00
|
|
|
<td>
|
2020-11-29 04:36:56 +00:00
|
|
|
<form class="form-horizontal" style="margin: 0; float: left;" method="post" action="{% url "team_accept" membership.pk %}">{% csrf_token %}<button type="submit" class="btn btn-sm btn-primary">accept</button></form>
|
|
|
|
<form class="form-horizontal" style="margin: 0; float: left;" method="post" action="{% url "team_reject" membership.pk %}">{% csrf_token %}<button type="submit" class="btn btn-sm btn-secondary">reject</button></form>
|
2015-10-16 17:53:02 +00:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
</table>
|
|
|
|
{% endif %}
|
|
|
|
{% if team.invitees %}
|
|
|
|
<h2>Invitees</h2>
|
|
|
|
<table class="table table-striped">
|
|
|
|
{% for membership in team.invitees %}
|
|
|
|
<tr>
|
2020-11-29 04:36:56 +00:00
|
|
|
<td>{{ membership.user.get_full_name }} <{{ membership.user.email }}></td>
|
2015-10-16 17:53:02 +00:00
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
</table>
|
|
|
|
{% endif %}
|
|
|
|
{% if invite_form %}
|
|
|
|
<form method="POST" action="" class="form-horizontal">
|
|
|
|
{% csrf_token %}
|
|
|
|
<legend>Invite User to Team</legend>
|
|
|
|
{{ invite_form|bootstrap_horizontal }}
|
|
|
|
<div class="form-actions">
|
|
|
|
<input class="btn btn-primary" type="submit" value="Invite" />
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
2017-02-22 09:17:24 +00:00
|
|
|
</div>
|
2015-10-16 17:53:02 +00:00
|
|
|
{% endblock %}
|