{% extends base %}
{% load i18n admin common %}

{% block body_class %}{{ block.super }} rego team{% endblock %}

{% block main_content %}
	<div class="box">
		<h1>{{ team.title }}</h1>

		<table>
			<thead>
				<th>#</th>
				<th>{% trans "Person" %}</th>
				<th>{% trans "Player" %}</th>
				<th>{% trans "Roles" %}</th>
			</thead>
			<tbody>
				{% for member in team.people.all %}
					<tr class="{% if forloop.first %}first {% endif %}{% cycle "odd" "even" %}{% if forloop.last %} last{% endif %}">
						<td>{{ member.number|default:"-" }}</td>
						<td>{{ member.person.get_full_name }}</td>
						<td>{{ member.is_player|yesno|title }}</td>
						<td>{% for role in member.roles.all %}{{ role.name }}{% if not forloop.last %}, {% endif %}{% endfor %}</td>
					</tr>
				{% empty %}
					<tr class="first odd last">
						<td colspan="5" class="no_results">{% trans "There are no members of this team." %}</td>
					</tr>
				{% endfor %}
			</tbody>
		</table>

		<div class="buttons">
			{% block buttons %}{% endblock %}
		</div>
	</div>
{% endblock %}
