Skip to content

Display vote creator and authz clear#83

Merged
gstein merged 1 commit intotrunkfrom
display
Feb 28, 2026
Merged

Display vote creator and authz clear#83
gstein merged 1 commit intotrunkfrom
display

Conversation

@tisonkun
Copy link
Member

@tisonkun tisonkun commented Feb 28, 2026

This closes #82.

Signed-off-by: tison <wander4096@gmail.com>
@tisonkun tisonkun requested review from Copilot and gstein February 28, 2026 03:31
@gstein gstein merged commit f0b7234 into trunk Feb 28, 2026
3 of 4 checks passed
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the voter.ezt template to improve how vote creator and authorization information is displayed in election cards. The authz ("who can vote") label is moved to its own prominently positioned <span> at the start of the card footer, and the creator info is consolidated into a single span that now always includes the election ID (eid).

Changes:

  • The authz info is moved to a dedicated <span> rendered before the creator info in each card footer, formatted as "[authz] can vote".
  • The creator name, PID, and eid are merged into one <span> instead of being split across two.
  • These changes are applied consistently across open, upcoming, and past election sections.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +81 to 88
[if-any open_elections.authz]
<span>[open_elections.authz] can vote</span>
[end]
<span class="text-muted" style="font-size: 0.8em;">
Created By [open_elections.owner_name]
<span class="text-muted" style="font-size: 0.8em;">([open_elections.owner_pid])</span>
[if-any open_elections.authz]
&nbsp;&middot;&nbsp; [open_elections.authz]
[end]
&nbsp;&middot;&nbsp; eid: [open_elections.eid]
</span>
Copy link

Copilot AI Feb 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The card-footer uses d-flex justify-content-between align-items-center, which distributes space between its direct children. In the new layout, when authz is absent the [if-any open_elections.authz] block produces no DOM element, leaving only the single creator <span> as a child. With only one flex child, justify-content-between has no effect and the creator info will be left-aligned instead of pushed to the right edge of the footer. The original code always had two <span> elements (owner info on the left, eid on the right), so the footer's layout was always well-defined.

To preserve the intended two-column flex layout, consider always rendering the left slot (e.g., an empty <span> when authz is absent, or unconditionally rendering a <span> that is just empty when authz is not set), so there are always two flex children for justify-content-between to act on. This same issue applies to the upcoming_elections and past_elections sections as well (lines 133–140 and 173–180).

Copilot uses AI. Check for mistakes.
<span>[open_elections.authz] can vote</span>
[end]
<span class="text-muted" style="font-size: 0.8em;">
Created By [open_elections.owner_name]
Copy link

Copilot AI Feb 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The text "Created By" uses title-case mid-sentence; "By" should be lowercase: "Created by". The same issue exists in the upcoming_elections section (line 137) and past_elections section (line 177).

Copilot uses AI. Check for mistakes.
<span>
[past_elections.owner_name]
[if-any past_elections.authz]
<span>[past_elections.authz] can vote</span>
Copy link

Copilot AI Feb 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The authz span "[past_elections.authz] can vote" is shown on past elections (lines 173–175). Since past elections are already closed, displaying "can vote" is misleading — there is no voting action available on a past election. Consider suppressing the authz display for past elections, or changing the label (e.g., "could vote") if it is meant to be informational.

Suggested change
<span>[past_elections.authz] can vote</span>
<span>[past_elections.authz] could vote</span>

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

V3: confusing banner text under "Vote Now" button

3 participants