diff --git a/app/views/contributors/_form.html.erb b/app/views/contributors/_form.html.erb index e848cc8cd6..4c9ef30562 100644 --- a/app/views/contributors/_form.html.erb +++ b/app/views/contributors/_form.html.erb @@ -80,7 +80,8 @@ roles_tooltip = _("Select each role that applies to the contributor.") <%= form.check_box hash.keys.first.to_sym, value: hash.values.first, data: { toggle: "tooltip" }, - title: ContributorPresenter.role_tooltip(symbol: hash.keys.first) %> + title: ContributorPresenter.role_tooltip(symbol: hash.keys.first), + aria: { label: ContributorPresenter.role_symbol_to_string(symbol: hash.keys.first) } %> <%= ContributorPresenter.role_symbol_to_string(symbol: hash.keys.first) %> diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 889b85f939..413a834038 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -101,7 +101,6 @@ diff --git a/app/views/layouts/modal_search/_form.html.erb b/app/views/layouts/modal_search/_form.html.erb index a6a15e59cd..cf4501d08b 100644 --- a/app/views/layouts/modal_search/_form.html.erb +++ b/app/views/layouts/modal_search/_form.html.erb @@ -60,7 +60,8 @@ no_results_msg = _("No results matched your filter criteria.") <%= f.text_field :search_term, class: "form-control autocomplete col-md-6", - placeholder: search_placeholder %> + placeholder: search_placeholder, + aria: { label: search_placeholder } %>
<%= f.button _("Apply filter(s)"), diff --git a/app/views/paginable/plans/_privately_visible.html.erb b/app/views/paginable/plans/_privately_visible.html.erb index cc1ad4d421..ceb5476c41 100644 --- a/app/views/paginable/plans/_privately_visible.html.erb +++ b/app/views/paginable/plans/_privately_visible.html.erb @@ -29,6 +29,9 @@ <% if plan.administerable_by?(current_user.id) then %> <%= check_box_tag :is_test, "1", (plan.visibility === "is_test"), class: "set_test_plan", + aria: { + label: "#{plan.title} - test plan flag" + }, data: { remote: true, method: :post, url: set_test_plan_path(plan) } %> <% else %> diff --git a/app/views/plans/_guidance_selection.html.erb b/app/views/plans/_guidance_selection.html.erb index d133819103..57013276e0 100644 --- a/app/views/plans/_guidance_selection.html.erb +++ b/app/views/plans/_guidance_selection.html.erb @@ -6,7 +6,7 @@

<%= _('To help you write your plan, %{application_name} can show you guidance from a variety of organisations.') % { application_name: app_name } %>

-

<%= _('Select up to 6 organisations to see their guidance.') %>

