Files
grecia/app/components/polls/callout_component.html.erb
Javi Martín 7ea4f63b07 Allow blank votes in polls via web
With the old interface, there wasn't a clear way to send a blank ballot.
But now that we've got a form, there's an easy way: clicking on "Vote"
while leaving the form blank.
2025-08-14 13:06:43 +02:00

22 lines
713 B
Plaintext

<% if can?(:answer, poll) %>
<% if voted_in_booth? %>
<%= callout(t("polls.show.already_voted_in_booth")) %>
<% elsif voted_in_web? %>
<% if voted_blank? %>
<%= callout(t("polls.show.already_voted_blank_in_web")) %>
<% else %>
<%= callout(t("polls.show.already_voted_in_web")) %>
<% end %>
<% end %>
<% else %>
<% if current_user.nil? %>
<%= callout(not_logged_in_text, html_class: "primary") %>
<% elsif current_user.unverified? %>
<%= callout(unverified_text) %>
<% elsif poll.expired? %>
<%= callout(t("polls.show.cant_answer_expired"), html_class: "alert") %>
<% else %>
<%= callout(t("polls.show.cant_answer_wrong_geozone")) %>
<% end %>
<% end %>