-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use accordion components vs low-level markup
In this commit [1], @chrislo said: > I've had to use the "raw" HTML version of the accordian component[2] rather than the one in the publishing component library[3] since the latter doesn't support passing a block of arbitrary content into each section. However, it seems to work if you pass HTML as `content.html` attribute for an accordion item. I hope I'm not missing something! So I've used this approach in both `app/views/devise/invitations/new.html.erb` & `app/views/batch_invitation_permissions/new.html.erb`. I've also extracted `UsersHelper#items_for_permission_checkboxes` and used a `user` parameter with a default value to handle the slight difference between the behaviour needed in the two pages. Although there's still a little duplication between the two pages, I think the use of the library accordion component and the shared helper method has probably removed enough for now. I think extracting any more would make the template harder to understand. [1]: 539a70b [2] https://design-system.service.gov.uk/components/accordion/ [3] https://components.publishing.service.gov.uk/component-guide/accordion
- Loading branch information
1 parent
b03a67d
commit 211aee5
Showing
3 changed files
with
44 additions
and
50 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
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