<%= @vote.title %>

<%= @vote.description %>

<%= _("All ratings") %>

<% @vote.candidates.each do |candidate| %> <% end %> <% @vote.ratings.collect { |rating| rating.user }.uniq.each do |user| %> <% @vote.candidates.each do |candidate| %> <% if rating = @vote.ratings.find { |rating| rating.user == user and rating.candidate == candidate } %> <% value = settings.values.select { |e| e[:id] == rating.value }.first %> <% end %> <% end %> <% end %>
<%= _("Participant") %><%= candidate.name %>
<%= user.email %><%= value[:label] %>

<%= _("Results") %>

<% i = 0 %> <% @vote.candidates.sort { |a, b| a.mj <=> b.mj }.reverse.each do |candidate| %> <% i = i + 1 %> <% value = settings.values.select { |e| e[:id] == candidate.mj.mj }.first %> <% end %>
<%= _("Rank") %> <%= _("Candidate") %> <%= _("Majority Judgment") %> <%= _("Proponents") %> <%= _("Opponents") %>
<%= i %> <%= candidate.name %><%= value[:label] %> <%= candidate.mj.proponents %> <%= candidate.mj.opponents %>
<% data = [] colors = [] settings.values.reverse.each do |v| d = { name: v[:label], data: [] } @vote.candidates.each do |c| d[:data] << [c.name, c.mj.count[v[:id]]] end data << d colors << v[:color] end %> <%= bar_chart data, colors: colors, stacked: true, legend: 'bottom' %>

<%= _("Organizers") %>

<% if @vote.users.exists?(current_user.id) %>

<%= _("Actions for organizers") %>

<%= _("Add") %>

<% end %>