1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-08 15:05:22 +02:00

Finalize transaction drawer, simplify money form helpers (#1191)

* Finalize transaction drawer, simplify money form helpers

* Fix money form errors

* Reusable disclosure helper, fix styles

* Final style tweaks
This commit is contained in:
Zach Gollwitzer 2024-09-20 08:38:19 -04:00 committed by GitHub
parent 730e58d763
commit 5942ce7e3c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 275 additions and 214 deletions

View file

@ -2,7 +2,7 @@
<%= styled_form_with data: { turbo_frame: "_top", controller: "trade-form" },
scope: :account_entry,
url: entry.new_record? ? account_trades_path(entry.account) : account_entry_path(entry.account, entry) do |form| %>
url: account_trades_path(entry.account) do |form| %>
<div class="space-y-4">
<div class="space-y-2">
<%= form.select :type, options_for_select([%w[Buy buy], %w[Sell sell], %w[Deposit transfer_in], %w[Withdrawal transfer_out], %w[Interest interest]], "buy"), { label: t(".type") }, { data: { "trade-form-target": "typeInput" } } %>
@ -13,7 +13,7 @@
<%= form.date_field :date, label: true %>
<div data-trade-form-target="amountInput" hidden>
<%= money_with_currency_field form, :amount_money, label: t(".amount"), disable_currency: true %>
<%= form.money_field :amount, :currency, label: t(".amount"), disable_currency: true %>
</div>
<div data-trade-form-target="transferAccountInput" hidden>
@ -25,7 +25,7 @@
</div>
<div data-trade-form-target="priceInput">
<%= money_with_currency_field form, :price_money, label: t(".price"), disable_currency: true %>
<%= form.money_field :price, :currency, label: t(".price"), disable_currency: true %>
</div>
</div>