Skip to content

Commit

Permalink
Merge pull request #416 from datamade/bill-summaries
Browse files Browse the repository at this point in the history
displaying summary for latest bill version
  • Loading branch information
derekeder authored Oct 4, 2024
2 parents be4262d + 98f9751 commit c4b3746
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 11 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ name: CI
on:
push:
branches:
- main
- main
pull_request:
branches:
- main
- main

jobs:
test:
name: Run tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- shell: bash
run: |
cp .env.example .env
- name: Build containers and run tests
run: docker-compose -f docker-compose.yml -f tests/docker-compose.yml run --rm app
- uses: actions/checkout@v1
- shell: bash
run: |
cp .env.example .env
- name: Build containers and run tests
run: docker compose -f docker-compose.yml -f tests/docker-compose.yml run --rm app
15 changes: 13 additions & 2 deletions chicago/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,25 @@ def addresses(self):

return []

@property
def current_version(self):
# this needs to be improved to use some logic to pick out
# the most recent version instead of just first()
if self.versions.all():
return self.versions.first()
else:
return None

@cached_property
def full_text_doc_url(self):
"""
override this if instead of having full text as string stored in
full_text, it is a PDF document that you can embed on the page
"""
if self.versions.all():
most_recent = self.versions.first().links.first().url

current_version = self.current_version
if current_version:
most_recent = current_version.links.first().url
return most_recent
else:
return None
Expand Down
2 changes: 1 addition & 1 deletion chicago/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{% include 'partials/icons.html' %}

<meta name="google-site-verification" content="6GhAJfsL-lriLRGXSHXYHcAYDMrr_UFU8t3mrgohknM" />
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css" rel="stylesheet">
<script src="https://kit.fontawesome.com/a368ef962b.js" crossorigin="anonymous"></script>
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700,300italic' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="{% static 'css/bootstrap.journal.min.css' %}" />
<link rel="stylesheet" type="text/css" href="{% static 'css/dataTables.bootstrap.css' %}" />
Expand Down
5 changes: 5 additions & 0 deletions chicago/templates/legislation.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ <h1 class="bill-page-title">
<br/>
<p>{{ legislation.title }}</p>

{% if legislation.current_version.extras.summary %}
<h3><i class="fa-solid fa-robot"></i> Auto-generated summary</h3>
<p>{{legislation.current_version.extras.summary }}</p>
{% endif %}

{% with other_identifiers=alternate_identifiers %}
{% if other_identifiers %}
<p>
Expand Down

0 comments on commit c4b3746

Please sign in to comment.