+ <%= _('Select up to 6 organisations to see their guidance.') %>
- <%= form.label(:ethical_issues_description, _('Describe any ethical concerns'), class: 'control-label') %> + <%= form.label(:ethical_issues_description, _('Describe any ethical concerns'), class: 'control-label', id: 'plan-ethical-description') %>
<%= ethics_description_tooltip %> @@ -126,7 +126,7 @@ ethics_report_tooltip = _("Link to a protocol from a meeting with an ethics comm rows: 6, class: 'form-control tinymce', spellcheck: true, - "aria-required": false %> + aria: { required: false, labelledby: 'plan-ethical-description' } %>
diff --git a/app/views/plans/_share_form.html.erb b/app/views/plans/_share_form.html.erb index f9ec141049..da8c51e541 100644 --- a/app/views/plans/_share_form.html.erb +++ b/app/views/plans/_share_form.html.erb @@ -6,10 +6,12 @@ <% permissions_tooltip = _('Co-owner: Has admin-rights to the plan (can invite other users, view the plan, answer questions, or comment). Editor: Has edit-rights to the plan (can view the plan, answer questions, or comment). Read Only: Has read-rights to the plan (can view the plan or comment)') %>

<%= _('Set plan visibility') %>

-

<%= _('Public or organisational visibility is intended for finished plans. You must answer at least %{percentage}%% of the questions to enable these options. Note: test plans are set to private visibility by default.') % { :percentage => Rails.configuration.x.plans.default_percentage_answered } %>

<% allow_visibility = @plan.visibility_allowed? %> <%= form_with model: @plan, id: "set_visibility" do |f| %> > + +

<%= _('Public or organisational visibility is intended for finished plans. You must answer at least %{percentage}%% of the questions to enable these options. Note: test plans are set to private visibility by default.') % { :percentage => Rails.configuration.x.plans.default_percentage_answered } %>

+
<%= label_tag :visibility_privately_visible do %> diff --git a/app/views/plans/new.html.erb b/app/views/plans/new.html.erb index f30598a83e..d2d3ed23bb 100644 --- a/app/views/plans/new.html.erb +++ b/app/views/plans/new.html.erb @@ -24,7 +24,7 @@
<%= project_title_tooltip %> - <%= f.text_field(:title, class: 'form-control', 'aria-describedby': 'project-title', 'aria-required': 'true', 'aria-label': 'project-title', + <%= f.text_field(:title, class: 'form-control', 'aria-labelledby': 'project-title', 'aria-required': 'true', 'aria-label': 'project-title', 'data-toggle': 'tooltip', 'data-placement': 'bottom', spellcheck: true, @@ -109,7 +109,7 @@
<%= select_tag(:plan_template_id, "", name: 'plan[template_id]', - class: 'form-control', 'aria-describedby': 'template-selection') %> + class: 'form-control', 'aria-labelledby': 'template-selection') %>
diff --git a/app/views/questions/_new_edit_question_textarea.html.erb b/app/views/questions/_new_edit_question_textarea.html.erb index 0c12f5489d..ae52892b9c 100644 --- a/app/views/questions/_new_edit_question_textarea.html.erb +++ b/app/views/questions/_new_edit_question_textarea.html.erb @@ -8,7 +8,7 @@ within a paragraph. %>
-
+
<%= f.label(:text, sanitize(question.text), class: 'control-label') %>
<% if locking || readonly %> @@ -16,6 +16,6 @@ <%= sanitize("

#{answer.text || question.default_value}

") %>
<% else %> - <%= text_area_tag('answer[text]', answer.text || question.default_value, id: "answer-text-#{question.id}", class: "form-control tinymce_answer") %> + <%= text_area_tag('answer[text]', answer.text || question.default_value, id: "answer-text-#{question.id}", class: "form-control tinymce_answer", aria: { labelledby: "question-text-#{question.id}" }) %> <% end %>
\ No newline at end of file diff --git a/app/views/research_outputs/_form.html.erb b/app/views/research_outputs/_form.html.erb index 4f34ebd62e..4e6dcb6373 100644 --- a/app/views/research_outputs/_form.html.erb +++ b/app/views/research_outputs/_form.html.erb @@ -24,7 +24,7 @@ repository_tooltip = _("Repositories preserve, manage, and provide access to man selected: (research_output.output_type.present? ? research_output.output_type : "" ) }, { class: "form-control", - aria: { required: true }, + aria: { required: true, label: _("Research output type") }, data: { remote: true, url: plan_output_type_selection_path(plan), method: :get } } %>
@@ -56,11 +56,11 @@ repository_tooltip = _("Repositories preserve, manage, and provide access to man
- <%= f.label(:description, _("Description"), class: "control-label") %> + <%= f.label(:description, _("Description"), class: "control-label", id: 'research-output-description') %>
- <%= f.text_area :description, rows: 4, class: 'form-control tinymce', data: { toggle: "tooltip" } %> + <%= f.text_area :description, rows: 4, class: 'form-control tinymce', data: { toggle: "tooltip" }, aria: { labelledby: 'research-output-description' } %>
@@ -161,12 +161,13 @@ repository_tooltip = _("Repositories preserve, manage, and provide access to man
<% file_size = presenter.converted_file_size(size: f.object.byte_size) %> - <%= f.number_field "file_size", min: 1, step: 0.1, value: file_size[:size], class: "form-control" %> + <%= f.number_field "file_size", min: 1, step: 0.1, value: file_size[:size], class: "form-control", aria: { label: _("Anticipated file size") } %> <%= f.select "file_size_unit", options_for_select(presenter.selectable_size_units, file_size[:unit]), { selected: file_size[:unit] }, - { class: "form-control float-left" } %> + { class: "form-control float-left", + aria: { label: _('File size units') } } %>
diff --git a/app/views/research_outputs/licenses/_form.html.erb b/app/views/research_outputs/licenses/_form.html.erb index a77815de1b..6d4db22bd4 100644 --- a/app/views/research_outputs/licenses/_form.html.erb +++ b/app/views/research_outputs/licenses/_form.html.erb @@ -16,7 +16,8 @@ show_preferred = selected.nil? || (selected != 0 && preferred_licenses.map { |ar options = show_preferred ? preferred_licenses : presenter.complete_licenses guidance = show_preferred ? preferred_guidance : default_guidance -args = { include_blank: _("- Please select one -"), selected: selected, class: "form-control" } +args = { include_blank: _("- Please select one -"), selected: selected, class: "form-control", + aria: { label: _('Initial license') } } args[:data] = { remote: true, url: plan_license_selection_path(research_output.plan), method: :get } if show_preferred %>
diff --git a/app/views/research_outputs/repositories/_search.html.erb b/app/views/research_outputs/repositories/_search.html.erb index e83facca88..1b79b93ff4 100644 --- a/app/views/research_outputs/repositories/_search.html.erb +++ b/app/views/research_outputs/repositories/_search.html.erb @@ -11,6 +11,7 @@ options_for_select(ResearchOutputPresenter.selectable_subjects), include_blank: _("- Select a subject area -"), class: "form-control", + aria: { label: _('Select a subject area') }, title: by_subject_tooltip, data: { toggle: "tooltip", placement: "bottom" } %> @@ -20,6 +21,7 @@ options_for_select(ResearchOutputPresenter.selectable_repository_types), include_blank: _("- Select a repository type -"), class: "form-control", + aria: { label: _('Select a repository type') }, title: by_type_tooltip, data: { toggle: "tooltip", placement: "bottom" } %>