Skip to content

Commit

Permalink
Use bootstrap for reveal/collapse contact form
Browse files Browse the repository at this point in the history
This provides better accessibility (aria-expanded) than our custom solution
  • Loading branch information
jcoyne committed Dec 20, 2024
1 parent eb2b869 commit f515b58
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 101 deletions.
32 changes: 0 additions & 32 deletions app/assets/javascripts/spotlight/spotlight.esm.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/assets/javascripts/spotlight/spotlight.esm.js.map

Large diffs are not rendered by default.

32 changes: 0 additions & 32 deletions app/assets/javascripts/spotlight/spotlight.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/assets/javascripts/spotlight/spotlight.js.map

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion app/assets/stylesheets/spotlight/_report_a_problem.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#report-problem-form {
display: none;
border-bottom: 1px solid $gray-600;

h2 {
Expand Down
2 changes: 0 additions & 2 deletions app/javascript/spotlight/user/index.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import BrowseGroupCateogries from 'spotlight/user/browse_group_categories'
import Carousel from 'spotlight/user/carousel'
import ClearFormButton from 'spotlight/user/clear_form_button'
import ReportProblem from 'spotlight/user/report_a_problem'
import ZprLinks from 'spotlight/user/zpr_links'

export default class {
connect() {
new BrowseGroupCateogries().connect()
new Carousel().connect()
new ClearFormButton().connect()
new ReportProblem().connect()
new ZprLinks().connect()
}
}
30 changes: 0 additions & 30 deletions app/javascript/spotlight/user/report_a_problem.js

This file was deleted.

2 changes: 1 addition & 1 deletion app/views/shared/_masthead.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<% if show_contact_form? && (current_exhibit.nil? || !current_page?(spotlight.new_exhibit_contact_form_path(current_exhibit))) %>
<div id="report-problem-form">
<div id="report-problem-form" class="collapse">
<%= render 'spotlight/shared/report_a_problem' %>
</div>
<% end %>
Expand Down
4 changes: 3 additions & 1 deletion app/views/shared/_user_util_links.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@
<% end %>
<% if current_exhibit and show_contact_form? %>
<li class="nav-item">
<%= link_to t('spotlight.header_links.contact'), spotlight.new_exhibit_contact_form_path(current_exhibit), data: {behavior: 'contact-link', target: 'report-problem-form' }, class: 'nav-link' %>
<%= link_to t('spotlight.header_links.contact'), spotlight.new_exhibit_contact_form_path(current_exhibit),
data: { bs_toggle: 'collapse', bs_target: '#report-problem-form' },
class: 'nav-link' %>
</li>
<% end %>
</ul>
19 changes: 19 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f515b58

Please sign in to comment.