1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-07 22:45:20 +02:00
Maybe/app/views/imports/configure.html.erb

24 lines
1.3 KiB
Text
Raw Permalink Normal View History

<%= 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)),
2024-06-11 18:46:44 -04:00
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>