-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement import account selection form
- Loading branch information
Showing
9 changed files
with
47 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,7 @@ | ||
<%= form_with(model: import, class: "contents") do |form| %> | ||
<% if import.errors.any? %> | ||
<div id="error_explanation" class="bg-red-50 text-red-500 px-3 py-2 font-medium rounded-lg mt-3"> | ||
<h2><%= pluralize(import.errors.count, "error") %> prohibited this import from being saved:</h2> | ||
|
||
<ul> | ||
<% import.errors.each do |error| %> | ||
<li><%= error.full_message %></li> | ||
<% end %> | ||
</ul> | ||
</div> | ||
<% end %> | ||
|
||
<div class="my-5"> | ||
<%= form.label :account_id %> | ||
<%= form.text_field :account_id, class: "block shadow rounded-md border border-gray-200 outline-none px-3 py-2 mt-2 w-full" %> | ||
<%= form_with model: @import do |form| %> | ||
<div class="mb-4"> | ||
<%= form.collection_select :account_id, Current.family.accounts.alphabetically, :id, :name, { prompt: t(".select_account"), label: t(".account"), required: true } %> | ||
</div> | ||
|
||
<div class="inline"> | ||
<%= form.submit class: "rounded-lg py-3 px-5 bg-blue-600 text-white inline-block font-medium cursor-pointer" %> | ||
</div> | ||
<%= form.submit t(".next"), class: "px-4 py-2 block w-full rounded-lg bg-gray-900 text-white text-sm font-medium" %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,13 @@ | ||
<div> | ||
<% if import.new_record? %> | ||
<ul class="flex items-center gap-2 py-12"> | ||
<%= render partial: "nav_item", locals: { name: "Select", path: new_import_path, index: 0, is_complete: true, is_current: false } %> | ||
<div class="h-px bg-alpha-black-200 w-12"></div> | ||
<%= render partial: "nav_item", locals: { name: "Import", path: new_import_path, index: 1, is_complete: true, is_current: false } %> | ||
<div class="h-px bg-alpha-black-200 w-12"></div> | ||
<%= render partial: "nav_item", locals: { name: "Setup", path: new_import_path, index: 2, is_complete: false, is_current: true } %> | ||
<div class="h-px bg-alpha-black-200 w-12"></div> | ||
<%= render partial: "nav_item", locals: { name: "Clean", path: new_import_path, index: 3, is_complete: false, is_current: false } %> | ||
<div class="h-px bg-alpha-black-200 w-12"></div> | ||
<%= render partial: "nav_item", locals: { name: "Confirm", path: new_import_path, index: 4, is_complete: false, is_current: false } %> | ||
</ul> | ||
<% else %> | ||
<div> | ||
<p>Placeholder</p> | ||
</div> | ||
<% end %> | ||
<ul class="flex items-center gap-2"> | ||
<%= render partial: "nav_item", locals: { name: "Select", path: new_import_path, index: 0, is_complete: false, is_current: true } %> | ||
<div class="h-px bg-alpha-black-200 w-12"></div> | ||
<%= render partial: "nav_item", locals: { name: "Import", path: nil, index: 1, is_complete: false, is_current: false } %> | ||
<div class="h-px bg-alpha-black-200 w-12"></div> | ||
<%= render partial: "nav_item", locals: { name: "Setup", path: nil, index: 2, is_complete: false, is_current: false } %> | ||
<div class="h-px bg-alpha-black-200 w-12"></div> | ||
<%= render partial: "nav_item", locals: { name: "Clean", path: nil, index: 3, is_complete: false, is_current: false } %> | ||
<div class="h-px bg-alpha-black-200 w-12"></div> | ||
<%= render partial: "nav_item", locals: { name: "Confirm", path: nil, index: 4, is_complete: false, is_current: false } %> | ||
</ul> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,20 @@ | ||
<%= content_for :return_to_path, return_to_path(params, imports_path) %> | ||
<%= content_for :nav do %> | ||
<%= render "nav", import: @import %> | ||
<% end %> | ||
<% if params[:enable_type_selector].present? %> | ||
<%= modal do %> | ||
<%= render "type_selector" %> | ||
<% end %> | ||
<% end %> | ||
<div class="mx-auto md:w-2/3 w-full"> | ||
<h1 class="sr-only">New import</h1> | ||
<%= content_for :nav do %> | ||
<%= render "nav", import: @import %> | ||
<% end %> | ||
|
||
<div class="mx-auto max-w-[400px] w-full py-56"> | ||
<h1 class="sr-only">New import</h1> | ||
<div class="space-y-2 mb-6 text-center"> | ||
<p class="text-3xl font-medium text-gray-900"><%= t(".header_text") %></p> | ||
<p class="text-gray-500 text-sm"><%= t(".description_text") %></p> | ||
</div> | ||
<%= render "form", import: @import %> | ||
|
||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
<div> | ||
<h1 class="font-bold text-4xl">Imports::Steps#load-data</h1> | ||
<p>Find me in app/views/imports/steps/load-data.html.erb</p> | ||
<h1 class="sr-only">Load import</h1> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters