-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1187 from SplitTime/oveson/lottery-public-draws-s…
…how-progress Show progress bars in public lottery draw page
- Loading branch information
Showing
4 changed files
with
57 additions
and
38 deletions.
There are no files selected for viewing
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
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
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
41 changes: 41 additions & 0 deletions
41
app/views/lottery_divisions/_tickets_progress_bars.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,41 @@ | ||
<%# locals: (division:, show_pre_selected:) -%> | ||
|
||
<div id="<%= dom_id(division, :lottery_header) %>" class="card mt-3"> | ||
<div class="card-body"> | ||
<div class="row"> | ||
<div class="col-8"> | ||
<h6 class="fw-bold">Accepted</h6> | ||
</div> | ||
<div class="col-4"> | ||
<h6 class="text-end"><%= "(#{division.accepted_entrants.count}/#{division.maximum_entries})" %></h6> | ||
</div> | ||
</div> | ||
<div class="progress"> | ||
<%= bootstrap_progress_bar(min_value: 0, max_value: division.maximum_entries, current_value: division.accepted_entrants.count, color: "success") %> | ||
</div> | ||
<div class="row mt-2"> | ||
<div class="col-8"> | ||
<h6 class="fw-bold">Wait List</h6> | ||
</div> | ||
<div class="col-4"> | ||
<h6 class="text-end"><%= "(#{division.wait_list_entrants.count}/#{division.maximum_wait_list})" %></h6> | ||
</div> | ||
</div> | ||
<div class="progress"> | ||
<%= bootstrap_progress_bar(min_value: 0, max_value: division.maximum_wait_list, current_value: division.wait_list_entrants.count, color: "warning") %> | ||
</div> | ||
<% if show_pre_selected %> | ||
<div class="row mt-2"> | ||
<div class="col-8"> | ||
<h6 class="fw-bold">Pre-selected</h6> | ||
</div> | ||
<div class="col-4"> | ||
<h6 class="text-end"><%= "(#{division.entrants.pre_selected.drawn.count}/#{division.entrants.pre_selected.count})" %></h6> | ||
</div> | ||
</div> | ||
<div class="progress"> | ||
<%= bootstrap_progress_bar(min_value: 0, max_value: division.entrants.pre_selected.count, current_value: division.entrants.pre_selected.drawn.count, color: "secondary") %> | ||
</div> | ||
<% end %> | ||
</div> | ||
</div> |