diff --git a/__init__.py b/__init__.py index c1f875744..9e3e7ba96 100644 --- a/__init__.py +++ b/__init__.py @@ -160,6 +160,13 @@ def fmt_report_desc(report_full_description): return re.sub('{.+}', '', report_full_description) +@app.template_filter() +def url_to_fec_pdf(report): + beg_img_num = report['beginning_image_number'] + beg_img_num_last_n = last_n_characters(beg_img_num) + return "http://docquery.fec.gov/pdf/{0}/{1}/{1}.pdf".format(beg_img_num_last_n, beg_img_num) + + # If HTTPS is on, apply full HSTS as well, to all subdomains. # Only use when you're sure. 31536000 = 1 year. if force_https: diff --git a/templates/committees-single.html b/templates/committees-single.html index 958dfb797..74a9c9c95 100644 --- a/templates/committees-single.html +++ b/templates/committees-single.html @@ -138,7 +138,7 @@

Financial Summary

{% with committee=context() %}

Most Recent Report: - {{ committee.reports[0].report_year }} {{committee.reports[0].report_type_full|fmt_report_desc}} + {{ committee.reports.0.report_year }} {{committee.reports.0.report_type_full|fmt_report_desc}}

Report coverage: {{ committee.reports.0.coverage_start_date|date_md }} - {{ committee.reports.0.coverage_end_date|date_md }} | View PDF »
diff --git a/templates/partials/committee-summary.html b/templates/partials/committee-summary.html index da295a173..938122e4b 100644 --- a/templates/partials/committee-summary.html +++ b/templates/partials/committee-summary.html @@ -1,5 +1,5 @@ {% with %} -{% set reports = committee.reports.0 if committee.reports else {} %} +{% set report = committee.reports.0 if committee.reports else {} %} {% set totals = committee.totals.0 if committee.totals else {} %}
@@ -20,14 +20,18 @@

Totals for {{totals.cycle|fmt_year_range|default("unav
Cash on hand
-
{{reports.cash_on_hand_end_period|currency|default("unavailable")}}
+
{{report.cash_on_hand_end_period|currency|default("unavailable")}}
Debt
-
{{reports.debts_owed_by_committee|currency|default("unavailable")}}
+
{{report.debts_owed_by_committee|currency|default("unavailable")}}