Skip to content

Commit

Permalink
Add additional aria-labels to form elements (#6328)
Browse files Browse the repository at this point in the history
* Add aria-labels for embargo and lease visibility options

* Add aria-label to my works search form field

* Add aria-label to catalog search form field

* Add aria-label to batch documents action button
  • Loading branch information
bbpennel authored Sep 21, 2023
1 parent 04271c4 commit f14958e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/views/catalog/_search_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</label>

<div class="input-group col-sm-9">
<%= text_field_tag :q, current_search_parameters , class: "q form-control", id: "search-field-header", placeholder: t("hyrax.search.form.q.placeholder") %>
<%= text_field_tag :q, current_search_parameters , 'aria-label': 'Search', class: "q form-control", id: "search-field-header", placeholder: t("hyrax.search.form.q.placeholder") %>

<div class="input-group-append">
<button type="submit" class="btn btn-primary" id="search-submit-header">
Expand Down
8 changes: 4 additions & 4 deletions app/views/hyrax/base/_form_visibility_component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -31,31 +31,31 @@
</li>
<li class="form-check">
<label class="form-check-label">
<%= f.radio_button :visibility, Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_EMBARGO, class: 'form-check-input', data: { 'target': '#collapseEmbargo' } %>
<%= f.radio_button :visibility, Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_EMBARGO, 'aria-label': 'Embargo', class: 'form-check-input', data: { 'target': '#collapseEmbargo' } %>
<%= visibility_badge(Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_EMBARGO) %>
<br />
<%= t('hyrax.visibility.embargo.note_html') %>
<div class="collapse" id="collapseEmbargo">
<div class="form-inline">
<%= f.input :visibility_during_embargo, wrapper: :inline, collection: visibility_options(:restrict), include_blank: false %>
<%= t('hyrax.works.form.visibility_until') %>
<%= f.date_field :embargo_release_date, wrapper: :inline, value: f.object.embargo_release_date&.to_date || Date.tomorrow, class: 'datepicker form-control' %>
<%= f.date_field :embargo_release_date, wrapper: :inline, 'aria-label': 'Embargo Release Date', value: f.object.embargo_release_date&.to_date || Date.tomorrow, class: 'datepicker form-control' %>
<%= f.input :visibility_after_embargo, wrapper: :inline, collection: visibility_options(:loosen), include_blank: false %>
</div>
</div>
</label>
</li>
<li class="form-check">
<label class="form-check-label">
<%= f.radio_button :visibility, Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_LEASE, class: 'form-check-input', data: { 'target': '#collapseLease' } %>
<%= f.radio_button :visibility, Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_LEASE, 'aria-label': 'Lease', class: 'form-check-input', data: { 'target': '#collapseLease' } %>
<%= visibility_badge(Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_LEASE) %>
<br />
<%= t('hyrax.visibility.lease.note_html') %>
<div class="collapse" id="collapseLease">
<div class="form-inline">
<%= f.input :visibility_during_lease, wrapper: :inline, collection: visibility_options(:loosen), include_blank: false %>
<%= t('hyrax.works.form.visibility_until') %>
<%= f.date_field :lease_expiration_date, wrapper: :inline, value: f.object.lease_expiration_date&.to_date || Date.tomorrow, class: 'datepicker form-control' %>
<%= f.date_field :lease_expiration_date, wrapper: :inline, 'aria-label': 'Lease Expiration Date', value: f.object.lease_expiration_date&.to_date || Date.tomorrow, class: 'datepicker form-control' %>
<%= f.input :visibility_after_lease, wrapper: :inline, collection: visibility_options(:restrict), include_blank: false %>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/hyrax/base/_show_actions.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="col-sm-6">
<% if !workflow_restriction?(presenter) %>
<% if presenter.show_deposit_for?(collections: @user_collections) %>
<input type="checkbox" style="display:none" name="batch_document_ids[]" id="batch_document_<%= presenter.id %>" value="<%= presenter.id %>" class="batch_document_selector" checked="checked" />
<input type="checkbox" aria-label="Batch Documents" style="display:none" name="batch_document_ids[]" id="batch_document_<%= presenter.id %>" value="<%= presenter.id %>" class="batch_document_selector" checked="checked" />
<%= button_tag t('hyrax.dashboard.my.action.add_to_collection'),
class: 'btn btn-secondary submits-batches submits-batches-add',
data: { toggle: "modal", target: "#collection-list-container" } %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/hyrax/my/_search_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</label>

<div class="input-group mb-sm-auto col-sm-9">
<%= text_field_tag :q, current_search_parameters , class: "q form-control", id: "search-field-header", placeholder: t("hyrax.search.form.q.placeholder") %>
<%= text_field_tag :q, current_search_parameters , 'aria-label': 'Search', class: "q form-control", id: "search-field-header", placeholder: t("hyrax.search.form.q.placeholder") %>
<div class="input-group-append">
<button type="submit" class="btn btn-primary" id="search-submit-header">
<%= t('hyrax.search.button.html') %>
Expand Down

0 comments on commit f14958e

Please sign in to comment.