{% extends "base.html" %}
{% load ietf_streams ietf_filters %}

{% block title %}Manage delegates for {{ stream.name }} stream{% endblock %}

{% block content %}
<h1>Stream: {{ stream.name }}</h1>

{% if chairs %}
<h2>{{ stream.name }} stream chairs</h2>
<table class="ietf-table">
<tr><th>Name</th><th>Email</th></tr>
{% for chair in chairs %}
<tr class="{% cycle "oddrow" "evenrow" %}"><td>{{ chair }}</td><td>{{ chair.email.0 }} &lt;{{ chair.email.1 }}&gt;</td></tr>
{% endfor %}
</table>
{% endif %}

<h2>{{ stream.name }} stream delegates</h2>
<form action="" method="POST">
{% if delegates %}
<table class="ietf-table">
<tr><th></th><th>Name</th><th>Email</th></tr>
{% for delegate in delegates %}
<tr class="{% cycle "oddrow" "evenrow" %}"><td><input type="checkbox" name="remove_delegate" value="{{ delegate.pk }}" /></td><td>{{ delegate }}</td><td>{{ delegate.email.0 }} &lt;{{ delegate.email.1 }}&gt;</td></tr>
{% endfor %}
</table>
<p>
<input type="submit" value="Remove selected delegates" name="delete" />
</p>
{% else %}
<p>
No delegates for {{ stream.name }} stream assigned.
</p>
{% endif %}
<p>
Enter a valid e-mail address to add a new delegate.
</p>
{% if form.errors.email %}{{ form.errors.email }}{% endif %}
{{ form.email }}
<input type="submit" value="Add new delegate" />
</form>
{% endblock %}
