Files
sure/app/views/transactions/_list.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

35 lines
1.4 KiB
Plaintext

<%# locals: (transactions:, pagy:) %>
<div>
<%= turbo_frame_tag "transactions_list" do %>
<% if transactions.empty? %>
<div class="flex flex-col items-center justify-center py-40">
<p class="text-gray-500 mb-2">No transactions found</p>
<p class="text-gray-400 max-w-xs text-center">Try adding a transaction, editing filters or refining your search</p>
</div>
<% else %>
<div class="bg-gray-25 rounded-xl px-5 py-3 text-xs font-medium text-gray-500 flex items-center gap-6 mb-4">
<div class="w-96">
<p class="uppercase">transaction</p>
</div>
<div class="w-48">
<p class="uppercase">category</p>
</div>
<div class="grow uppercase flex justify-between items-center gap-5 text-xs font-medium text-gray-500">
<p>account</p>
<p>amount</p>
</div>
</div>
<div class="space-y-6">
<% transactions.group_by { |transaction| transaction.date }.each do |date, grouped_transactions| %>
<%= render partial: "transactions/transaction_group", locals: { date: date, transactions: grouped_transactions } %>
<% end %>
</div>
<% end %>
<% if pagy.pages > 1 %>
<nav class="flex items-center justify-center px-4 mt-4 sm:px-0">
<%= render partial: "transactions/pagination", locals: { pagy: pagy } %>
</nav>
<% end %>
<% end %>
</div>