Skip to content

Commit

Permalink
add a lil section for other bills with the same number
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelmulley committed Feb 28, 2025
1 parent 45cecda commit 889bb61
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
3 changes: 2 additions & 1 deletion parliament/bills/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ def get_html(self, request, session_id, bill_number):
'title': ('Bill %s' % bill.number) + (' (Historical)' if bill.session.end else ''),
'statements_full_date': True,
'statements_context_link': tab == 'mentions',
'similar_bills': bill.similar_bills.all().order_by('-introduced')
'similar_bills': bill.similar_bills.all().order_by('-session_id', '-introduced')[:8],
'same_number_bills': Bill.objects.filter(number=bill.number).exclude(id=bill.id).order_by('-session_id')[:6],
}

if tab == 'mentions':
Expand Down
14 changes: 13 additions & 1 deletion parliament/templates/bills/bill_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,19 @@ <h2>Summary</h2>
{% if bill.name %}
<div class="row">
<div class="context-col"><h2>Elsewhere</h2></div>
<div class="main-col"><p>All sorts of information on this bill is available at <a href="{{ bill.legisinfo_url }}">LEGISinfo</a>, an excellent resource from the Library of Parliament.{% if bill.text_docid %} You can also read the <a href="{{ bill.get_billtext_url }}">full text of the bill</a>.{% endif %}</p></div>
<div class="main-col"><p>All sorts of information on this bill is available at <a href="{{ bill.legisinfo_url }}">LEGISinfo</a>, an excellent resource from Parliament.{% if bill.text_docid %} You can also read the <a href="{{ bill.get_billtext_url }}">full text of the bill</a>.{% endif %}</p>
{% if same_number_bills %}<p>Bill numbers are reused for different bills each new session. Perhaps you were looking for one of these other {{ bill.number }}s:</p>
<div class="row tile small-up-1 medium-up-2">
{% for same_number_bill in same_number_bills %}{% if same_number_bill not in similar_bills %}
<div class="column column-block threeline overflowtip">
<a href="{{ same_number_bill.get_absolute_url }}">{{ same_number_bill.number }} ({% if same_number_bill.introduced %}{{ same_number_bill.introduced.year }}{% else %}{{ same_number_bill.session.start.year }}{% endif %})</a>
{% if same_number_bill.law %}<span class="tag bill_law">Law</span>{% endif %}
{% if same_number_bill.short_title %}{{ same_number_bill.short_title }}{% else %}{{ same_number_bill.name }}{% endif %}
</div>
{% endif %}{% endfor %}
</div>
{% endif %}
</div>
</div>
{% endif %}

Expand Down

0 comments on commit 889bb61

Please sign in to comment.