diff --git a/app/components/polls/callout_component.html.erb b/app/components/polls/callout_component.html.erb index 62b7616bb..a47306b89 100644 --- a/app/components/polls/callout_component.html.erb +++ b/app/components/polls/callout_component.html.erb @@ -1,4 +1,14 @@ -<% unless can?(:answer, poll) %> +<% if can?(:answer, poll) %> + <% if poll.voted_in_booth?(current_user) %> +
+ <%= t("polls.show.already_voted_in_booth") %> +
+ <% elsif poll.voted_in_web?(current_user) %> +
+ <%= t("polls.show.already_voted_in_web") %> +
+ <% end %> +<% else %> <% if current_user.nil? %>
<%= sanitize(t("polls.show.cant_answer_not_logged_in", diff --git a/app/views/polls/show.html.erb b/app/views/polls/show.html.erb index e63ccec50..0836560d3 100644 --- a/app/views/polls/show.html.erb +++ b/app/views/polls/show.html.erb @@ -17,20 +17,6 @@
<%= render Polls::CalloutComponent.new(@poll) %> - - <% if @poll.voted_in_booth?(current_user) %> -
- <%= t("polls.show.already_voted_in_booth") %> -
- <% else %> - - <% if current_user && @poll.voted_in_web?(current_user) && !@poll.expired? %> -
- <%= t("polls.show.already_voted_in_web") %> -
- <% end %> - <% end %> - <%= render Polls::FormComponent.new(@web_vote) %>