mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-05 05:25:24 +02:00
Allow user to add buy and sell trade transactions for investment accounts (#1066)
* Consolidate modal form structure into partial + helper * Scaffold out trade transaction form * Normalize translations * Add buy and sell trade form with tests * Move entryable lists to dedicated controllers * Delegate entry group contents rendering * More cleanup * Extract transaction and valuation update logic from entries controller * Delegate edit and show actions to entryables * Trade builder * Update paths for transaction updates
This commit is contained in:
parent
6bca35fa22
commit
e05f03b314
75 changed files with 801 additions and 624 deletions
18
app/views/shared/_modal_form.html.erb
Normal file
18
app/views/shared/_modal_form.html.erb
Normal file
|
@ -0,0 +1,18 @@
|
|||
<%# locals: (title:, content:, subtitle: nil) %>
|
||||
|
||||
<%= modal do %>
|
||||
<article class="mx-auto w-full p-4 space-y-4 min-w-[450px] max-w-xl">
|
||||
<div class="space-y-2">
|
||||
<header class="flex justify-between">
|
||||
<h2 class="font-medium text-xl"><%= title %></h2>
|
||||
<%= lucide_icon("x", class: "w-5 h-5 text-gray-500", data: { action: "click->modal#close" }) %>
|
||||
</header>
|
||||
|
||||
<% if subtitle.present? %>
|
||||
<%= tag.p subtitle, class: "text-gray-500 font-light" %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<%= content %>
|
||||
</article>
|
||||
<% end %>
|
|
@ -1,7 +1,7 @@
|
|||
<%# locals: (form:, money_method:, default_currency:, disable_currency: false, hide_currency: false, label: nil) %>
|
||||
|
||||
<% fallback_label = t(".money-label") %>
|
||||
<% currency = form.object.send(money_method)&.currency || Money::Currency.new(default_currency) %>
|
||||
<% currency = form.object ? (form.object.send(money_method)&.currency || Money::Currency.new(default_currency)) : Money::Currency.new(default_currency) %>
|
||||
|
||||
<div class="form-field pr-0" data-controller="money-field">
|
||||
<%= form.label label || fallback_label, { class: "form-field__label" } %>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue