mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-23 15:19:38 +02:00
An overhaul and cleanup of the transactions feature including: - Simplification of transactions search and filtering - Consolidation of account sync logic after transaction change - Split sidebar modal and modal into "drawer" and "modal" concepts - Refactor of transaction partials and folder organization - Cleanup turbo frames and streams for transaction updates, including new Transactions::RowsController for inline updates - Refactored and added several integration and systems tests
20 lines
590 B
Ruby
20 lines
590 B
Ruby
module TransactionsHelper
|
|
def transactions_group(date, transactions, transaction_partial_path = "transactions/transaction")
|
|
header_left = content_tag :span do
|
|
"#{date.strftime('%b %d, %Y')} · #{transactions.size}".html_safe
|
|
end
|
|
|
|
header_right = content_tag :span do
|
|
format_money(-transactions.sum(&:amount_money))
|
|
end
|
|
|
|
header = header_left.concat(header_right)
|
|
|
|
content = render partial: transaction_partial_path, collection: transactions
|
|
|
|
render partial: "shared/list_group", locals: {
|
|
header: header,
|
|
content: content
|
|
}
|
|
end
|
|
end
|