Add fieldset for better accessibility with screenreader

pull/6827/head
Henriette Dinger 9 years ago
parent 97a07ea9e9
commit 4b10a2f08d
  1. 14
      app/views/documents/index.html.erb

@ -52,24 +52,28 @@ See doc/COPYRIGHT.rdoc for more details.
<% end %> <% end %>
<% content_for :sidebar do %> <% content_for :sidebar do %>
<h3><%= l(:label_sort_by, '') %></h3>
<%= form_tag({}, :method => :get, class: 'sidebar--document-sort') do %> <%= form_tag({}, :method => :get, class: 'sidebar--document-sort') do %>
<label> <fieldset class="form--fieldset">
<legend class="form--fieldset-legend"><%= l(:label_sort_by, '') %></legend>
<p>
<%= radio_button_tag 'sort_by', 'category', (@sort_by == 'category'), :onclick => 'this.form.submit();' %> <%= radio_button_tag 'sort_by', 'category', (@sort_by == 'category'), :onclick => 'this.form.submit();' %>
<label for="sort_by_category">
<%= Document.human_attribute_name(:category) %> <%= Document.human_attribute_name(:category) %>
</label><br /> </label><br />
<label>
<%= radio_button_tag 'sort_by', 'date', (@sort_by == 'date'), :onclick => 'this.form.submit();' %> <%= radio_button_tag 'sort_by', 'date', (@sort_by == 'date'), :onclick => 'this.form.submit();' %>
<label for="sort_by_date">
<%= l(:label_date) %> <%= l(:label_date) %>
</label><br /> </label><br />
<label>
<%= radio_button_tag 'sort_by', 'title', (@sort_by == 'title'), :onclick => 'this.form.submit();' %> <%= radio_button_tag 'sort_by', 'title', (@sort_by == 'title'), :onclick => 'this.form.submit();' %>
<label for="sort_by_title">
<%= Document.human_attribute_name(:title) %> <%= Document.human_attribute_name(:title) %>
</label><br /> </label><br />
<label>
<%= radio_button_tag 'sort_by', 'author', (@sort_by == 'author'), :onclick => 'this.form.submit();' %> <%= radio_button_tag 'sort_by', 'author', (@sort_by == 'author'), :onclick => 'this.form.submit();' %>
<label for="sort_by_author">
<%= Document.human_attribute_name(:author) %> <%= Document.human_attribute_name(:author) %>
</label> </label>
</p>
</fieldset>
<% end %> <% end %>
<% end %> <% end %>

Loading…
Cancel
Save