bornhack-website/src/teams/templates/team_members.html
Thomas Flummer 1c88ed8073
Added title blocks to templates that did not have one (#511)
In most cases this mirrors the primary header on the page, but in some cases the title is simplified and/or nested to reflect the depth of the current page

Co-authored-by: Thomas Steen Rasmussen <tykling@bornhack.org>
2020-06-03 21:30:10 +02:00

102 lines
3.8 KiB
HTML

{% extends 'team_base.html' %}
{% load commonmark %}
{% load bootstrap3 %}
{% load teams_tags %}
{% block title %}
Members | {{ block.super }}
{% endblock %}
{% block team_content %}
<div class="panel panel-default">
<div class="panel-heading">
<h4>Members</h4>
</div>
<div class="panel-body">
<p>The following <b>{{ team.approved_members.count }}</b> people {% if team.unapproved_members.count %}(and {{ team.unapproved_members.count }} pending){% endif %} are members of the <b>{{ team.name }} Team</b>:</p>
<table class="table table-hover">
<thead>
<tr>
<th>
Name
</th>
<th>
Status
</th>
{% if request.user in team.responsible_members.all %}
<th>
Email
</th>
<th>
Description
</th>
<th>
Action
</th>
{% endif %}
</tr>
</thead>
<tbody>
{% for member in team.memberships.all %}
{% if member.approved or not member.approved and request.user in team.responsible_members.all %}
<tr>
<td>
{{ member.user.profile.get_public_credit_name }} {% if member.user == request.user %}(this is you!){% endif %}
</td>
<td>
Team {% if member.responsible %}Responsible{% else %}Member{% endif %}
{% if not member.approved %}(pending approval){% endif %}
</td>
{% if request.user in team.responsible_members.all %}
<td>
{{ member.user.email }}
</td>
<td>
{{ member.user.profile.description|untrustedcommonmark }}
</td>
<td>
<div class="btn-group-vertical">
<a class="btn btn-danger"
href="{% url 'teams:member_remove' camp_slug=camp.slug team_slug=team.slug pk=member.id %}">
<i class="fas fa-trash"></i> Remove
</a>
{% if not member.approved %}
<a class="btn btn-success"
href="{% url 'teams:member_approve' camp_slug=camp.slug team_slug=team.slug pk=member.id %}">
<i class="fas fa-check"></i> Approve
</a>
{% endif %}
</div>
</td>
{% endif %}
</tr>
{% endif %}
{% empty %}
<p>No members found!</p>
{% endfor %}
</tbody>
</table>
{% if request.user.authorized %}
<p>Your membership status: <b>{% membershipstatus user team %}</b></p>
{% if request.user in team.members.all %}
{% if team.irc_channel and team.irc_channel_managed and request.user.profile.nickserv_username %}
<a href="{% url 'teams:fix_irc_acl' camp_slug=camp.slug team_slug=team.slug %}" class="btn btn-primary"><i class="fas fa-wrench"></i> Fix IRC ACL</a>&nbsp;
{% endif %}
<a href="{% url 'teams:leave' camp_slug=camp.slug team_slug=team.slug %}" class="btn btn-danger"><i class="fas fa-times"></i> Leave Team</a>
{% else %}
{% if team.needs_members %}
<b>This team is looking for members!</b> <a href="{% url 'teams:join' camp_slug=camp.slug team_slug=team.slug %}" class="btn btn-xs btn-success"><i class="fas fa-plus"></i> Join Team</a>
{% endif %}
{% endif %}
{% endif %}
<hr>
</div>
</div>
{% endblock %}