Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added assignment bidding summary table with the name of the current a…
…ssignment to enhance clarity and presentation.
- Loading branch information
1 parent
11f7b78
commit b798b78
Showing
1 changed file
with
50 additions
and
0 deletions.
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
app/views/lottery/calculate_bidding_summary_based_on_priority.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<!-- Display the assignment name in the bidding summary header --> | ||
<h3>Assignment Bidding Summary by Priority: <%= @assignment.name %></h3> | ||
|
||
<!-- Define the structure of the bidding summary table --> | ||
<table class="table table-bordered table-hover"> | ||
<thead> | ||
<tr> | ||
<!-- Define the table headers with specified widths for better alignment --> | ||
<th>Topic id</th> | ||
<th>Topic name</th> | ||
<th>#1 bids</th> | ||
<th>#2 bids</th> | ||
<th>#3 bids</th> | ||
<th>Total bids</th> | ||
<!-- Set fixed width for the 'Percentage of #1 bids' column --> | ||
<th style="width: 200px;">Percentage of #1 bids</th> | ||
<!-- Set fixed width for the 'Bidding teams' column --> | ||
<th style="width: 200px;">Bidding teams</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<!-- Iterate over each topic to display its bidding information --> | ||
<% @topic_data.each do |topic| %> | ||
<tr> | ||
<!-- Display topic id, name, bid counts, total bids and bidding teams --> | ||
<td><%= topic[:id] %></td> | ||
<td><%= topic[:name] %></td> | ||
<td><%= topic[:first_bids] %></td> | ||
<td><%= topic[:second_bids] %></td> | ||
<td><%= topic[:third_bids] %></td> | ||
<td><%= topic[:total_bids] %></td> | ||
<!-- Calculate and display the percentage of first bids with tooltip and custom background --> | ||
<td title="Calculated as (#1 Bids / Total Bids) * 100"> | ||
<span style="<%= background_color_by_percentage(topic[:percentage_first]) %> font-weight: bold; padding: 3px; border-radius: 4px;"> | ||
<%= topic[:percentage_first] %> % | ||
</span> | ||
</td> | ||
<!-- List all the bidding teams for the topic --> | ||
<td> | ||
<% topic[:bidding_teams].each do |team| %> | ||
<%= team %><br> | ||
<% end %> | ||
</td> | ||
</tr> | ||
<% end %> | ||
</tbody> | ||
</table> | ||
|
||
<!-- Link to navigate back to the previous page --> | ||
<%= link_to 'Back', :back %> |