Skip to content

Commit

Permalink
Merge pull request #415 from datamade/bill-documents
Browse files Browse the repository at this point in the history
list additional document attachments
  • Loading branch information
derekeder authored Mar 29, 2024
2 parents e587e77 + 572fa78 commit 1f27802
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 16 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Chicago Councilmatic is a free and easy way to access official Chicago City Coun

## Production data and SQLite archive

If you'd like to explore the data for Chicago Councilmatic yourself, we make a SQLite database using [Datasette](https://datasette.io/) available here: https://puddle.bunkum.us/chicago_council. This data is updated nightly.
If you'd like to explore the data for Chicago Councilmatic yourself, we make a SQLite database using [Datasette](https://datasette.io/) available here: https://puddle.datamade.us/chicago_council. This data is updated nightly.

The data updates for the production instance of this site is done with GitHub actions in the https://github.com/datamade/chicago-council-scrapers repository. Data is also updated nightly.

Expand Down
2 changes: 1 addition & 1 deletion chicago/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def full_text_doc_url(self):
"""
if self.versions.all():
most_recent = self.versions.first().links.first().url
return f"https://corsproxy.bunkum.us/corsproxy/?apiurl={most_recent}"
return most_recent
else:
return None

Expand Down
2 changes: 1 addition & 1 deletion chicago/templates/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ <h3>We're open source!</h3>
<div class="col-sm-8" id="data">
<h3>Data</h3>

<p>If you'd like to explore the data for Chicago Councilmatic yourself, we make a SQLite database using <a href='https://datasette.io/'>Datasette</a> available here: <a href='https://puddle.bunkum.us/chicago_council'>https://puddle.bunkum.us/chicago_council</a>. This data is updated nightly.</p>
<p>If you'd like to explore the data for Chicago Councilmatic yourself, we make a SQLite database using <a href='https://datasette.io/'>Datasette</a> available here: <a href='https://puddle.datamade.us/chicago_council'>https://puddle.datamade.us/chicago_council</a>. This data is updated nightly.</p>

<p>The data on Councilmatic comes from the Chicago City Clerk <a href="https://chicityclerkelms.chicago.gov/" target="_blank">eLMS</a>, a custom legislation management system built by <a href="https://www.eki-digital.com/" target="_blank">EKI Digital</a> that was launched in June 2023. Prior to that, the City Clerk housed their data in the <a href='https://www.granicus.com/solutions/meeting-agenda-suite/' target="_blank">Legistar Legislative Management Suite</a> built by <a href='http://www.granicus.com/' target="_blank">Granicus</a>. The data on Councilmatic is sourced from both of these systems.</p>

Expand Down
18 changes: 7 additions & 11 deletions chicago/templates/legislation.html
Original file line number Diff line number Diff line change
Expand Up @@ -237,23 +237,19 @@ <h3>
<div class="divider"></div>
{% endif %}

{% if legislation.attachments %}
<h3>
<i class='fa fa-fw fa-paperclip'></i>
Attachments ({{ legislation.attachments | length }})
</h3>
{% include 'partials/legislation_text.html' %}

{% if legislation.documents.all %}
<h3>Additional Documents</h3>
<ul>
{% for doc in legislation.attachments %}
{% for document in legislation.documents.all|dictsort:"note" %}
<li>
<a href="{{doc.url}}" target="blank">{{ doc.note }}</a>
<a href="{{document.links.first.url|proxy_url}}">{{ document.note }}</a>
</li>
{% endfor %}
</ul>
<div class="divider"></div>
{% endif %}

{% include 'partials/legislation_text.html' %}

<h3>Tools</h3>
<div class="modal-links">
<a href="rss/" title="RSS feed for Legislation {{legislation.friendly_name}}"><i class="fa fa-fw fa-rss-square" aria-hidden="true"></i> RSS updates for this legislation</a><br />
Expand Down Expand Up @@ -308,7 +304,7 @@ <h3>Legislation not found</h3>
});

if (window.screen.width > 768){
$("#pdf-embed").attr("src", "/pdfviewer/?file={{legislation.full_text_doc_url|urlencode}}");
$("#pdf-embed").attr("src", "/pdfviewer/?file={{legislation.full_text_doc_url|proxy_url|urlencode}}");
}
else{
$('#pdf-embed').hide()
Expand Down
4 changes: 2 additions & 2 deletions chicago/templates/partials/legislation_text.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ <h3>
Legislation text
</h3>
<p>
<a id="pdf-download-link" target='_blank' href='{{legislation.full_text_doc_url}}'><i class='fa fa-fw fa-download'></i> Download PDF</a>
<a id="pdf-download-link" target='_blank' href='{{legislation.full_text_doc_url|proxy_url}}'><i class='fa fa-fw fa-download'></i> Download PDF</a>
</p>
<iframe
id="pdf-embed"
Expand All @@ -22,7 +22,7 @@ <h3>
{% if legislation.ocr_full_text|clean_html|length > 65 %}
<h3>
<i class='fa fa-fw fa-file-text-o'></i>
Legislation text
Legislation Text
</h3>
<div class='panel panel-default'>
<div class='panel-body'>
Expand Down
5 changes: 5 additions & 0 deletions chicago/templatetags/extras.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,3 +198,8 @@ def get_mayor(year):
return "Richard M. Daley"
else:
return ""


@register.filter
def proxy_url(url):
return f"https://corsproxy.bunkum.us/corsproxy/?apiurl={url}"

0 comments on commit 1f27802

Please sign in to comment.