{% extends "wginfo/wg_base.html" %}


{% block wg_titledetail %}Delegates{% endblock %}

{% block wg_content %}
<div class="wg-chair-management">

<h2>Manage delegates</h2>
<p>
Sometimes, a WG has one (or more) WG Secretaries, in addition to the WG Chairs. 
This page lets the WG Chairs delegate the authority to do updates to the WG state of WG documents in the datatracker.
</p>

<p>
You may at most delegate the datatracker update rights to {{ max_delegates }} persons at any given time.
</p>

<table style="width: 100%;">
<tr style="vertical-align: top;"><td>
{% if delegates %}
  <form action="" method="POST">
  <table class="ietf-table" style="width: 100%">
    <tr><th>Remove</th><th style="Width: 100%">Delegate name</th></tr>
  {% for delegate in delegates %}
    <tr class="{% cycle "oddrow" "evenrow" %}"><td><input type="checkbox" name="delete" value="{{ delegate.pk }}" /></td><td>{{ delegate.person }}</td></tr>
  {% endfor %}
  </table>
  <input type="submit" value="Remove delegate(s)" name="remove" />
  </form>
{% else %}
No delegates
{% endif %}
</td>
<td>
<table class="ietf-table" style="width: 100%;">
<tr><th>Add new delegate</th></tr>
{% if add_form.message %}
<tr><td class="message message-{{ add_form.message.type }}">
    {{ add_form.message.value }}
</td></tr>
{% endif %}
<tr><td>
{% if can_add %}
  <form action="" method="POST">
    {{ add_form.as_p }}
    <p>
    <input type="submit" value="{% if add_form.submit_msg %}{{ add_form.submit_msg }}{% else %}Add delegate{% endif %}" name="add" />
    {% if add_form.can_cancel %}<a href="">No! I don't want to continue</a>{% endif %}
    </p>
  </form>
{% else %}
You can only assign {{ max_delegates }} delegates. Please remove delegates to add a new one.
{% endif %}
</td></tr>
</table>
</td></tr>
</table>
</div>
{% endblock %}
