From 0b18a29521ec8cb46bf0de21a86ff2f5e7a9da9c Mon Sep 17 00:00:00 2001
From: pikachu0542 <112343747+pikachu0542@users.noreply.github.com>
Date: Mon, 16 Feb 2026 11:16:31 -0500
Subject: [PATCH 1/2] Add feedback for why users cant vote (#74)
* Added alert on results screen for when you already voted
* Added banner alert telling user that they already voted
* Tried to make the alert have vertically centered text
* Fixed vertical centering (thanks noah)
* Added alert for if user is inactive
* Updated alert to account for inactive and gatekept, added alert for db error
* Updated alert to account for inactive and gatekept, added alert for db error
* Added sentence telling people to contact evals or opcomm for more info
---
main.go | 1 +
templates/result.tmpl | 34 ++++++++++++++++++++++++++++++++++
2 files changed, 35 insertions(+)
diff --git a/main.go b/main.go
index a5f1a2a..19eb373 100644
--- a/main.go
+++ b/main.go
@@ -430,6 +430,7 @@ func main() {
"IsOpen": poll.Open,
"IsHidden": poll.Hidden,
"CanModify": canModify,
+ "CanVote": canVote(claims.UserInfo, *poll, poll.AllowedUsers),
"Username": claims.UserInfo.Username,
"FullName": claims.UserInfo.FullName,
"Gatekeep": poll.Gatekeep,
diff --git a/templates/result.tmpl b/templates/result.tmpl
index 9e81f54..5e5e1c2 100644
--- a/templates/result.tmpl
+++ b/templates/result.tmpl
@@ -9,6 +9,12 @@
media="screen"
/>
+
+
+ {{ if eq .CanVote 9 }}
+
+
You have already voted in this poll.
+
+
+ {{ else if eq .CanVote 1 }}
+
+
There was an error checking your voting eligibility. Try refreshing the page or contacting the RTPs if the issue persists.
+
+
+ {{ else if gt .CanVote 1 }}
+
+
+ You are not eligible to vote in this poll. This is likely because you are not an Active Member,
+ or because you did not meet the gatekeep requirements by the time the poll opened.
+ If you believe this is an error, please contact Evals or Opcomm.
+
+
+
+ {{ end }}
+
{{ .ShortDescription }}
{{ if .LongDescription }}
{{ .LongDescription | MakeLinks }}
@@ -38,6 +71,7 @@
Results will be available once the poll closes
{{ else }}
+
{{/* Displays information about required quorum and number of voters */}}
Number of Eligible Voters: {{ len .EligibleVoters }}