{% extends "report_builder/base.html" %}
{% load url from future %}
{% block content %}
    <script src="{{ STATIC_URL }}report_builder/js/jquery-1.8.2.min.js" type="text/javascript" ></script>
    <script src="{{ STATIC_URL }}report_builder/js/report_form.js" type="text/javascript" ></script>
    <p>
      Select the report you wish to use. Report filters will be ignored and
      only your checked off items will be reported.
    </p>
    <p>
      Create and manage reports <a href="{% url "admin:report_builder_report_changelist" %}">here</a>.
    </p>
    <p>
      You have selected {{ number_objects}} {{ model }} record{{ number_objects|pluralize }}. Click <a href="{{ admin_url}}">here to go back</a>.
    </p>
    <h2>{{ model|capfirst }} Reports</h2>
    <table class="reports_table">
    <thead>
        <tr>
            <th>Name</th>
            <th>Description</th>
            <th>Created</th>
            <th>Modified</th>
            <th>Select and Download</th>
        </tr>
    </thead>
    <tbody>
        {% for report in object_list %}
        <tr>
            <td>
                {{ report.name }}
            </td>
            <td>
                {{ report.description }}
            </td>
            <td>
                {{ report.created }} by {{ report.user_created }}
            </td>
            <td>
                {{ report.modified }} by {{ report.user_modified }}
            </td>
            <td>
                <a href="?ct={{ ct }}&ids={{ ids }}&download={{ report.id }}">
                  <img style="width: 26px;" src="/static/report_builder/img/download.svg"/>
                </a>
            </td>
        </tr>
        {% endfor %}
    </tbody>
    </table>
{% endblock %}
