Files
sure/app/views/shared/_balance_heading.html.erb
Igor Alexandrov b5c56f7775 Added lints for ERB templates (#609)
* Added erblint and fixed offenses

* Added erblint bintstub. Included erblint into CI

* Merged GitHub Actions tasks for rubocop and erblint into one

* Added config for erblint.

* Reverted erblint call in the CI
2024-04-09 08:08:58 -04:00

24 lines
1.0 KiB
Plaintext

<%# locals: (label:, period:, balance:, trend:, size: "lg")%>
<div class="space-y-2">
<p class="text-sm text-gray-500"><%= label %></p>
<p class="text-gray-900 -space-x-0.5">
<span class="text-gray-500"><%= balance.currency.symbol %></span>
<span class="<%= size == "lg" ? "text-xl" : "text-lg" %> font-medium"><%= format_money_without_symbol balance, precision: 0 %></span>
<%- if balance.currency.default_precision.positive? -%>
<span class="text-gray-500">
<%= balance.currency.separator %><%= balance.cents_str %>
</span>
<% end %>
</p>
<% if trend.nil? %>
<p class="text-sm text-gray-500">Data not available for the selected period</p>
<% elsif trend.direction == "flat" %>
<p class="text-sm text-gray-500">No change vs. prior period</p>
<% else %>
<div class="flex items-center gap-2">
<%= render partial: "shared/trend_change", locals: { trend: trend } %>
<span class="text-sm text-gray-500"><%= period_label(period) %></span>
</div>
<% end %>
</div>