Highlight winner

This commit is contained in:
ricola 2025-12-04 16:47:39 -06:00
parent 25c3650e59
commit 0b08485ffc
5 changed files with 2117 additions and 2 deletions

View file

@ -42,6 +42,7 @@
<table class="table mb-4">
<tr>
<th></th>
<th><%= _("Rank") %></th>
<th><%= _("Candidate") %></th>
<th><%= _("Majority Judgment") %></th>
@ -51,8 +52,15 @@
<% i = 0 %>
<% @vote.candidates.sort { |a, b| a.mj <=> b.mj }.reverse.each do |candidate| %>
<% i = i + 1 %>
<tr>
<td><%= i %></td>
<% if i == 1 %>
<tr class="table-success">
<td><i class="bi bi-trophy-fill"></i></td>
<td><%= i %></i></td>
<% else %>
<tr>
<td></td>
<td><%= i %></td>
<% end %>
<td><%= candidate.name %></td>
<% value = settings.values.select { |e| e[:id] == candidate.mj.mj }.first %>
<td class="h5"><span class="badge bg-<%= value[:id] %>"><%= _(value[:label]) %></span></td>