Skip to content

Commit

Permalink
Rename details page date label based on status (#700)
Browse files Browse the repository at this point in the history
This makes the label much more clear

<img width="353" alt="Screenshot 2025-01-02 at 6 38 05 PM"
src="https://github.com/user-attachments/assets/8b43dd4d-3407-45e8-99f3-5759fe0272b3"
/>
<img width="487" alt="Screenshot 2025-01-02 at 6 38 40 PM"
src="https://github.com/user-attachments/assets/ac4fee9a-b362-49ea-96d2-937cfae81baa"
/>
  • Loading branch information
Eric-Arellano authored Jan 2, 2025
1 parent 56baa83 commit 12910a3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions eleventy.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ import { escapePlaceId } from "./src/js/data.js";
function processPolicyRecord(policy: ProcessedCompletePolicy): object {
return {
summary: policy.summary,
dateLabel:
{
adopted: "Adoption date",
proposed: "Proposal date",
repealed: "Repeal date",
}[policy.status] ?? "Reform date",
date: policy.date?.format(),
status: capitalize(policy.status),
scope: policy.scope.map(capitalize),
Expand Down
2 changes: 1 addition & 1 deletion scripts/11ty/_includes/policy-record-body.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<dt>Status</dt>
<dd>{{ record.status }}</dd>
{% if record.date -%}
<dt>Reform date</dt>
<dt>{{ record.dateLabel }}</dt>
<dd>{{ record.date }}</dd>
{%- endif %}
<dt>Scope</dt>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ <h2>Parking minimum removal</h2>
<dl>
<dt>Status</dt>
<dd>Adopted</dd>
<dt>Reform date</dt>
<dt>Adoption date</dt>
<dd>Jul 19, 2021</dd>
<dt>Scope</dt>
<dd>Citywide</dd>
Expand Down

0 comments on commit 12910a3

Please sign in to comment.