Skip to content

Commit c4b3746

Browse files
authored
Merge pull request #416 from datamade/bill-summaries
displaying summary for latest bill version
2 parents be4262d + 98f9751 commit c4b3746

File tree

4 files changed

+27
-11
lines changed

4 files changed

+27
-11
lines changed

.github/workflows/main.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@ name: CI
33
on:
44
push:
55
branches:
6-
- main
6+
- main
77
pull_request:
88
branches:
9-
- main
9+
- main
1010

1111
jobs:
1212
test:
1313
name: Run tests
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: actions/checkout@v1
17-
- shell: bash
18-
run: |
19-
cp .env.example .env
20-
- name: Build containers and run tests
21-
run: docker-compose -f docker-compose.yml -f tests/docker-compose.yml run --rm app
16+
- uses: actions/checkout@v1
17+
- shell: bash
18+
run: |
19+
cp .env.example .env
20+
- name: Build containers and run tests
21+
run: docker compose -f docker-compose.yml -f tests/docker-compose.yml run --rm app

chicago/models.py

+13-2
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,25 @@ def addresses(self):
113113

114114
return []
115115

116+
@property
117+
def current_version(self):
118+
# this needs to be improved to use some logic to pick out
119+
# the most recent version instead of just first()
120+
if self.versions.all():
121+
return self.versions.first()
122+
else:
123+
return None
124+
116125
@cached_property
117126
def full_text_doc_url(self):
118127
"""
119128
override this if instead of having full text as string stored in
120129
full_text, it is a PDF document that you can embed on the page
121130
"""
122-
if self.versions.all():
123-
most_recent = self.versions.first().links.first().url
131+
132+
current_version = self.current_version
133+
if current_version:
134+
most_recent = current_version.links.first().url
124135
return most_recent
125136
else:
126137
return None

chicago/templates/base.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
{% include 'partials/icons.html' %}
1010

1111
<meta name="google-site-verification" content="6GhAJfsL-lriLRGXSHXYHcAYDMrr_UFU8t3mrgohknM" />
12-
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css" rel="stylesheet">
12+
<script src="https://kit.fontawesome.com/a368ef962b.js" crossorigin="anonymous"></script>
1313
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700,300italic' rel='stylesheet' type='text/css'>
1414
<link rel="stylesheet" type="text/css" href="{% static 'css/bootstrap.journal.min.css' %}" />
1515
<link rel="stylesheet" type="text/css" href="{% static 'css/dataTables.bootstrap.css' %}" />

chicago/templates/legislation.html

+5
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ <h1 class="bill-page-title">
3030
<br/>
3131
<p>{{ legislation.title }}</p>
3232

33+
{% if legislation.current_version.extras.summary %}
34+
<h3><i class="fa-solid fa-robot"></i> Auto-generated summary</h3>
35+
<p>{{legislation.current_version.extras.summary }}</p>
36+
{% endif %}
37+
3338
{% with other_identifiers=alternate_identifiers %}
3439
{% if other_identifiers %}
3540
<p>

0 commit comments

Comments
 (0)