fixup the team pages a bit, column names and stuff

This commit is contained in:
Thomas Steen Rasmussen 2017-05-25 19:56:34 +02:00
parent f4b2e55478
commit dd736066f7
2 changed files with 35 additions and 13 deletions

View file

@ -21,9 +21,9 @@ Teams | {{ block.super }}
<th>Name</th>
<th>Description</th>
<th>Responsible</th>
<th>Members</th>
<th class="text-center">Members</th>
{% if request.user.is_authenticated %}
<th>Member?</th>
{% if request.user in team.members.all or request.user in team.responsible.all %}
<th>Actions</th>
{% endif %}
</tr>
@ -39,17 +39,21 @@ Teams | {{ block.super }}
<td>
{{ team.description|unsafecommonmark|truncatewords:50 }}
</td>
<td>
{% for resp in team.responsible.all %}
{{ resp.profile.name|default:"Unnamed" }}{% if not forloop.last %},{% endif %}<br>
{% endfor %}
</td>
<td class="text-center">
<span class="badge">{{ team.members.count }}</span>
<span class="badge">{{ team.members.count }}</span><br>
{% if team.needs_members %}(more needed){% endif %}
</td>
{% if request.user.is_authenticated %}
{% membershipstatus request.user team as membership_status %}
<td class="text-center">
{% membershipstatus request.user team as membership_status %}
{% if membership_status == 'Membership Pending' %}
<i class='fa fa-clock-o' title='Pending'></i>
{% else %}
@ -60,24 +64,21 @@ Teams | {{ block.super }}
{% endif %}
{% 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 %}
{% 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>
{% else %}
<i>Team does not need members</i>
{% endif %}
{% endif %}
{% if request.user in team.responsible.all %}
<a href="{% url 'team_manage' camp_slug=camp.slug slug=team.slug %}" class="btn btn-primary"><i class="fa fa-cog"></i> Manage</a>
{% endif %}
</td>
{% else %}
<td>Login to join!</td>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>

View file

@ -21,35 +21,48 @@ Manage Team: {{ team.name }} | {{ block.super }}
</form>
<h3>{{ team.name }} Team Members</h3>
{% if team.teammember_set.exists %}
<table class="table table-bordered table-hover">
<thead>
<tr>
<th>
Profile
</th>
<th>
Name
</th>
<th>
Email
</th>
<th>
Description
</th>
<th>
Membership
</th>
<th>
Action
</th>
</tr>
</thead>
<tbody>
{% for membership in team.teammember_set.all %}
<tr>
<td>
{{ membership.user }}
</td>
<td>
{{ membership.user.profile.name }}
</td>
<td>
{{ membership.user.profile.email }}
</td>
<td>
{{ membership.user.profile.description }}
</td>
<td>
{% if membership.approved %}member{% else %}pending{% endif %}
</td>
<td>
{% 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>
@ -57,5 +70,13 @@ Manage Team: {{ team.name }} | {{ block.super }}
<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>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p>No members found!</p>
{% endif %}
{% endblock %}