{% extends "base.html" %}
{% block content %}
<div class="row">
  <div class="col-md-10 col-md-offset-1">
    <table class="table table-condensed">
      <tr>
        <th>Name</th>
        <th>Submitters</th>
        <th>Reviewers</th>
        <th>Payers</th>
      </tr>
      {% if divisions %}
      {% for division in divisions %}
      <tr>
        <td><a href="{{ url_for('divisions.division_detail', division_id=division.id) }}">{{ division.name }}</a></td>
        <td><a href="{{ url_for('divisions.division_detail', division_id=division.id)}}#submit">{{ division.permissions['submit']|length }}</a></td>
        <td><a href="{{ url_for('divisions.division_detail', division_id=division.id)}}#review">{{ division.permissions['review']|length }}</a></td>
        <td><a href="{{ url_for('divisions.division_detail', division_id=division.id)}}#pay">{{ division.permissions['pay']|length }}</a></td>
      </tr>
      {% endfor %}
      {% endif %}
    </table>
    <a class="btn btn-primary" href="{{ url_for('divisions.add_division') }}">Add Division</a>
  </div>
</div>
{% endblock content %}
