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

89 lines
3.1 KiB
HTML

{% extends 'base.html' %}
{% load commonmark %}
{% load teams_tags %}
{% block title %}
Teams | {{ block.super }}
{% endblock %}
{% block content %}
<h3>{{ camp.title }} Teams</h3>
<p>This is a list of the teams for {{ camp.title }}. To join a team just press the Join button, but please put some info in your <a href="{% url 'profiles:detail' %}">profile</a> first, so the team responsible has some idea who you are.</p>
<p>You can also leave a team of course, but please let the team responsible know why :)</p>
<p>Team memberships need to be approved by a team responsible. You will receive a message when your membership has been approved.</p>
<p>At {{ camp.title }} all organisers and volunteers buy full tickets like everyone else. At future events our budget may allow for discounts or free tickets for volunteers, but currently it does not.</p>
<p>We currently have {{ teams.count }} teams for {{ camp.title }}:</p>
{% if teams %}
<table class="table table-hover">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
<th>Responsible</th>
<th class="text-center">Members</th>
<th class="text-center">Tasks</th>
{% if request.user.is_authenticated %}
<th>Member?</th>
<th>Actions</th>
{% endif %}
</tr>
</thead>
<tbody>
{% for team in teams %}
<tr>
<td>
<a href="{% url 'teams:detail' camp_slug=camp.slug team_slug=team.slug %}">
{{ team.name }} Team
</a>
</td>
<td>
{{ team.description|unsafecommonmark|truncatewords:50 }}
</td>
<td>
{% for resp in team.responsible_members.all %}
{{ resp.profile.get_public_credit_name }}{% if not forloop.last %},{% endif %}<br>
{% endfor %}
</td>
<td class="text-center">
<span class="badge">{{ team.members.count }}</span><br>
{% if team.needs_members %}(more needed){% endif %}
</td>
<td class="text-center">
<span class="badge">{{ team.tasks.count }}</span><br>
</td>
{% if request.user.is_authenticated %}
<td class="text-center">
{% membershipstatus request.user team True %}
</td>
<td>
<div class="btn-group-vertical">
<a class="btn btn-primary" href="{% url 'teams:detail' camp_slug=camp.slug team_slug=team.slug %}"><i class="fa fa-search"></i> Details</a>
{% if request.user in team.responsible_members.all %}
<a href="{% url 'teams:manage' camp_slug=camp.slug team_slug=team.slug %}" class="btn btn-primary"><i class="fa fa-cog"></i> Manage</a>
{% endif %}
{% if request.user in team.members.all %}
<a href="{% url 'teams:leave' camp_slug=camp.slug team_slug=team.slug %}" class="btn btn-danger"><i class="fa fa-remove"></i> Leave</a>
{% else %}
{% if team.needs_members %}
<a href="{% url 'teams:join' camp_slug=camp.slug team_slug=team.slug %}" class="btn btn-success"><i class="fa fa-plus"></i> Join</a>
{% endif %}
{% endif %}
</div>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<h4>No teams for <b>{{ camp.title }}</b> yet!</h4>
{% endif %}
{% endblock %}