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

99 lines
2.6 KiB
HTML
Raw Normal View History

{% extends 'base.html' %}
{% load commonmark %}
{% load teams_tags %}
2017-05-21 14:05:31 +00:00
{% load bootstrap3 %}
{% block title %}
Team: {{ team.name }} | {{ block.super }}
{% endblock %}
{% block content %}
<h3>{{ team.name }} Team</h3>
{{ team.description|unsafecommonmark }}
2017-04-02 18:05:43 +00:00
<p>Currently {{ team.members.count }} people are members of this team{% if request.user in team.members.all %} (including you){% endif %}.</p>
{% if request.user in team.members.all %}
<p>Your team status: {% membershipstatus request.user team %}</p>
{% endif %}
2017-04-02 18:05:43 +00:00
{% if request.user in team.members.all %}
<a href="{% url 'team_leave' camp_slug=camp.slug slug=team.slug %}" class="btn btn-danger">Leave Team</a>
{% else %}
{% if team.needs_members %}
<a href="{% url 'team_join' camp_slug=camp.slug slug=team.slug %}" class="btn btn-success">Join Team</a>
{% endif %}
{% endif %}
2017-04-01 21:16:23 +00:00
<hr />
<h3>{{ team.area.name }} Area:</h3>
2017-04-08 08:09:06 +00:00
<p>This team is under the <b>{{ team.area.name }} area</b>. The following people are responsible for the <b>{{ team.name }} team</b>:</p>
<ul>
{% for resp in team.responsible.all %}
<li><b>{{ resp.get_full_name|default:"Unnamed" }}</b></li>
{% endfor %}
</ul>
2017-05-21 14:05:31 +00:00
2017-05-23 19:21:47 +00:00
<hr>
2017-05-21 14:05:31 +00:00
{% if request.user in team.responsible %}
<h3>Manage {{ team.name }} Team</h3>
<form method="post">
{% csrf_token %}
{% bootstrap_form form %}
<hr />
{% buttons %}
<button class="btn btn-primary pull-right" type="submit">Save</button>
{% endbuttons %}
</form>
<br />
<br />
<table class="table table-bordered table-hover">
<thead>
<tr>
<th>
Profile
<th >
Name
<th>
Email
<th>
Description
2017-05-23 19:21:47 +00:00
<th>
Membership Status
2017-05-21 14:05:31 +00:00
<th>
Action
<tbody>
2017-05-23 19:21:47 +00:00
{% for membership in team.teammember_set.all %}
2017-05-21 14:05:31 +00:00
<tr>
<td>
2017-05-23 19:21:47 +00:00
{{ membership.user }}
2017-05-21 14:05:31 +00:00
<td>
2017-05-23 19:21:47 +00:00
{{ membership.user.profile.name }}
2017-05-21 14:05:31 +00:00
<td>
2017-05-23 19:21:47 +00:00
{{ membership.user.profile.email }}
2017-05-21 14:05:31 +00:00
<td>
2017-05-23 19:21:47 +00:00
{{ membership.user.profile.description }}
2017-05-21 14:05:31 +00:00
<td>
2017-05-23 19:21:47 +00:00
{% if membership.approved %}member{% else %}pending{% endif %}
2017-05-21 14:05:31 +00:00
<td>
2017-05-23 19:21:47 +00:00
{% if membership.approved %}
<a class="btn btn-danger" href="{% url 'teammember_remove' camp_slug=camp.slug pk=membership.id %}"><i class="fa fa-trash-o"></i> Remove</a>
2017-05-23 19:50:53 +00:00
{% else %}
<a class="btn btn-danger" href="{% url 'teammember_remove' camp_slug=camp.slug pk=membership.id %}"><i class="fa fa-trash-o"></i> Remove</a>
<a class="btn btn-success" href="{% url 'teammember_approve' camp_slug=camp.slug pk=membership.id %}"><i class="fa fa-check"></i> Approve</a>
2017-05-23 19:21:47 +00:00
{% endif %}
2017-05-21 14:05:31 +00:00
{% endfor %}
{% endif %}
{% endblock %}