2017-03-31 15:29:28 +00:00
{% extends 'base.html' %}
{% load commonmark %}
2017-04-14 14:13:17 +00:00
{% load teams_tags %}
2017-03-31 15:29:28 +00:00
{% block title %}
Teams | {{ block.super }}
{% endblock %}
{% block content %}
2017-04-08 08:09:06 +00:00
< h3 > {{ camp.title }} Teams< / h3 >
2017-04-13 15:44:46 +00:00
< 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 >
2017-04-08 08:09:06 +00:00
< p > Team memberships need to be approved by a team responsible. You will receive a message when your membership has been approved.< / p >
2017-04-08 08:14:06 +00:00
< p > At {{ camp.title }} all organisers and volunteers buy full tickets like everyone else. In the future our budget may allow for discounts or free tickets for volunteers, but not this year. However: Please let us know if you can't afford a ticket - we will figure something out!< / p >
2017-04-08 08:09:06 +00:00
< p > We currently have {{ teams.count }} teams for {{ camp.title }}:< / p >
2017-03-31 15:29:28 +00:00
{% 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 17:11:11 +00:00
< th > Responsible< / th >
2017-05-25 17:56:34 +00:00
< th class = "text-center" > Members< / th >
{% if request.user.is_authenticated %}
2017-05-24 06:02:33 +00:00
< th > Member?< / th >
2017-05-25 17:56:34 +00:00
< th > Actions< / th >
2017-05-24 06:02:33 +00:00
{% endif %}
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 >
2017-05-25 17:56:34 +00:00
2017-04-02 17:11:11 +00:00
< td >
2017-04-02 21:33:55 +00:00
{% for resp in team.responsible.all %}
2017-05-25 15:36:20 +00:00
{{ resp.profile.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-05-25 17:56:34 +00:00
2017-04-02 17:54:06 +00:00
< td class = "text-center" >
2017-07-11 20:50:31 +00:00
< span class = "badge" > {{ team.approvedmembers.count }}< / span > < br >
2017-05-25 17:56:34 +00:00
{% if team.needs_members %}(more needed){% endif %}
2017-04-02 17:54:06 +00:00
< / td >
2017-05-25 17:56:34 +00:00
2017-04-02 16:04:57 +00:00
{% if request.user.is_authenticated %}
2017-04-14 14:13:17 +00:00
< td class = "text-center" >
2017-05-25 17:56:34 +00:00
{% membershipstatus request.user team as membership_status %}
2017-04-14 14:13:17 +00:00
{% if membership_status == 'Membership Pending' %}
< i class = 'fa fa-clock-o' title = 'Pending' > < / i >
{% else %}
2017-05-24 06:02:33 +00:00
{% if membership_status == 'Member' %}
< i class = 'fa fa-thumbs-o-up' title = 'Member' > < / i >
{% else %}
< i class = 'fa fa-times' title = 'Not a member' > < / i >
{% endif %}
2017-04-14 14:13:17 +00:00
{% endif %}
< / td >
2017-05-25 17:56:34 +00:00
2017-04-02 16:04:57 +00:00
< td >
2017-05-25 17:56:34 +00:00
{% if request.user in team.members.all %}
2017-04-14 14:13:17 +00:00
< a href = "{% url 'team_leave' camp_slug=camp.slug slug=team.slug %}" class = "btn btn-danger" > < i class = "fa fa-minus" > < / i > Leave< / a >
2017-04-02 16:04:57 +00:00
{% else %}
2017-05-24 05:49:32 +00:00
{% 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< / a >
{% endif %}
2017-04-01 21:16:23 +00:00
{% endif %}
2017-05-24 05:49:32 +00:00
{% if request.user in team.responsible.all %}
2017-05-25 17:56:34 +00:00
< a href = "{% url 'team_manage' camp_slug=camp.slug slug=team.slug %}" class = "btn btn-primary" > < i class = "fa fa-cog" > < / i > Manage< / a >
2017-04-02 17:54:06 +00:00
{% endif %}
2017-04-02 16:04:57 +00:00
{% endif %}
2017-05-25 17:56:34 +00:00
< / td >
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 %}