bornhack-website/src/teams/templates/team_list.html

68 lines
1.7 KiB
HTML
Raw Normal View History

{% 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">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
2017-04-02 16:04:57 +00:00
<th>Area</th>
<th>Responsible</th>
<th>Members</th>
2017-04-08 07:58:16 +00:00
<th>Actions</th>
</tr>
</thead>
<tbody>
{% for team in teams %}
<tr>
<td>
<a href="{% url 'team_detail' camp_slug=camp.slug slug=team.slug %}">
{{ team.name }} Team
</a>
</td>
<td>
{{ team.description|unsafecommonmark|truncatewords:50 }}
2017-04-02 16:04:57 +00:00
</td>
<td>
{{ team.area.name }} Area
</td>
<td>
{% 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>
{% endfor %}
2017-04-02 16:04:57 +00:00
</td>
<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 %}
{% if team.needs_members %}
<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 %}
{% endif %}
</td>
2017-04-08 07:58:16 +00:00
{% else %}
<td>Login to join!</td>
2017-04-02 16:04:57 +00:00
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<h4>No teams for <b>{{ camp.title }}</b> yet!</h4>
{% endif %}
{% endblock %}