These fields have no label associated to them. While it's more or less obvious for sighted users that these fields are associated with the table cell next to them, visually impaired users might not get that association when using the screen reader in forms mode. Note we're using `aria-label` instead of `aria-labelledby`. IMHO in this case `aria-labelledby` is the superior method because it guarantees the text is present for both sighted and visually impaired users. However, testing for fields with no label other than the one provided by `aria-labelledby` is hard since Capybara has no support for this attribute. So we're using `aria-label` and testing the presence of the text on the page (with the `within "tr", text:` statements) as well as the ARIA label (with the `fill_in` statements).
33 lines
1.0 KiB
Plaintext
33 lines
1.0 KiB
Plaintext
<table>
|
|
<thead>
|
|
<tr>
|
|
<th><%= display_setting_name(setting_name) %></th>
|
|
<th><%= t("admin.settings.setting_value") %></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<% settings.each do |setting| %>
|
|
<tr>
|
|
<td class="small-6">
|
|
<strong><%= t("settings.#{setting.key}") %></strong>
|
|
<br>
|
|
<span id="<%= dom_id(setting, :description) %>" class="small">
|
|
<%= t("settings.#{setting.key}_description", default: t("admin.settings.no_description")) %>
|
|
</span>
|
|
</td>
|
|
<td class="small-6">
|
|
<% if setting.content_type? %>
|
|
<%= render "admin/settings/content_types_settings_form", setting: setting %>
|
|
<% else %>
|
|
<% if defined?(tab) %>
|
|
<%= render "admin/settings/settings_form", setting: setting, tab: tab %>
|
|
<% else %>
|
|
<%= render "admin/settings/settings_form", setting: setting %>
|
|
<% end %>
|
|
<% end %>
|
|
</td>
|
|
</tr>
|
|
<% end %>
|
|
</tbody>
|
|
</table>
|