{% extends 'calaccess_campaign_browser/base.html' %}
{% load humanize %}

{% block title %}{{ filing.filing_id_raw }} - Filing - {{ filing.committee.name }} - {{ block.super }}{% endblock %}

{% block content %}
  <div class="row">
    <div class="col-12-lg">
        <h2>Filing No. {{ filing.filing_id_raw }} <small>{{ filing.form_id }}</small></h2>
          <ol class="breadcrumb">
            <li><a href="{{ filing.committee.filer.get_absolute_url }}">Filer</a></li>
            <li><a href="{{ filing.committee.get_absolute_url }}">{{ filing.committee.name }} ({{ filing.committee.filer_id_raw }})</a></li>
            <li class="active">{{ filing.filing_id_raw }}</li>
          </ol>
    </div>
  </div>

  <div class="row">
    <div class="col-12-lg">
      <table class="table table-bordered table-hover">
        <thead>
          <tr>
            <th>Start Date</th>
            <th>End Date</th>
            <th>Cycle</th>
            <th>itemized expn</th>
            <th>itemized mon. contributions</th>
            <th>non mon. contributions</th>
            <th>outstanding debts</th>
            <th>total contributions</th>
            <th>total expn</th>
            <th>total mon. contributions</th>
            <th>unitemized expn</th>
            <th>unitemized mon. contributions</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td>{{ filing.start_date }}</td>
            <td>{{ filing.end_date }}</td>
            <td>{{ filing.cycle.name }}</td>
          {% for summary in filing.summary_set.all %}
            <td>{{ summary.itemized_expenditures | intcomma }}</td>
            <td>{{ summary.itemized_monetary_contributions | intcomma }}</td>
            <td>{{ summary.non_monetary_contributions | intcomma }}</td>
            <td>{{ summary.outstanding_debts | intcomma }}</td>
            <td>{{ summary.total_contributions | intcomma }}</td>
            <td>{{ summary.total_expenditures | intcomma }}</td>
            <td>{{ summary.total_monetary_contributions | intcomma }}</td>
            <td>{{ summary.unitemized_expenditures | intcomma }}</td>
            <td>{{ summary.unitemized_monetary_contributions | intcomma }}</td>
          {% endfor %}
          </tr>
        </tbody>
      </table>

    </div>
  </div>
{% endblock %}
