1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Address basic accessibility issues

These are super basic issues that were flagged by the axe browser
extension.

I tried to change as few things as possible to avoid breaking anything
that might be making assumptions about the markup on this page.

Generally, there is a lot more work that would need to be done on these
pages to make them as friendly as possible to assistive technologies.

Relevant:
- https://dequeuniversity.com/rules/axe/4.1/landmark-one-main
- https://dequeuniversity.com/rules/axe/4.1/color-contrast
This commit is contained in:
Jacob Herrington 2021-04-07 22:56:20 -05:00
parent 46c19a2c9c
commit 126cd61ed4
No known key found for this signature in database
GPG key ID: 467330728B90A0A0
10 changed files with 28 additions and 24 deletions

View file

@ -1,3 +1,7 @@
* Remove inline styles and address basic accessibilty issues on rescue templates.
*Jacob Herrington*
* Add support for 'private, no-store' Cache-Control headers.
Previously, 'no-store' was exclusive; no other directives could be specified.

View file

@ -1,7 +1,7 @@
<header>
<h1>Blocked host: <%= @host %></h1>
</header>
<div id="container">
<main role="main" id="container">
<h2>To allow requests to <%= @host %>, add the following to your environment configuration:</h2>
<pre>config.hosts &lt;&lt; "<%= @host %>"</pre>
</div>
</main>

View file

@ -7,7 +7,7 @@
</h1>
</header>
<div id="container">
<main role="main" id="container">
<%= render "rescues/message_and_suggestions", exception: @exception %>
<%= render "rescues/actions", exception: @exception, request: @request %>
@ -32,4 +32,4 @@
<% end %>
<%= render template: "rescues/_request_and_response" %>
</div>
</main>

View file

@ -1,4 +1,4 @@
<header>
<header role="banner">
<h1>
<%= @exception.class.to_s %>
<% if @request.parameters['controller'] %>
@ -7,7 +7,7 @@
</h1>
</header>
<div id="container">
<main role="main" id="container">
<h2>
<%= h @exception.message %>
<% if defined?(ActiveStorage) && @exception.message.match?(%r{#{ActiveStorage::Blob.table_name}|#{ActiveStorage::Attachment.table_name}}) %>
@ -21,4 +21,4 @@
<%= render "rescues/source", source_extracts: @source_extracts, show_source_idx: @show_source_idx %>
<%= render "rescues/trace", traces: @traces, trace_to_show: @trace_to_show %>
<%= render template: "rescues/_request_and_response" %>
</div>
</main>

View file

@ -129,7 +129,7 @@
.source .data .line_numbers {
background-color: #ECECEC;
color: #AAA;
color: #555;
padding: 1em .5em;
border-right: 1px solid #DDD;
text-align: right;
@ -261,7 +261,7 @@
</head>
<body>
<%= yield %>
<%= yield %>
</body>
</html>

View file

@ -1,8 +1,8 @@
<header>
<header role="banner">
<h1>No template for interactive request</h1>
</header>
<div id="container">
<main id="container">
<h2><%= h @exception.message %></h2>
<p class="summary">
@ -16,4 +16,4 @@
since we expect an HTML template
to be rendered for such requests. If that's the case, carry on.
</p>
</div>
</main>

View file

@ -1,11 +1,11 @@
<header>
<header role="banner">
<h1>Template is missing</h1>
</header>
<div id="container">
<main role="main" id="container">
<h2><%= h @exception.message %></h2>
<%= render "rescues/source", source_extracts: @source_extracts, show_source_idx: @show_source_idx %>
<%= render "rescues/trace", traces: @traces, trace_to_show: @trace_to_show %>
<%= render template: "rescues/_request_and_response" %>
</div>
</main>

View file

@ -1,7 +1,7 @@
<header>
<header role="banner">
<h1>Routing Error</h1>
</header>
<div id="container">
<main role="main" id="container">
<h2><%= h @exception.message %></h2>
<% unless @exception.failures.empty? %>
<p>
@ -29,4 +29,4 @@
<% end %>
<%= render template: "rescues/_request_and_response" %>
</div>
</main>

View file

@ -1,11 +1,11 @@
<header>
<header role="banner">
<h1>
<%= @exception.cause.class.to_s %> in
<%= @request.parameters["controller"].camelize if @request.parameters["controller"] %>#<%= @request.parameters["action"] %>
</h1>
</header>
<div id="container">
<main role="main" id="container">
<p>
Showing <i><%= @exception.file_name %></i> where line <b>#<%= @exception.line_number %></b> raised:
</p>
@ -17,4 +17,4 @@
<%= render "rescues/trace", traces: @traces, trace_to_show: @trace_to_show %>
<%= render template: "rescues/_request_and_response" %>
</div>
</main>

View file

@ -1,6 +1,6 @@
<header>
<header role="banner">
<h1>Unknown action</h1>
</header>
<div id="container">
<main role="main" id="container">
<%= render "rescues/message_and_suggestions", exception: @exception %>
</div>
</main>