Close votes automatically after 7 days

Closes #1
This commit is contained in:
ricola 2025-06-08 15:57:26 -06:00
parent cac94c2379
commit e474a9a8ea
14 changed files with 283 additions and 97 deletions

28
views/votes_open.erb Normal file
View file

@ -0,0 +1,28 @@
<h1><%= _("Open vote") %></h1>
<p><%= _("Closing date: #{format_date(@expire_on)}") %></p>
<p><%= _("The vote will automatically close on that date and the results will
be sent to all users by email.") %></p>
<p><%= _("You won't be able to modify or delete this vote anymore after
opening it.") %></p>
<form action="/votes/<%= @vote.secure_id %>/open" method="post">
<button type="submit"><%= _("Open vote to participants") %></button>
</form>
<form action="/votes/<%= @vote.secure_id %>" method="get">
<button type="submit"><%= _("Cancel") %></button>
</form>
<h2><%= @vote.title %></h2>
<p><%= @vote.description %></p>
<h2><%= _("Candidates") %></h2>
<% @vote.candidates.each do |candidate| %>
<h3><%= candidate.name %></h3>
<p><%= candidate.description %></p>
<% end %>