1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-07 22:45:20 +02:00
Maybe/app/views/transactions/index.html.erb
Zach Gollwitzer 2c2b600163
Some checks failed
Publish Docker image / ci (push) Has been cancelled
Publish Docker image / Build docker image (push) Has been cancelled
Improve speed of transactions page (#1752)
* Make demo data more realistic

* Fix N+1 transactions query

* Lint fixes

* Totals query

* Consolidate stats calcs

* Fix preload

* Fix filter clearing

* Fix N+1 queries for family sync detection

* Reduce queries for rendering transfers

* Fix tests

* Remove flaky test
2025-01-31 19:08:21 -05:00

47 lines
2 KiB
Text

<div class="space-y-4 h-full flex flex-col overflow-y-auto" data-controller="focus-record" data-focus-record-id-value="<%= @focused_record ? dom_id(@focused_record) : nil %>">
<%= render "header" %>
<%= render "summary", totals: @totals %>
<div id="transactions"
data-controller="bulk-select"
data-bulk-select-singular-label-value="<%= t(".transaction") %>"
data-bulk-select-plural-label-value="<%= t(".transactions") %>"
class="overflow-y-auto flex flex-col bg-white rounded-xl border border-alpha-black-25 shadow-xs p-4">
<%= render "transactions/searches/search" %>
<div id="entry-selection-bar" data-bulk-select-target="selectionBar" class="flex justify-center hidden">
<%= render "account/transactions/selection_bar" %>
</div>
<% if @pagy.count > 0 %>
<div class="grow overflow-y-auto">
<div class="grid grid-cols-12 bg-gray-25 rounded-xl px-5 py-3 text-xs uppercase font-medium text-gray-500 items-center mb-4">
<div class="pl-0.5 col-span-8 flex items-center gap-4">
<%= check_box_tag "selection_entry",
class: "maybe-checkbox maybe-checkbox--light",
data: { action: "bulk-select#togglePageSelection" } %>
<p>transaction</p>
</div>
<p class="col-span-2">category</p>
<p class="col-span-2 justify-self-end">amount</p>
</div>
<div class="space-y-6">
<%= entries_by_date(@transaction_entries, transfers: @transfers, totals: true) do |entries, transfers| %>
<%= render partial: "transfers/transfer", collection: transfers %>
<%# Render regular entries %>
<%= render partial: "account/entries/entry", collection: entries.reject { |e| e.entryable.transfer? } %>
<% end %>
</div>
</div>
<% else %>
<%= render "account/entries/empty" %>
<% end %>
<div class="pt-4">
<%= render "pagination", pagy: @pagy %>
</div>
</div>
</div>