bornhack-website/src/teams/templates/team_list.html
2017-04-02 19:11:11 +02:00

68 lines
1.6 KiB
HTML

{% extends 'base.html' %}
{% load commonmark %}
{% block title %}
Teams | {{ block.super }}
{% endblock %}
{% block content %}
{% if teams %}
<table class="table table-hover">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
<th>Area</th>
<th>Responsible</th>
{% if request.user.is_authenticated %}
<th>Membership</th>
<th>Action</th>
{% endif %}
</tr>
</thead>
<tbody>
{% for team in teams %}
<tr>
<td>
<a href="{% url 'team_detail' camp_slug=camp.slug slug=team.slug %}">
{{ team.name }}
</a>
</td>
<td>
{{ team.description|unsafecommonmark|truncatewords:50 }}
</td>
<td>
{{ team.area.name }} Area
</td>
<td>
{% for resp in team.area.responsible.all %}
{{ resp.name|default:"Unnamed" }}<br>
{% endfor %}
</td>
{% if request.user.is_authenticated %}
<td>
{% if request.user in team.members.all %}
Member
{% else %}
Not member
{% endif %}
</td>
<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 %}
<a href="{% url 'team_join' camp_slug=camp.slug slug=team.slug %}" class="btn btn-success"><i class="fa fa-plus"></i> Join</button>
{% endif %}
</td>
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<h4>No teams for <b>{{ camp.title }}</b> yet!</h4>
{% endif %}
{% endblock %}