1886323d74
Boot custom CSS, and put some base, standard css in its place. Shame I did not start with fresh Bootstrap4, but oh well. Some more templates could be made to make this less messy, which would be good.
103 lines
4.4 KiB
HTML
103 lines
4.4 KiB
HTML
{% extends "site_base.html" %}
|
|
|
|
{% load bootstrap %}
|
|
|
|
{% block head_title %}{{ team.name }}{% endblock %}
|
|
|
|
{% block body_outer %}
|
|
<div class="pull-right">
|
|
{% if can_join %}
|
|
<form class="form-horizontal" method="post" action="{% url "team_join" team.slug %}">
|
|
{% csrf_token %}
|
|
<input type="submit" class="btn btn-primary" value="join">
|
|
</form>
|
|
{% endif %}
|
|
|
|
{% if can_leave %}
|
|
<form class="form-horizontal" method="post" action="{% url "team_leave" team.slug %}">
|
|
{% csrf_token %}
|
|
<input type="submit" class="btn btn-default" value="leave">
|
|
</form>
|
|
{% endif %}
|
|
|
|
{% if can_apply %}
|
|
<form class="form-horizontal" method="post" action="{% url "team_apply" team.slug %}">
|
|
{% csrf_token %}
|
|
<input type="submit" class="btn btn-primary" value="apply">
|
|
</form>
|
|
{% endif %}
|
|
</div>
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="jumbotron">
|
|
<h1>{{ team.name }}{% if state %} <span class="label">{{ state }}</span>{% endif %}</h1>
|
|
|
|
{% if team.description %}<p>{{ team.description }}</p>{% endif %}
|
|
|
|
{% if state == "invited" %}<p>You have been invited to join this team. Click <b>join</b> to the right to accept.</p>{% endif %}
|
|
|
|
{% if user.is_staff or state == "manager" %}
|
|
{% if team.managers %}
|
|
<h2>Managers</h2>
|
|
<table class="table table-striped">
|
|
{% for membership in team.managers %}
|
|
<tr>
|
|
<td>{{ membership.user.email }}{% if user == membership.user %} <span class="label label-info">you</span>{% endif %}</td>
|
|
<td>
|
|
<form class="form-horizontal" style="margin: 0;" method="post" action="{% url "team_demote" membership.pk %}">{% csrf_token %}<button type="submit" class="btn btn-xs">demote</button></form>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</table>
|
|
{% endif %}
|
|
{% if team.members %}
|
|
<h2>Team Members</h2>
|
|
<table class="table table-striped">
|
|
{% for membership in team.members %}
|
|
<tr>
|
|
<td>{{ membership.user.email }}{% if user == membership.user %} <span class="label label-info">you</span>{% endif %}</td>
|
|
<td>
|
|
<form class="form-horizontal" style="margin: 0;" method="post" action="{% url "team_promote" membership.pk %}">{% csrf_token %}<button type="submit" class="btn btn-xs">promote</button></form>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</table>
|
|
{% endif %}
|
|
{% if team.applicants and team.access == "application" %}
|
|
<h2>Applicants</h2>
|
|
<table class="table table-striped">
|
|
{% for membership in team.applicants %}
|
|
<tr>
|
|
<td>{{ membership.user.email }}</td>
|
|
<td>
|
|
<form class="form-horizontal" style="margin: 0; float: left;" method="post" action="{% url "team_accept" membership.pk %}">{% csrf_token %}<button type="submit" class="btn btn-xs">accept</button></form>
|
|
<form class="form-horizontal" style="margin: 0; float: left;" method="post" action="{% url "team_reject" membership.pk %}">{% csrf_token %}<button type="submit" class="btn btn-xs">reject</button></form>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</table>
|
|
{% endif %}
|
|
{% if team.invitees %}
|
|
<h2>Invitees</h2>
|
|
<table class="table table-striped">
|
|
{% for membership in team.invitees %}
|
|
<tr>
|
|
<td>{{ membership.user.email }}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</table>
|
|
{% endif %}
|
|
{% if invite_form %}
|
|
<form method="POST" action="" class="form-horizontal">
|
|
{% csrf_token %}
|
|
<legend>Invite User to Team</legend>
|
|
{{ invite_form|bootstrap_horizontal }}
|
|
<div class="form-actions">
|
|
<input class="btn btn-primary" type="submit" value="Invite" />
|
|
</div>
|
|
</form>
|
|
{% endif %}
|
|
{% endif %}
|
|
</div>
|
|
{% endblock %}
|