diff --git a/views/votes_show_closed.erb b/views/votes_show_closed.erb index 2116d63..caf22e6 100644 --- a/views/votes_show_closed.erb +++ b/views/votes_show_closed.erb @@ -71,91 +71,93 @@ <% end %>

-
- <%= markdown(c.description) %> -
- <% if r > 1 and c.mj.mj == @results.first.mj.mj %> -
-

- <%= _("This candidate and the winning candidate have the same majority judgment.") %> -

-

<%= _("To break the tie, we remove the vote that corresponds to the majority judgment one-by-one until one candidate has a better majority judgment than the other.") %>

-
-
<%= _("Votes for this candidate") %>
-
<%= _("Votes for the winning candidate") %>
-
- - <% n = 0 %> - <% previous = nil %> - <% max = @results.first.mj.n * 2 + 1 %> - <% c.mj.break_tie(@results.first.mj).each do |a, b| %> - - - - - - - - <% (1..a.n).each do |i| %> - - <% end %> - - <% (1..b.n).each do |i| %> - - <% end %> - - - <% i = 0 %> - <% settings.values.reverse.each do |v| %> - <% (1..a.count[v[:id]]).each do |r| %> - <% i = i + 1 %> - - <% end %> - <% end %> - - <% i = 0 %> - <% settings.values.each do |v| %> - <% (1..b.count[v[:id]]).each do |r| %> - <% i = i + 1 %> - - <% end %> - <% end %> - - <% n = n + 1 %> - <% end %> -
- <% if n == 0 %> - <% current = erb :rating_badge, :locals => { :value => settings.values.select { |e| e[:id] == a.mj }.first } %> - <%= _("Without removing any vote, both candidates have the same majority judgement of %{current}.") % { current: current } %> - <% end %> - <% if n == 1 %> - <% if a.mj == b.mj %> - <% current = erb :rating_badge, :locals => { :value => settings.values.select { |e| e[:id] == a.mj }.first } %> - <%= _("Removing a vote of rating %{previous}, both candidates still have the same majority judgement of %{current}.") % { previous: previous, current: current } %> - <% else %> - <% losing = erb :rating_badge, :locals => { :value => settings.values.select { |e| e[:id] == a.mj }.first } %> - <% winning = erb :rating_badge, :locals => { :value => settings.values.select { |e| e[:id] == b.mj }.first } %> - <%= _("Removing a vote of rating %{previous}, this candidate has a majority judgement of %{losing}, but the winning candidate has a majority judgement of %{winning}.") % { previous: previous, losing: losing, winning: winning } %> - <% end %> - <% end %> - <% if n > 1 %> - <% if a.mj == b.mj %> - <% current = erb :rating_badge, :locals => { :value => settings.values.select { |e| e[:id] == a.mj }.first } %> - <%= _("Removing another vote of rating %{previous}, both candidates still have the same majority judgement of %{current}.") % { previous: previous, current: current } %> - <% else %> - <% losing = erb :rating_badge, :locals => { :value => settings.values.select { |e| e[:id] == a.mj }.first } %> - <% winning = erb :rating_badge, :locals => { :value => settings.values.select { |e| e[:id] == b.mj }.first } %> - <%= _("Removing another vote of rating %{previous}, this candidate has a majority judgement of %{losing}, but the winning candidate has a majority judgement of %{winning}.") % { previous: previous, losing: losing, winning: winning } %> - <% end %> - <% end %> - <% previous = erb :rating_badge, :locals => { :value => settings.values.select { |e| e[:id] == a.mj }.first } %> -
  - <% if a.mj < b.mj %><<% end %> - <% if a.mj > b.mj %>><% end %> - <% if a.mj == b.mj %>=<% end %> -  
+
+
+ <%= markdown(c.description) %>
- <% end %> + <% if r > 1 and c.mj.mj == @results.first.mj.mj %> +
+

+ <%= _("This candidate and the winning candidate have the same majority judgment.") %> +

+

<%= _("To break the tie, we remove the vote that corresponds to the majority judgment one-by-one until one candidate has a better majority judgment than the other.") %>

+
+
<%= _("Votes for this candidate") %>
+
<%= _("Votes for the winning candidate") %>
+
+ + <% n = 0 %> + <% previous = nil %> + <% max = @results.first.mj.n * 2 + 1 %> + <% c.mj.break_tie(@results.first.mj).each do |a, b| %> + + + + + + + + <% (1..a.n).each do |i| %> + + <% end %> + + <% (1..b.n).each do |i| %> + + <% end %> + + + <% i = 0 %> + <% settings.values.reverse.each do |v| %> + <% (1..a.count[v[:id]]).each do |r| %> + <% i = i + 1 %> + + <% end %> + <% end %> + + <% i = 0 %> + <% settings.values.each do |v| %> + <% (1..b.count[v[:id]]).each do |r| %> + <% i = i + 1 %> + + <% end %> + <% end %> + + <% n = n + 1 %> + <% end %> +
+ <% if n == 0 %> + <% current = erb :rating_badge, :locals => { :value => settings.values.select { |e| e[:id] == a.mj }.first } %> + <%= _("Without removing any vote, both candidates have the same majority judgement of %{current}.") % { current: current } %> + <% end %> + <% if n == 1 %> + <% if a.mj == b.mj %> + <% current = erb :rating_badge, :locals => { :value => settings.values.select { |e| e[:id] == a.mj }.first } %> + <%= _("Removing a vote of rating %{previous}, both candidates still have the same majority judgement of %{current}.") % { previous: previous, current: current } %> + <% else %> + <% losing = erb :rating_badge, :locals => { :value => settings.values.select { |e| e[:id] == a.mj }.first } %> + <% winning = erb :rating_badge, :locals => { :value => settings.values.select { |e| e[:id] == b.mj }.first } %> + <%= _("Removing a vote of rating %{previous}, this candidate has a majority judgement of %{losing}, but the winning candidate has a majority judgement of %{winning}.") % { previous: previous, losing: losing, winning: winning } %> + <% end %> + <% end %> + <% if n > 1 %> + <% if a.mj == b.mj %> + <% current = erb :rating_badge, :locals => { :value => settings.values.select { |e| e[:id] == a.mj }.first } %> + <%= _("Removing another vote of rating %{previous}, both candidates still have the same majority judgement of %{current}.") % { previous: previous, current: current } %> + <% else %> + <% losing = erb :rating_badge, :locals => { :value => settings.values.select { |e| e[:id] == a.mj }.first } %> + <% winning = erb :rating_badge, :locals => { :value => settings.values.select { |e| e[:id] == b.mj }.first } %> + <%= _("Removing another vote of rating %{previous}, this candidate has a majority judgement of %{losing}, but the winning candidate has a majority judgement of %{winning}.") % { previous: previous, losing: losing, winning: winning } %> + <% end %> + <% end %> + <% previous = erb :rating_badge, :locals => { :value => settings.values.select { |e| e[:id] == a.mj }.first } %> +
  + <% if a.mj < b.mj %><<% end %> + <% if a.mj > b.mj %>><% end %> + <% if a.mj == b.mj %>=<% end %> +  
+
+ <% end %> +
<% end %>