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

2106
public/bootstrap-icons.css vendored Normal file

File diff suppressed because it is too large Load diff

Binary file not shown.

Binary file not shown.

View file

@ -7,6 +7,7 @@
<script src="/chartkick.js"></script>
<script src="/Chart.bundle.js"></script>
<link rel="stylesheet" href="/bootstrap.css">
<link rel="stylesheet" href="/bootstrap-icons.css">
<link rel="stylesheet" href="/style.css">
</head>
<script>

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 %>
<% 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>