<%= @vote.title %>

<%= markdown(@vote.description) %>

<%= _("Candidates") %>

<% if @errors %> <% @errors.each do |error| %> <% if error.attribute == :rating and error.type == :blank %>

<%= _("Missing rating for candidate %{name}.") % { name: error.candidate.name } %>

<% end %> <% end %> <% end %>
<% @vote.candidates.each do |candidate| %>

<%= candidate.name %>

<%= markdown(candidate.description) %> <% rating = @vote.ratings.find { |rating| rating.user == current_user and rating.candidate == candidate } %> <% if rating value = rating.value elsif @params[candidate.id.to_s] value = params[candidate.id.to_s].to_i else value = 0 end %>
<% settings.values.reverse.each do |v| %> checked<% end %>> <% end %>
<% end %>

<%= _("Participants") %>

<% if @vote.users.exists?(current_user.id) and @vote.expire_on.nil? %>
<% end %> <% unless @vote.organizers.blank? %>

<%= _("Organizers") %>

<% end %> <% if @vote.users.exists?(current_user.id) or @vote.expire_on.nil? %>

<%= _("Add organizer") %>

<% end %>