mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-07 14:35:23 +02:00
* Make forms more composable, opt-in to form builder * Remove unused method * Simpler money input controls * Add in new form styling to imports * Lint fixes * Small tweak of multi select styles
23 lines
1.3 KiB
Text
23 lines
1.3 KiB
Text
<%= content_for :return_to_path, return_to_path(params, imports_path) %>
|
|
|
|
<div class="mx-auto max-w-[400px] w-full py-24 space-y-4">
|
|
<h1 class="sr-only"><%= t(".configure_title") %></h1>
|
|
|
|
<div class="text-center space-y-2">
|
|
<h2 class="text-3xl text-gray-900 font-medium"><%= t(".configure_subtitle") %></h2>
|
|
<p class="text-gray-500 text-sm"><%= t(".configure_description") %></p>
|
|
</div>
|
|
|
|
<%= styled_form_with model: @import, url: configure_import_path(@import), class: "space-y-4" do |form| %>
|
|
<%= form.fields_for :column_mappings do |mappings| %>
|
|
<% @import.expected_fields.each do |field| %>
|
|
<%= mappings.select field.key,
|
|
options_for_select(@import.available_headers, @import.get_selected_header_for_field(field)),
|
|
label: field.label,
|
|
include_blank: field.optional? ? t(".optional") : false %>
|
|
<% end %>
|
|
<% end %>
|
|
|
|
<%= form.submit t(".next"), class: "px-4 py-2 block w-full rounded-lg bg-gray-900 text-white text-sm font-medium cursor-pointer hover:bg-gray-700", data: { turbo_confirm: (@import.column_mappings? ? { title: t(".confirm_title"), body: t(".confirm_body"), accept: t(".confirm_accept") } : nil) } %>
|
|
<% end %>
|
|
</div>
|