mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-06 22:15:20 +02:00
Since the very first 0.1.0-alpha.1 release, we've been moving quickly to add new features to the Maybe app. In doing so, some parts of the codebase have become outdated, unnecessary, or overly-complex as a natural result of this feature prioritization. Now that "core" Maybe is complete, we're moving into a second phase of development where we'll be working hard to improve the accuracy of existing features and build additional features on top of "core". This PR is a quick overhaul of the existing codebase aimed to: - Establish the brand new and simplified dashboard view (pictured above) - Establish and move towards the conventions introduced in Cursor rules and project design overview #1788 - Consolidate layouts and improve the performance of layout queries - Organize the core models of the Maybe domain (i.e. Account::Entry, Account::Transaction, etc.) and break out specific traits of each model into dedicated concerns for better readability - Remove stale / dead code from codebase - Remove overly complex code paths in favor of simpler ones
45 lines
1.9 KiB
Text
45 lines
1.9 KiB
Text
<div class="space-y-4 h-fit max-h-full flex flex-col" 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 shadow-border-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-secondary items-center mb-4">
|
|
<div class="pl-0.5 col-span-8 flex items-center gap-4">
|
|
<%= check_box_tag "selection_entry",
|
|
class: "checkbox 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(@transactions.map(&:entry), totals: true) do |entries| %>
|
|
<%# Only render the outflow side of transfers to avoid duplicate entries %>
|
|
<%= render partial: "account/entries/entry", collection: entries.reject { |e| e.entryable.transfer_as_inflow.present? } %>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
<% else %>
|
|
<%= render "account/entries/empty" %>
|
|
<% end %>
|
|
|
|
<div class="pt-4">
|
|
<%= render "shared/pagination", pagy: @pagy %>
|
|
</div>
|
|
</div>
|
|
</div>
|