mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-05 21:45:23 +02:00
Account namespace updates: part 6 (transactions) (#904)
* Move Transaction to Account namespace * Fix improper routes, improve separation of concerns * Replace account transactions list partial with view * Remove logs * Consolidate transaction views * Remove unused code * Transfer style tweaks * Remove more unused code * Add back totals by currency helper
This commit is contained in:
parent
cb3fd34f90
commit
da18c3d850
72 changed files with 575 additions and 522 deletions
|
@ -1,4 +1,4 @@
|
|||
module Transactions::SearchesHelper
|
||||
module Account::Transaction::SearchesHelper
|
||||
def transaction_search_filters
|
||||
[
|
||||
{ key: "account_filter", name: "Account", icon: "layers" },
|
|
@ -1,23 +1,4 @@
|
|||
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
|
||||
|
||||
module Account::TransactionsHelper
|
||||
def unconfirmed_transfer?(transaction)
|
||||
transaction.marked_as_transfer && transaction.transfer.nil?
|
||||
end
|
|
@ -1,6 +1,6 @@
|
|||
module Account::ValuationsHelper
|
||||
def valuation_icon(valuation)
|
||||
if valuation.first_of_series?
|
||||
if valuation.oldest?
|
||||
"keyboard"
|
||||
elsif valuation.trend.direction.up?
|
||||
"arrow-up"
|
||||
|
@ -12,7 +12,7 @@ module Account::ValuationsHelper
|
|||
end
|
||||
|
||||
def valuation_style(valuation)
|
||||
color = valuation.first_of_series? ? "#D444F1" : valuation.trend.color
|
||||
color = valuation.oldest? ? "#D444F1" : valuation.trend.color
|
||||
|
||||
<<-STYLE.strip
|
||||
background-color: color-mix(in srgb, #{color} 5%, white);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue