2017-03-31 15:29:28 +00:00
|
|
|
{% extends 'base.html' %}
|
|
|
|
{% load commonmark %}
|
|
|
|
|
|
|
|
{% block title %}
|
|
|
|
Teams | {{ block.super }}
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block content %}
|
|
|
|
|
|
|
|
{% if teams %}
|
2017-04-01 21:16:23 +00:00
|
|
|
<table class="table table-hover">
|
2017-03-31 15:29:28 +00:00
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>Name</th>
|
|
|
|
<th>Description</th>
|
2017-04-02 16:04:57 +00:00
|
|
|
<th>Area</th>
|
2017-04-02 17:11:11 +00:00
|
|
|
<th>Responsible</th>
|
2017-04-02 17:54:06 +00:00
|
|
|
<th>Members</th>
|
2017-04-08 07:58:16 +00:00
|
|
|
<th>Actions</th>
|
2017-03-31 15:29:28 +00:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
{% for team in teams %}
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<a href="{% url 'team_detail' camp_slug=camp.slug slug=team.slug %}">
|
2017-04-02 17:54:06 +00:00
|
|
|
{{ team.name }} Team
|
2017-03-31 15:29:28 +00:00
|
|
|
</a>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
{{ team.description|unsafecommonmark|truncatewords:50 }}
|
2017-04-02 16:04:57 +00:00
|
|
|
</td>
|
|
|
|
<td>
|
2017-04-02 17:11:11 +00:00
|
|
|
{{ team.area.name }} Area
|
|
|
|
</td>
|
|
|
|
<td>
|
2017-04-02 21:33:55 +00:00
|
|
|
{% for resp in team.responsible.all %}
|
2017-04-02 17:27:50 +00:00
|
|
|
{{ resp.get_full_name|default:"Unnamed" }}{% if not forloop.last %},{% endif %}<br>
|
2017-04-02 17:11:11 +00:00
|
|
|
{% endfor %}
|
2017-04-02 16:04:57 +00:00
|
|
|
</td>
|
2017-04-02 17:54:06 +00:00
|
|
|
<td class="text-center">
|
|
|
|
<span class="badge">{{ team.members.count }}</span>
|
|
|
|
</td>
|
2017-04-02 16:04:57 +00:00
|
|
|
{% if request.user.is_authenticated %}
|
|
|
|
<td>
|
|
|
|
{% if request.user in team.members.all %}
|
|
|
|
<a href="{% url 'team_leave' camp_slug=camp.slug slug=team.slug %}" class="btn btn-danger"><i class="fa fa-minus"></i> Leave</a>
|
|
|
|
{% else %}
|
2017-04-02 17:54:06 +00:00
|
|
|
{% if team.needs_members %}
|
2017-04-08 07:48:54 +00:00
|
|
|
<a href="{% url 'team_join' camp_slug=camp.slug slug=team.slug %}" class="btn btn-success"><i class="fa fa-plus"></i> Join</button>
|
|
|
|
{% else %}
|
|
|
|
<i>Team does not need members</i>
|
2017-04-01 21:16:23 +00:00
|
|
|
{% endif %}
|
2017-04-02 17:54:06 +00:00
|
|
|
{% endif %}
|
2017-03-31 15:29:28 +00:00
|
|
|
</td>
|
2017-04-08 07:58:16 +00:00
|
|
|
{% else %}
|
|
|
|
<td>Login to join!</td>
|
2017-04-02 16:04:57 +00:00
|
|
|
{% endif %}
|
2017-03-31 15:29:28 +00:00
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
{% else %}
|
|
|
|
<h4>No teams for <b>{{ camp.title }}</b> yet!</h4>
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% endblock %}
|