{% extends "admin/base_site.html" %}

{% block content %}

<form method="POST" action="">
{% csrf_token %}
<input type="submit" value="Save">
<table>
  <tr>
    <th> Name (count) </th>
    <th> Person </th>
  </tr>
  {% for name, count in unresolved %}
  <tr>
    <td>
      {{name}} ({{count}})
    </td>
    <td>
      <select name="{{name}}" class="people-opts">
        <option value="">---</option>
        {% for p in people %}
        <option value="{{p.id}}">{{p}}</option>
        {% endfor %}
      </select>
    </td>
  </tr>
  {% endfor %}
</table>

<input type="submit" value="Save">
</form>

<link href="//cdnjs.cloudflare.com/ajax/libs/select2/4.0.0/css/select2.min.css" rel="stylesheet" />
<script src="//code.jquery.com/jquery-2.1.4.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/select2/4.0.0/js/select2.min.js"></script>
<script>
  $('.people-opts').select2();
</script>
{% endblock %}
