diff --git a/views/style.erb b/views/style.erb index 1918262..adc3ffc 100644 --- a/views/style.erb +++ b/views/style.erb @@ -18,30 +18,12 @@ } .mj-cell-<%= v[:id] %> { - border-left-width: 2px; - border-right-width: 2px; - border-color: <%= v[:color] %>; background-color: <%= v[:color] %> !important; } <% end %> -.tiebreak td { - padding-left: 0; - padding-right: 0; -} - -tr:has(.mj-cell:hover) .mj-cell { +table:has(.mj-cell:hover) .mj-cell { + border-left-width: 2px; + border-right-width: 2px; border-color: var(--bs-body-color); } - -tr:has(.mj-cell:hover) .mj-cell-majority { - background-color: white !important; -} - -.tiebreak-top td { - border-bottom: 1px solid var(--bs-gray-400); -} - -.tiebreak-round td { - padding-top: 15px; -} diff --git a/views/votes_show_closed.erb b/views/votes_show_closed.erb index c1a3b0a..85705e5 100644 --- a/views/votes_show_closed.erb +++ b/views/votes_show_closed.erb @@ -85,65 +85,54 @@
<%= _("Votes for this candidate") %>
<%= _("Votes for the winning candidate") %>
- - <% n = 0 %> - <% previous = 0 %> - <% max = @results.first.mj.n * 2 + 1 %> - <% c.mj.break_tie(@results.first.mj).each do |a, b| %> - - - - - - + <% n = 0 %> + <% c.mj.break_tie(@results.first.mj).each do |a, b| %> +
+ <% if n == 0 %> +
+
<%= _("Without removing any vote.") %>
+
+ <% end %> + <% if n == 1 %> +
+
<%= _("Removing 1 vote.") %>
+
+ <% end %> + <% if n > 1 %> +
+
<%= _("Removing %{n} votes.") % { n: n } %>
+
+ <% end %> +
- <% if n == 0 %> - <%= _("Without removing any vote.") %> - <% end %> - <% if n == 1 %> - <% value = settings.values.select { |e| e[:id] == previous }.first %> - <%= _("Removing a vote of value: ") %> - <%= _(value[:label]) %> - <% end %> - <% if n > 1 %> - <% value = settings.values.select { |e| e[:id] == previous }.first %> - <%= _("Removing another vote of value: ") %> - <%= _(value[:label]) %> - <% end %> - <% previous = a.mj %> -
<% (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 a.mj < b.mj %><<% end %> <% if a.mj > b.mj %>><% end %> <% if a.mj == b.mj %>=<% end %>   
+ + <% n = n + 1 %> + <% end %> <% end %>