From 1d1ba35d7225b2638fe0408297001d73dfcde1a6 Mon Sep 17 00:00:00 2001 From: Daniela Baron Date: Sat, 9 Nov 2024 07:00:33 -0500 Subject: [PATCH] [#4504] PR feedback: extract partial for accordion section --- .../profiles/step/_accordion_section.html.erb | 24 ++++++ .../partners/profiles/step/edit.html.erb | 76 +------------------ 2 files changed, 28 insertions(+), 72 deletions(-) create mode 100644 app/views/partners/profiles/step/_accordion_section.html.erb diff --git a/app/views/partners/profiles/step/_accordion_section.html.erb b/app/views/partners/profiles/step/_accordion_section.html.erb new file mode 100644 index 0000000000..382af16521 --- /dev/null +++ b/app/views/partners/profiles/step/_accordion_section.html.erb @@ -0,0 +1,24 @@ +<%# locals: (f:, partner:, section_id:, section_title:, icon_class:, partial_name:, sections_with_errors:) %> + +
+

+ +

+
+
+ <%= render "partners/profiles/step/#{partial_name}_form" , f: f, partner: partner, profile: partner.profile %> +
+
+
diff --git a/app/views/partners/profiles/step/edit.html.erb b/app/views/partners/profiles/step/edit.html.erb index b62e34e7d9..513a53b3fe 100644 --- a/app/views/partners/profiles/step/edit.html.erb +++ b/app/views/partners/profiles/step/edit.html.erb @@ -33,80 +33,12 @@ <%= render 'partners/profiles/step/form_actions', f: f, partner: current_partner %>
- - <%# Agency Information %> -
-

- -

-
-
- <%= render 'partners/profiles/step/agency_information_form', f: f, partner: current_partner, profile: current_partner.profile %> -
-
-
- - <%# Program Delivery Address %> -
-

- -

-
-
- <%= render 'partners/profiles/step/program_delivery_address_form', f: f, partner: current_partner, profile: current_partner.profile %> -
-
-
- - <%# Based on partner.partials_to_show %> + <%= render 'partners/profiles/step/accordion_section', f: f, partner: current_partner, section_id: 'agency_information', section_title: 'Agency Information', icon_class: 'fa-edit', partial_name: 'agency_information', sections_with_errors: @sections_with_errors %> + <%= render 'partners/profiles/step/accordion_section', f: f, partner: current_partner, section_id: 'program_delivery_address', section_title: 'Program / Delivery Address', icon_class: 'fa-map', partial_name: 'program_delivery_address', sections_with_errors: @sections_with_errors %> <% current_partner.partials_to_show.each do |partial| %> -
-

- -

-
-
- <%= render "partners/profiles/step/#{partial}_form", f: f, partner: current_partner, profile: current_partner.profile %> -
-
-
+ <%= render 'partners/profiles/step/accordion_section', f: f, partner: current_partner, section_id: partial, section_title: partial_display_name(partial), icon_class: 'fa-cogs', partial_name: partial, sections_with_errors: @sections_with_errors %> <% end %> - - <%# Partner Settings %> -
-

- -

-
-
- <%= render 'partners/profiles/step/partner_settings_form', f: f, partner: current_partner, profile: current_partner.profile %> -
-
-
+ <%= render 'partners/profiles/step/accordion_section', f: f, partner: current_partner, section_id: 'partner_settings', section_title: 'Settings', icon_class: 'fa-cog', partial_name: 'partner_settings', sections_with_errors: @sections_with_errors %>
<%= render 'partners/profiles/step/form_actions', f: f, partner: current_partner %>