<!DOCTYPE html>
<html lang="en">
  <head>
    <title>CI Votes</title>
    <link rel="stylesheet" href="{{ url_for('static', filename='styles.css')}}">
  </head>
  <body>
    <h1>
      <i class='fa fa-chevron-circle-right pull-left'></i>
      {{ target | capitalize }}
    </h1>
    <table id="dlrn">
      <tr>
        <th>CI Name</th>
        <th>Repo hash (distro_commit)</th>
        <th>Results URL</th>
        <th>Vote</th>
        <th>In Progress?</th>
        <th>Timestamp</th>
        <th>notes</th>
      </tr>
      {% for vote in votes %}
        <tr {% if vote.ci_vote == True %}class="success"{% endif %}>
          <td>
            <form action="civotes.html" method="get">
               <input type="hidden" name="ciname" value="{{ vote.ci_name }}" />
              <button type="submit" class="button">{{ vote.ci_name }}</button>
            </form>
          </td>
          <td>
            <form action="civotes.html" method="get">
               <input type="hidden" name="commit_hash" value="{{ vote.commit_hash }}" />
               <input type="hidden" name="distro_hash" value="{{ vote.distro_hash }}" />
              <button type="submit" class="button">{{ vote.commit_hash }}_{{ vote.distro_hash_short }}</button>
            </form>
          </td>
          <td>
            <i class="fa fa-link pull-left"></i>
            <i>
              <a href="{{ vote.ci_url }}">
                {{ vote.ci_url }}
              </a>
          </td>
          <td>
            {% if vote.ci_vote  %}
              <i class="fa pull-left" style="color:#004153">SUCCESS</i>
            {% else %}
              <i class="fa pull-left" style="color:red">FAILED</i>
            {% endif %}
          </td>
          <td>
            {% if vote.ci_in_progress  %}
              <i class="fa pull-left" style="color:red">IN PROGRESS</i>
            {% else %}
              <i class="fa pull-left" style="color:#004153">FINISHED</i>
            {% endif %}
          </td>
          <td>{{ vote.timestamp | strftime }}</td>
          <td>{{ vote.notes }}</td>
        </tr>
      {% endfor %}
    </table>
  </body>
</html>
