{% extends "reviewpanel/base.html" %}
{% load static %}

{% block title %}{{ program_form.name }}{% endblock %}

{% block style %}
  <link rel="stylesheet" href="{% static "css/reviewpanel.css" %}">
{% endblock %}

{% block content %}
<div class="center-fixed">
  {% with p=program_form.program.slug f=program_form.slug %}
  <div style="margin-bottom: 2em; width: 100%;">
    <div style="display:inline-block;">
      <a href="{% url 'plugins:reviewpanel:form' p f %}">review submissions</a>
    </div>
    
    <div style="float: right;">
      <a href="{% url 'logout' %}?next=/">log out</a>
    </div>
  </div>
  
  <div style="margin-bottom: 2em;">
    Form: {{ program_form.name }}
  </div>
  
  <div class="table-controls">
    <div>
    {% if cohort_active %}
      {% if completed %}
      <a href="{% url 'plugins:reviewpanel:form_index' p f %}">
      {% endif %}
        active
      {% if completed %}</a>{% endif %}
      |
    {% endif %}
      {% if not completed %}
      <a href="{% url 'plugins:reviewpanel:form_index' p f %}?completed">
      {% endif %}
        complete
      {% if not completed %}</a>{% endif %}
    </div>
  </div>
  
  <table class="index">
    <thead>
      <tr><th></th><th>score</th><th>created</th></tr>
    </thead>
    
    <tbody>
    {% for score in page %}
      <tr>
        <td>
      <a href="{% url 'plugins:reviewpanel:submission' p f score.object_id %}">
            score #{{ page.start_index|add:forloop.counter0 }}
      </a>
        </td>
        <td>
          {% if score.input.type == 'bool' %}
            {% if score.value %}True{% else %}False{% endif %}
          {% else %}
            {% if score.value %}{{ score.value }}{% else %}skipped{% endif %}
          {% endif %}
        </td>
        <td>{{ score.created }}</td>
      </tr>
    {% endfor %}
    </tbody>
  </table>
  {% endwith %}
  
  <div class="pagination" style="margin-bottom: 2em;">
    {% if page.has_previous %}
    <a href="?page=1">&laquo; first</a>
    <a href="?page={{ page.previous_page_number }}">previous</a>
    {% endif %}
    
    <span class="current">
      Page {{ page.number }} of {{ page.paginator.num_pages }}.
    </span>
    
    {% if page.has_next %}
    <a href="?page={{ page.next_page_number }}">next</a>
    <a href="?page={{ page.paginator.num_pages }}">last &raquo;</a>
    {% endif %}
  </div>
  
  <div style="margin-bottom: 1em;">
    {% url 'plugins:reviewpanel:program_index' program_form.program.slug as u %}
    <a href="{{ u }}">&lt; all forms</a>
  </div>
</div>
{% endblock %}
