mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-05 13:35:21 +02:00
Add default currencies to forms based on preference (#994)
* Add default currencies to forms based on preference * Remove dev debugging
This commit is contained in:
parent
e51806b98b
commit
e9f42c1a65
12 changed files with 35 additions and 20 deletions
|
@ -13,7 +13,7 @@
|
|||
<section class="space-y-2">
|
||||
<%= f.text_field :name, label: t(".description"), placeholder: t(".description_placeholder"), required: true %>
|
||||
<%= f.collection_select :account_id, Current.family.accounts.alphabetically, :id, :name, { prompt: t(".account_prompt"), label: t(".account") }, required: true %>
|
||||
<%= money_with_currency_field f, :amount_money, label: t(".amount"), required: true %>
|
||||
<%= money_with_currency_field f, :amount_money, label: t(".amount"), required: true, default_currency: @entry.account&.currency || Current.family.currency %>
|
||||
<%= f.hidden_field :entryable_type, value: "Account::Transaction" %>
|
||||
<%= f.fields_for :entryable do |ef| %>
|
||||
<%= ef.collection_select :category_id, Current.family.categories.alphabetically, :id, :name, { prompt: t(".category_prompt"), label: t(".category") } %>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<%= modal do %>
|
||||
<article class="mx-auto p-4 space-y-4 w-screen max-w-xl">
|
||||
<header class="flex justify-between">
|
||||
<h2 class="font-medium text-xl">New transaction</h2>
|
||||
<h2 class="font-medium text-xl"><%= t(".new_transaction") %></h2>
|
||||
<%= lucide_icon "x", class: "w-5 h-5 text-gray-500", data: { action: "click->modal#close" } %>
|
||||
</header>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue