diff --git a/chicago/models.py b/chicago/models.py index 0dcadab..e7b5f7d 100644 --- a/chicago/models.py +++ b/chicago/models.py @@ -4,6 +4,7 @@ import pytz from councilmatic_core.models import Bill, Event, Organization, Person +from chicago.utils import get_alder_extras from dateutil.relativedelta import relativedelta from django.conf import settings from django.db import models @@ -236,24 +237,28 @@ def legislation_count(self): sponsorships__person=self, sponsorships__primary=True ).count() - @property - def election_status(self): - for p in settings.ALDER_EXTRAS: - if ( - self.slug.startswith(p) - and "election-status" in settings.ALDER_EXTRAS[p] - ): - return settings.ALDER_EXTRAS[p]["election-status"] + def extra_props(self, key): + extra = get_alder_extras(self.slug) + if extra and key in extra: + return extra[key] return "" @property def caucus(self): - for p in settings.ALDER_EXTRAS: - if self.slug.startswith(p) and "caucus" in settings.ALDER_EXTRAS[p]: - return settings.ALDER_EXTRAS[p]["caucus"] + return self.extra_props("caucus") - return "" + @property + def candidate_id(self): + return self.extra_props("candidate_id") + + @property + def manual_headshot(self): + image_path = self.extra_props("image") + if image_path: + return f"/static/images/manual-headshots/{image_path}" # noqa + + return "/static/images/headshot_placeholder.png" @property def term_active(self): diff --git a/chicago/settings.py b/chicago/settings.py index 4b7d246..1596711 100644 --- a/chicago/settings.py +++ b/chicago/settings.py @@ -30,7 +30,7 @@ sentry_sdk.init( dsn=os.environ["SENTRY_DSN"], integrations=[DjangoIntegration()], - release=f"{os.environ['HEROKU_RELEASE_VERSION']}-{os.environ['HEROKU_APP_NAME']}", + release=f"{os.environ['HEROKU_RELEASE_VERSION']}-{os.environ['HEROKU_APP_NAME']}", # noqa enable_tracing=True, traces_sample_rate=0.05, ) @@ -326,210 +326,6 @@ "valencia-anna-m-257a68ccbc17": "City Clerk", } -ALDER_EXTRAS = { - "abarca-anabel": {"image": "abarca-anabel.jpg"}, - "arena-john": {"image": "arena-john.jpg"}, - "austin-carrie-m": { - "image": "austin-carrie-m.jpg", - "election-status": "Indicted, Retiring", - "caucus": "Black Caucus", - }, - "beale-anthony": {"image": "beale-anthony.jpg", "caucus": "Black Caucus"}, - "brookins-jr-howard": { - "image": "brookins-jr-howard.jpg", - "caucus": "Black Caucus", - "election-status": "Retiring", - }, - "burke-edward-m": { - "image": "burke-edward-m.jpg", - "election-status": "Indicted, Retiring", - }, - "burnett-jr-walter": {"image": "burnett-jr-walter.jpg", "caucus": "Black Caucus"}, - "burns-william-d": {"image": "burns-william-d.jpg"}, - "cappleman-james": { - "image": "cappleman-james.jpg", - "election-status": "Retiring", - "caucus": "LGBT Caucus", - }, - "cardenas-george-a": {"image": "cardenas-george-a.jpg", "caucus": "Latino Caucus"}, - "cardona-jr-felix": { - "image": "cardona-jr-felix.jpg", - "caucus": "Latino Caucus", - }, - "cochran-willie": {"image": "cochran-willie.jpg"}, - "coleman-stephanie-d": { - "image": "coleman-stephanie-d.jpg", - "caucus": "Black Caucus", - }, - "curtis-derrick-g": {"image": "curtis-derrick-g.jpg", "caucus": "Black Caucus"}, - "dowell-pat": {"image": "dowell-pat.jpg", "caucus": "Black Caucus"}, - "emanuel-rahm": {"image": "emanuel-rahm.jpg"}, - "ervin-jason-c": {"image": "ervin-jason-c.jpg", "caucus": "Black Caucus"}, - "foulkes-toni": {"image": "foulkes-toni.jpg"}, - "gardiner-james-m": {"image": "gardiner-james-m.jpg"}, - "hadden-maria-e": { - "image": "hadden-maria-e.jpg", - "caucus": "Black Caucus, Progressive Caucus, LGBT Caucus", - }, - "hairston-leslie-a": { - "image": "hairston-leslie-a.jpg", - "election-status": "Retiring", - "caucus": "Black Caucus, Progressive Caucus", - }, - "harris-michelle-a": {"image": "harris-michelle-a.jpg", "caucus": "Black Caucus"}, - "hopkins-brian": {"image": "hopkins-brian.jpg"}, - "king-sophia": { - "image": "king-sophia.jpg", - "election-status": "Running for Mayor, not seeking re-election", - "caucus": "Black Caucus, Progressive Caucus", - }, - "knudsen-timothy-r": {"image": "knudsen-timothy-r.jpg", "caucus": "LGBT Caucus"}, - "la-spata-daniel": { - "image": "la-spata-daniel.jpg", - "caucus": "Democratic Socialist, Latino Caucus, Progressive Caucus", - }, - "laurino-margaret": {"image": "laurino-margaret.jpg"}, - "lee-nicole-t": {"image": "lee-nicole-t.jpg"}, - "lopez-raymond-a": {"image": "lopez-raymond-a.jpg", "caucus": "LGBT Caucus"}, - "lightfoot-lori-e": {"image": "lightfoot-lori-e.jpg"}, - "maldonado-roberto": { - "image": "maldonado-roberto.jpg", - "election-status": "Retiring", - "caucus": "Latino Caucus", - }, - "martin-matthew-j": { - "image": "martin-matthew-j.jpg", - "caucus": "Black Caucus, Progressive Caucus", - }, - "mell-deborah": {"image": "mell-deborah.jpg"}, - "mendoza-susana-a": {"image": "mendoza-susana-a.jpg"}, - "mitchell-gregory-i": {"image": "mitchell-gregory-i.jpg", "caucus": "Black Caucus"}, - "mitts-emma": {"image": "mitts-emma.jpg", "caucus": "Black Caucus"}, - "moore-david-h": { - "image": "moore-david-h.jpg", - "caucus": "Black Caucus", - }, - "moore-joseph": {"image": "moore-joseph.jpg"}, - "moreno-proco-joe": {"image": "moreno-proco-joe.jpg"}, - "munoz-ricardo": {"image": "munoz-ricardo.jpg"}, - "napolitano-anthony-v": {"image": "napolitano-anthony-v.jpg"}, - "nugent-samantha": {"image": "nugent-samantha.jpg"}, - "oconnor-patrick": {"image": "oconnor-patrick.jpg"}, - "oshea-matthew-j": {"image": "oshea-matthew-j.jpg"}, - "osterman-harry": {"image": "osterman-harry.jpg", "election-status": "Retiring"}, - "pawar-ameya": {"image": "pawar-ameya.jpg"}, - "quinn-marty": {"image": "quinn-marty.jpg"}, - "ramirez-rosa-carlos": { - "image": "ramirez-rosa-carlos.jpg", - "caucus": "Democratic Socialist, Latino Caucus, Progressive Caucus, LGBT Caucus", # noqa - }, - "reboyras-ariel": { - "image": "reboyras-ariel.jpg", - "caucus": "Latino Caucus", - "election-status": "Retiring", - }, - "reilly-brendan": {"image": "reilly-brendan.jpg"}, - "rodriguez-michael-d": { - "image": "rodriguez-michael-d.jpg", - "caucus": "Latino Caucus, Progressive Caucus", - }, - "rodriguez-sanchez-rossana": { - "image": "rodriguez-sanchez-rossana.jpg", - "caucus": "Democratic Socialist, Latino Caucus, Progressive Caucus", - }, - "sadlowski-garza-susan": { - "image": "sadlowski-garza-susan.jpg", - "election-status": "Retiring", - "caucus": "Latino Caucus, Progressive Caucus", - }, - "santiago-milagros-s": {"image": "santiago-milagros-s.jpg"}, - "sawyer-roderick-t": { - "image": "sawyer-roderick-t.jpg", - "election-status": "Running for Mayor, not seeking re-election", - "caucus": "Black Caucus, Progressive Caucus", - }, - "scott-jr-michael": {"image": "scott-jr-michael.jpg", "caucus": "Black Caucus"}, - "scott-monique-l": {"image": "scott-monique-l.jpg", "caucus": "Black Caucus"}, - "sigcho-lopez-byron": { - "image": "sigcho-lopez-byron.jpg", - "caucus": "Democratic Socialist, Latino Caucus, Progressive Caucus", - }, - "silverstein-debra-l": {"image": "silverstein-debra-l.jpg"}, - "smith-michele": {"image": "smith-michele.jpg", "election-status": "Retiring"}, - "solis-daniel": {"image": "solis-daniel.jpg"}, - "sposato-nicholas": {"image": "sposato-nicholas.png"}, - "tabares-silvana": {"image": "tabares-silvana.jpg", "caucus": "Latino Caucus"}, - "taliaferro-chris": { - "image": "taliaferro-chris.jpg", - "caucus": "Black Caucus", - }, - "taylor-jeanette-b": { - "image": "taylor-jeanette-b.jpg", - "caucus": "Black Caucus, Democratic Socialist, Progressive Caucus", - }, - "thompson-patrick-d": {"image": "thompson-patrick-d.jpg"}, - "tunney-thomas": { - "image": "tunney-thomas.jpg", - "election-status": "Retiring", - "caucus": "LGBT Caucus", - }, - "valencia-anna-m": {"image": "valencia-anna-m.jpg"}, - "vasquez-jr-andre": { - "image": "vasquez-jr-andre.jpg", - "caucus": "Latino Caucus, Progressive Caucus", - }, - "villegas-gilbert": {"image": "villegas-gilbert.jpg", "caucus": "Latino Caucus"}, - "waguespack-scott": { - "image": "waguespack-scott.jpg", - "caucus": "", - }, - "zalewski-michael-r": {"image": "zalewski-michael-r.jpg"}, - "yancy-desmon-c": { - "image": "yancy-desmon-c.jpg", - "caucus": "Black Caucus, Progressive Caucus", - }, - "robinson-lamont": { - "image": "robinson-lamont.jpg", - "caucus": "Black Caucus", - }, - "ramirez-julia-m": { - "image": "ramirez-julia-m.jpg", - "caucus": "Latino Caucus, Progressive Caucus", - }, - "mosley-ronnie-l": { - "image": "mosley-ronnie-l.jpg", - "caucus": "Black Caucus", - }, - "manaa-hoppenworth-leni": {"image": "manaa-hoppenworth-leni.jpg"}, - "lawson-bennett-r": {"image": "lawson-bennett-r.jpg"}, - "hall-william-e": { - "image": "hall-william-e.jpg", - "caucus": "Black Caucus", - }, - "gutierrez-jeylu-b": { - "image": "gutierrez-jeylu-b.jpg", - "caucus": "Latino Caucus, Progressive Caucus", - }, - "fuentes-jessica": { - "image": "fuentes-jessica.jpg", - "caucus": "Latino Caucus, Progressive Caucus", - }, - "cruz-ruth": { - "image": "cruz-ruth.jpg", - "caucus": "Latino Caucus, Progressive Caucus", - }, - "conway-william": {"image": "conway-william.jpg"}, - "clay-angela": { - "image": "clay-angela.jpg", - "caucus": "Progressive Caucus", - }, - "chico-peter": { - "image": "chico-peter.jpg", - "caucus": "Latino Caucus", - }, - "johnson-brandon": {"image": "johnson-brandon.jpg"}, -} - TOPIC_HIERARCHY = [ { "name": "Citywide matters", diff --git a/chicago/static/css/custom.css b/chicago/static/css/custom.css index 6a9860d..6433b68 100644 --- a/chicago/static/css/custom.css +++ b/chicago/static/css/custom.css @@ -82,6 +82,7 @@ h4 { border-radius: 0px; padding: 12px 10px 12px 10px; color: #3d8a8e; + border-bottom: 8px solid #ffffff; } .nav-pills > li.active > a, .nav-pills > li.active > a:hover, @@ -502,6 +503,10 @@ fieldset[disabled] .form-control { background-color: #fff; } +div.dataTables_wrapper div.dataTables_processing { + background-color: #ffffffbb; +} + @media only screen and (max-width: 768px) { /* Force table to not be like tables anymore */ table.rows-and-columns, diff --git a/chicago/templates/compare_council_members.html b/chicago/templates/compare_council_members.html index 59c3dab..f3bd2b8 100644 --- a/chicago/templates/compare_council_members.html +++ b/chicago/templates/compare_council_members.html @@ -15,7 +15,7 @@
@@ -36,17 +36,31 @@ | + Alder {{ person.link_html | safe }} | -{{ person.latest_council_membership.post.label }} | -{{ person.years_in_office }} | + Ward + {{ person.latest_council_membership.post.label }} + | ++ Years in office + {{ person.years_in_office }} + | ++ Non-routine bills sponsored {{ person.statistics.legislation_count }} bills | -{{ person.statistics.attendance_percent }} | -{{ person.caucus }} | ++ Attendance (this session) + {{ person.statistics.attendance_percent }} + | ++ Caucus + {{ person.caucus }} + | |
---|---|---|---|---|---|---|---|---|---|---|---|
-
+
|
{{p.attendee.name}} | diff --git a/chicago/templates/partials/committee_person_table.html b/chicago/templates/partials/committee_person_table.html index 8b51705..24e490c 100644 --- a/chicago/templates/partials/committee_person_table.html +++ b/chicago/templates/partials/committee_person_table.html @@ -16,7 +16,7 @@||||||||||
-
+
|
@@ -34,7 +34,7 @@ | ||||||||||
-
+
|
@@ -52,7 +52,7 @@ | ||||||||||
-
+
|
diff --git a/chicago/templates/partials/council_member_table.html b/chicago/templates/partials/council_member_table.html index f047f08..60b184e 100644 --- a/chicago/templates/partials/council_member_table.html +++ b/chicago/templates/partials/council_member_table.html @@ -15,7 +15,7 @@ |
{% if post.current_member %}
-
+
{% endif %}
|
diff --git a/chicago/templates/person.html b/chicago/templates/person.html
index cb71be9..4f417a8 100644
--- a/chicago/templates/person.html
+++ b/chicago/templates/person.html
@@ -21,7 +21,7 @@
Commitee Name | +Received Date | +Amount | +Type | +Donor Name | +Occupation | +Employer | +City, State Zip | +Filing | +
---|