diff --git a/chicago/static/css/custom.css b/chicago/static/css/custom.css index d0de011..99e1a16 100644 --- a/chicago/static/css/custom.css +++ b/chicago/static/css/custom.css @@ -523,6 +523,48 @@ fieldset[disabled] .form-control { background-color: #fff; } +@media only screen and (max-width: 768px) { + /* Force table to not be like tables anymore */ + table.rows-and-columns, + .rows-and-columns thead, + .rows-and-columns tbody, + .rows-and-columns th, + .rows-and-columns td, + .rows-and-columns tr { + display: block; + } + + /* Hide table headers (but not display: none;, for accessibility) */ + .rows-and-columns thead tr { + position: absolute; + top: -9999px; + left: -9999px; + } + + .rows-and-columns tbody tr { + border: 1px solid #ccc; + margin-bottom: 1em; + padding: 0.2rem; + } + + .rows-and-columns tbody > tr > td { + /* remove default table border */ + border: none; + background-color: #fbfbfb; + } + + .rows-and-columns tbody > tr > td ~ td { + /* add a top border to all elements but the first one */ + border-top: 1px solid #ccc; + } +} + +.small-table-header { + font-size: 0.8em; + font-weight: 900; + color: #777; +} + /* medium screens */ @media only screen and (max-width: 767px) { .navbar-brand { diff --git a/chicago/templates/event.html b/chicago/templates/event.html index 3632ec0..bc0df42 100644 --- a/chicago/templates/event.html +++ b/chicago/templates/event.html @@ -24,15 +24,21 @@

{%if event.status == 'cancelled'%}CANCELLED: {% endif %}{{event.name}}

{% if event.video_vimeo_id %} - -

View on Vimeo

+
+
+
+ +
+

View on Vimeo

+
+
{% endif %}
{% if event.agenda.all %}

Agenda: {{event.agenda.all|length}} items

- +
@@ -45,15 +51,23 @@

Agenda: {{event.agenda.all|length}} items

{% for agenda_item in event.agenda.all %} {% if agenda_item.description|lower != 'page break' %} - - + + {% if agenda_item.bills %}
#
{{ forloop.counter }}{{agenda_item.description}} + # + {{ forloop.counter }} + + Description + {{agenda_item.description}} + + ID {{ agenda_item.bills.0.bill.councilmatic_bill.friendly_name }} + Sponsor(s) {% for s in agenda_item.bills.0.bill.sponsors %} {{ s.person.councilmatic_person.link_html | safe }}{% if not forloop.last %},{% endif %} {% endfor %} @@ -70,7 +84,7 @@

Agenda: {{event.agenda.all|length}} items

{% endif %} - {% if event.status == 'passed' or event.status == 'confirmed' %} + {% if event.status == 'passed' %} {% if attendance_taken %}

Alder Attendance: {{attendance_present}} Present, {{attendance_absent}} Absent

diff --git a/chicago/templates/legislation.html b/chicago/templates/legislation.html index b3ee32e..01d0a25 100644 --- a/chicago/templates/legislation.html +++ b/chicago/templates/legislation.html @@ -110,7 +110,7 @@

Sponsors

{% if legislation.actions %}

History

-
+
@@ -122,19 +122,22 @@

History

{% for action in legislation.actions.all %}
Date
+ Date {{action.date}} + Legislative body {{action.organization.name}} + Action {{action.description | remove_action_subj}} {% if action.vote.counts.all|length > 0 %} {% if action.vote.motion_text %}

{{action.vote.motion_text}}

{% endif %} - +
@@ -145,6 +148,7 @@

History

Votes for
+ Votes for {% for vote in action.vote.counts.all %} {% if vote.option == 'yes' %} {{vote.option|capfirst}}: {{vote.value}}
@@ -165,6 +169,7 @@

History

+ Votes against {% for vote in action.vote.counts.all %} {% if vote.option == 'no' %} {{vote.option|capfirst}}: {{vote.value}}
@@ -185,6 +190,7 @@

History

+ Other votes {% for vote in action.vote.counts.all %} {% if vote.option != 'yes' and vote.option != 'no' %} {{vote.option|capfirst}}: {{vote.value}}
diff --git a/chicago/templatetags/chicago_extras.py b/chicago/templatetags/chicago_extras.py index 6da16f8..e9ff7ff 100644 --- a/chicago/templatetags/chicago_extras.py +++ b/chicago/templatetags/chicago_extras.py @@ -1,4 +1,5 @@ from django import template +from django.core.exceptions import ObjectDoesNotExist from councilmatic.settings import ALDER_EXTRAS, CITY_VOCAB register = template.Library() @@ -16,10 +17,12 @@ def get_person_headshot(person): @register.filter def get_legistar_link(object): - for source in object.sources.all(): + try: + source = object.sources.get(note="web") return f" View on the {CITY_VOCAB['SOURCE']} website" # noqa - return "" + except ObjectDoesNotExist: + return "" @register.filter