adding website

This commit is contained in:
2026-04-28 22:50:53 -04:00
parent e75c077e16
commit 72eb2d8c3d
19 changed files with 3376 additions and 0 deletions
@@ -0,0 +1,30 @@
<section class="chart-card">
<header>
<h2>Score history{% if selected_issue_label %} — {{ selected_issue_label }}{% endif %}</h2>
<a href="{{ build_url(request, compare=[]) }}"
hx-get="/partials/dashboard{{ build_url(request, compare=[])|replace('/', '', 1) }}"
hx-target="#dashboard-body"
hx-push-url="{{ build_url(request, compare=[]) }}">Clear comparison</a>
</header>
<div class="chart-frame">
{{ chart_svg | safe }}
</div>
{% if chart_series %}
<div class="chart-legend" aria-label="Chart legend">
{% for item in chart_series %}
{% set style_index = loop.index0 % 4 %}
<div class="chart-legend-row">
<span class="chart-legend-line line-{{ style_index }}"></span>
<span class="chart-legend-marker marker-{{ style_index }}"></span>
<div class="chart-legend-copy">
<span class="chart-legend-label">{{ item.label }}</span>
<span class="chart-legend-meta">
{% if item.party %}{{ item.party }}{% endif %}{% if item.party and item.state %} · {% endif %}{% if item.state %}{{ item.state }}{% endif %}
</span>
</div>
</div>
{% endfor %}
</div>
{% endif %}
<p class="score-note">Scores reflect averaged precomputed topic rows per year. Sparse years are omitted rather than plotted as zero.</p>
</section>
@@ -0,0 +1,25 @@
<section class="controls-grid">
{% include "partials/_issue_filters.html" %}
<div class="chamber-card">
<a class="segment {{ 'active' if chamber == 'house' else '' }}"
href="{{ build_url(request, chamber='house') }}"
hx-get="/partials/dashboard{{ build_url(request, chamber='house')|replace('/', '', 1) }}"
hx-target="#dashboard-body"
hx-push-url="{{ build_url(request, chamber='house') }}">House</a>
<a class="segment {{ 'active' if chamber == 'senate' else '' }}"
href="{{ build_url(request, chamber='senate') }}"
hx-get="/partials/dashboard{{ build_url(request, chamber='senate')|replace('/', '', 1) }}"
hx-target="#dashboard-body"
hx-push-url="{{ build_url(request, chamber='senate') }}">Senate</a>
<a class="segment {{ 'active' if chamber == 'all' else '' }}"
href="{{ build_url(request, chamber='all') }}"
hx-get="/partials/dashboard{{ build_url(request, chamber='all')|replace('/', '', 1) }}"
hx-target="#dashboard-body"
hx-push-url="{{ build_url(request, chamber='all') }}">All</a>
</div>
</section>
<p class="score-note">Support score: 1-100 precomputed from bill topic stance and roll-call votes. Higher means more aligned with the topic.</p>
{% include "partials/_rankings.html" %}
{% include "partials/_chart.html" %}
@@ -0,0 +1,46 @@
<section class="filter-card">
<h2>Issue filters</h2>
<form class="issue-form"
method="get"
action="/"
hx-get="/"
hx-target="#dashboard-body"
hx-push-url="true">
<input type="hidden" name="chamber" value="{{ chamber }}">
{% if congress %}
<input type="hidden" name="congress" value="{{ congress }}">
{% endif %}
{% for legislator_id in compare %}
<input type="hidden" name="compare" value="{{ legislator_id }}">
{% endfor %}
{% for issue in issues %}
<span class="chip">
{{ issue }}
<a href="{{ build_url(request, issues=issues[:loop.index0] + issues[loop.index:]) }}"
hx-get="/partials/dashboard{{ build_url(request, issues=issues[:loop.index0] + issues[loop.index:])|replace('/', '', 1) }}"
hx-target="#dashboard-body"
hx-push-url="{{ build_url(request, issues=issues[:loop.index0] + issues[loop.index:]) }}"
aria-label="Remove {{ issue }}">×</a>
</span>
<input type="hidden" name="issues" value="{{ issue }}">
{% endfor %}
<label class="search-box">
<span class="sr-only">Search issue areas</span>
<input type="search" name="issues" placeholder="Search issue areas" autocomplete="off">
</label>
<button type="submit">Apply</button>
</form>
{% if suggestions %}
<div class="suggestions" aria-label="Issue suggestions">
{% for suggestion in suggestions %}
{% if suggestion not in issues %}
<a href="{{ build_url(request, issues=issues + [suggestion]) }}"
hx-get="/partials/dashboard{{ build_url(request, issues=issues + [suggestion])|replace('/', '', 1) }}"
hx-target="#dashboard-body"
hx-push-url="{{ build_url(request, issues=issues + [suggestion]) }}">{{ suggestion }}</a>
{% endif %}
{% endfor %}
</div>
{% endif %}
</section>
@@ -0,0 +1,11 @@
{% if matches %}
<div class="result-chips" aria-label="Search suggestions">
{% for option in matches %}
<a href="{{ build_legislator_url(legislator_id=option.legislator_id) }}">
{{ option.display_name }}{% if option.state %} · {{ option.state }}{% endif %}
</a>
{% endfor %}
</div>
{% elif q %}
<p class="suggestion-empty">No matches</p>
{% endif %}
@@ -0,0 +1,61 @@
<section class="rankings-grid">
<article class="ranking-card">
<header>
<h2>Most supportive</h2>
<span>Top 10</span>
</header>
{% if rankings.supportive %}
<ol class="ranking-list">
{% for row in rankings.supportive %}
{% set next_compare = toggle_compare(compare, row.legislator_id) %}
<li class="{{ 'selected' if row.legislator_id in compare else '' }}">
<a href="{{ build_url(request, compare=next_compare) }}"
hx-get="/partials/dashboard{{ build_url(request, compare=next_compare)|replace('/', '', 1) }}"
hx-target="#dashboard-body"
hx-push-url="{{ build_url(request, compare=next_compare) }}">
<span class="rank">{{ loop.index }}</span>
<strong class="score positive">{{ row.score|round(1) }}</strong>
<span class="member">
<strong>{{ row.display_name }}</strong>
<small>{{ row.state or "US" }}{% if row.party %} · {{ row.party[:1] }}{% endif %}</small>
</span>
<span class="votes">{{ row.total }} rows</span>
</a>
</li>
{% endfor %}
</ol>
{% else %}
<p class="empty-state">{{ empty_message }}</p>
{% endif %}
</article>
<article class="ranking-card">
<header>
<h2>Most opposed</h2>
<span>Bottom 10</span>
</header>
{% if rankings.opposed %}
<ol class="ranking-list">
{% for row in rankings.opposed %}
{% set next_compare = toggle_compare(compare, row.legislator_id) %}
<li class="{{ 'selected' if row.legislator_id in compare else '' }}">
<a href="{{ build_url(request, compare=next_compare) }}"
hx-get="/partials/dashboard{{ build_url(request, compare=next_compare)|replace('/', '', 1) }}"
hx-target="#dashboard-body"
hx-push-url="{{ build_url(request, compare=next_compare) }}">
<span class="rank">{{ loop.index }}</span>
<strong class="score negative">{{ row.score|round(1) }}</strong>
<span class="member">
<strong>{{ row.display_name }}</strong>
<small>{{ row.state or "US" }}{% if row.party %} · {{ row.party[:1] }}{% endif %}</small>
</span>
<span class="votes">{{ row.total }} rows</span>
</a>
</li>
{% endfor %}
</ol>
{% else %}
<p class="empty-state">{{ empty_message }}</p>
{% endif %}
</article>
</section>