symposion_app/symposion_project/templates/teams/team_detail.html
2012-08-02 13:17:16 -04:00

69 lines
2.6 KiB
HTML

{% extends "site_base.html" %}
{% block head_title %}{{ team.name }}{% endblock %}
{% block body %}
<h1>{{ team.name }}{% if state %} <span class="label">{{ state }}</span>{% endif %}</h1>
{% if team.description %}<p>{{ team.description }}</p>{% endif %}
{% if can_join %}
<form method="post" action="{% url team_join team.slug %}">
{% csrf_token %}
<input type="submit" class="btn btn-primary" value="join">
</form>
{% endif %}
{% if can_leave %}
<form method="post" action="{% url team_leave team.slug %}">
{% csrf_token %}
<input type="submit" class="btn" value="leave">
</form>
{% endif %}
{% if can_apply %}
<form method="post" action="{% url team_apply team.slug %}">
{% csrf_token %}
<input type="submit" class="btn btn-primary" value="apply">
</form>
{% endif %}
{% if user.is_staff or state == "manager" %}
{% if team.managers %}
<h2>Managers</h2>
<table class="table table-striped">
{% for membership in team.managers %}
<tr>
<td>{{ membership.user.email }}</td>
<td>
<form style="margin: 0;" method="post" action="{% url team_demote membership.pk %}">{% csrf_token %}<button type="submit" class="btn btn-mini">demote</button></form>
</td>
</tr>
{% endfor %}
</table>
{% endif %}
{% if team.members %}
<h2>Team Members</h2>
<table class="table table-striped">
{% for membership in team.members %}
<tr>
<td>{{ membership.user.email }}</td>
<td>
<form style="margin: 0;" method="post" action="{% url team_promote membership.pk %}">{% csrf_token %}<button type="submit" class="btn btn-mini">promote</button></form>
</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>
<td>{{ membership.user.email }}</td>
</tr>
{% endfor %}
</table>
{% endif %}
{% endif %}
{% endblock %}