mirror of
https://github.com/we-promise/sure.git
synced 2026-04-25 23:14:10 +00:00
* Initial multi-step property form * Improve form structure, add optional tooltip help icons to form fields * Add basic inline alert component * Clean up and improve property form lifecycle * Implement Account status concept * Lint fixes * Remove whitespace * Balance editing, scope updates for account * Passing tests * Fix brakeman warning * Remove stale columns * data constraint tweaks * Redundant property
23 lines
813 B
Plaintext
23 lines
813 B
Plaintext
<%# locals: (account:, url:) %>
|
|
|
|
<% if @error_message.present? %>
|
|
<%= render AlertComponent.new(message: @error_message, variant: :error) %>
|
|
<% end %>
|
|
|
|
<%= styled_form_with model: account, url: url, scope: :account, data: { turbo: false }, 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 %>
|
|
<% end %>
|
|
|
|
<%= yield form %>
|
|
</div>
|
|
|
|
<%= form.submit %>
|
|
<% end %>
|