mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-08 15:05:22 +02:00
36 lines
1.5 KiB
Text
36 lines
1.5 KiB
Text
<%# locals: (account:, url:) %>
|
|
|
|
<% if @error_message.present? %>
|
|
<div class="mb-4">
|
|
<%= render AlertComponent.new(message: @error_message, variant: :error) %>
|
|
</div>
|
|
<% end %>
|
|
|
|
<%= styled_form_with model: account, url: url, scope: :account, class: "flex flex-col gap-4 justify-between grow text-primary" do |form| %>
|
|
<div class="grow space-y-2">
|
|
<%= form.hidden_field :accountable_type %>
|
|
<%= form.hidden_field :return_to, value: params[:return_to] %>
|
|
|
|
<%= form.text_field :name, placeholder: t(".name_placeholder"), required: "required", label: t(".name_label") %>
|
|
|
|
<% unless account.linked? %>
|
|
<%= form.money_field :balance,
|
|
label: t(".balance"),
|
|
required: true,
|
|
default_currency: Current.family.currency,
|
|
label_tooltip: "The current balance or value of the account, which is typically the balance reported by your financial institution." %>
|
|
|
|
<% unless account.persisted? %>
|
|
<%= form.date_field :tracking_start_date,
|
|
label: "Tracking start date",
|
|
required: true,
|
|
value: 2.years.ago.to_date,
|
|
label_tooltip: "The date we will start tracking the balance for this account. If you're not sure, we recommend using the default of 2 years ago so net worth graphs have adequate historical data." %>
|
|
<% end %>
|
|
<% end %>
|
|
|
|
<%= yield form %>
|
|
</div>
|
|
|
|
<%= form.submit %>
|
|
<% end %>
|