forked from rubyforgood/human-essentials
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[rubyforgood#4504] PR feedback: extract partial for accordion section
- Loading branch information
1 parent
1df9599
commit 1d1ba35
Showing
2 changed files
with
28 additions
and
72 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
app/views/partners/profiles/step/_accordion_section.html.erb
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<%# locals: (f:, partner:, section_id:, section_title:, icon_class:, partial_name:, sections_with_errors:) %> | ||
|
||
<div class="accordion-item"> | ||
<h2 class="accordion-header"> | ||
<button | ||
class="accordion-button <%= section_with_errors?(section_id, sections_with_errors) ? '' : 'collapsed' %>" | ||
type="button" data-bs-toggle="collapse" data-bs-target="#<%= section_id %>" | ||
aria-expanded="<%= section_with_errors?(section_id, sections_with_errors) %>" | ||
aria-controls="<%= section_id %>"> | ||
<div class="d-flex justify-content-between align-items-center w-100"> | ||
<div class="fs-4"> | ||
<i class="fa <%= icon_class %> mr-2"></i> | ||
<%= section_title %> | ||
</div> | ||
</div> | ||
</button> | ||
</h2> | ||
<div id="<%= section_id %>" | ||
class="accordion-collapse collapse <%= section_with_errors?(section_id, sections_with_errors) ? 'show' : '' %>"> | ||
<div class="accordion-body"> | ||
<%= render "partners/profiles/step/#{partial_name}_form" , f: f, partner: partner, profile: partner.profile %> | ||
</div> | ||
</div> | ||
</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