mirror of
https://github.com/ubicloud/ubicloud.git
synced 2025-10-07 23:31:58 +08:00
Currently, herb/formatter has at least 4 bugs the prevent us from switching to it (https://github.com/marcoroth/herb/issues 476, 477, 478, and 479). This includes manual fixes for each issue. herb/formatter also introduces a rubocop violation for the Layout/AssignmentIndentation cop. This disables that cop.
13 lines
561 B
Text
13 lines
561 B
Text
<%# locals: (numerator:, denominator:, title:) %>
|
|
|
|
<% progress = [100, denominator.zero? ? 100 : 100 * numerator / denominator].min
|
|
color = (progress < 60) ? "bg-blue-500" : (progress < 80) ? "bg-yellow-500" : "bg-red-500" %>
|
|
|
|
<div class="flex justify-between mb-1">
|
|
<span class="text-base font-medium"><%= title %></span>
|
|
<span class="text-sm font-medium"><%= numerator %>/<%= denominator %> (<%= progress %>%)</span>
|
|
</div>
|
|
|
|
<div class="w-full bg-gray-200 rounded-full h-3">
|
|
<div class="<%= color %> h-3 rounded-full w-[<%= progress %>%]"></div>
|
|
</div>
|