diff options
| author | Thibaud Colas <thibaudcolas@gmail.com> | 2020-09-29 00:43:19 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-11-20 19:18:07 +0100 |
| commit | a1215a3237ff53941d606fc54d926495e454c2d9 (patch) | |
| tree | da3989c4bb7dd0cb2d724fa94efff6421928e918 | |
| parent | 20f2b822f8bc9138e39a2517371a7b4a98ca1ff5 (diff) | |
Fixed #32053 -- Fixed accessibility issues on the 'Congrats' page.
- Add lang attribute.
- Use the same text for the page’s main heading, and title.
- Add underlines for all links in copy.
- Stop using h2 for link to the Django page.
- Use h1 for the main heading.
- Remove useless type attribute on style element.
- Remove grey text that fails contrast checks.
- Use a shade of grey that passes AAA contrast requirements.
- Stop using h4 for footer links.
- Add full stop in block-level links so VoiceOver correctly pauses
between runs of text.
- Hide main artwork for screen reader users.
- Update SVG icons markup to be screen-reader friendly.
- Switch options to be block-level links.
- Remove unused markup.
| -rw-r--r-- | django/views/templates/default_urlconf.html | 166 | ||||
| -rw-r--r-- | tests/view_tests/tests/test_debug.py | 2 |
2 files changed, 72 insertions, 96 deletions
diff --git a/django/views/templates/default_urlconf.html b/django/views/templates/default_urlconf.html index e8e180f8bc..5092377bf4 100644 --- a/django/views/templates/default_urlconf.html +++ b/django/views/templates/default_urlconf.html @@ -1,19 +1,18 @@ {% load i18n %} <!doctype html> -{% get_current_language_bidi as LANGUAGE_BIDI %} -<html dir="{{ LANGUAGE_BIDI|yesno:'rtl,ltr,auto' }}"> +{% get_current_language as LANGUAGE_CODE %}{% get_current_language_bidi as LANGUAGE_BIDI %} +<html lang="{{ LANGUAGE_CODE|default:'en-us' }}" dir="{{ LANGUAGE_BIDI|yesno:'rtl,ltr,auto' }}"> <head> <meta charset="utf-8"> - <title>{% translate "Django: the Web framework for perfectionists with deadlines." %}</title> + <title>{% translate "The install worked successfully! Congratulations!" %}</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" type="text/css" href="/static/admin/css/fonts.css"> - <style type="text/css"> + <style> html { line-height: 1.15; } a { color: #19865C; - text-decoration: none; } header { border-bottom: 1px solid #efefef; @@ -43,22 +42,16 @@ } .logo { float: left; - } - .logo h2 { font-weight: 700; - margin-top: 0px; + font-size: 1.375rem; + text-decoration: none; } .release-notes { float: right; margin-top: 7px; } - .release-notes p { - font-size: 14px; - } .figure { margin-top: 19vh; - } - .figure__animation { max-width: 265px; position: relative; z-index: -9; @@ -104,17 +97,15 @@ animation: none; } } - h2 { - font-size: 22px; - max-width: 500px; + h1 { + font-size: 1.375rem; + max-width: 32rem; margin: 5px auto 0; } main p { - font-size: 16px; - line-height: 20px; - max-width: 410px; + line-height: 1.25; + max-width: 26rem; margin: 15px auto 0; - color: #888888; } footer { padding: 25px 0; @@ -127,14 +118,16 @@ border-top: 1px solid #efefef; } .option { + display: block; float: left; width: 33.33%; box-sizing: border-box; padding-right: 5px; + text-decoration: none; } .option svg { - width: 25px; - height: 25px; + width: 1.5rem; + height: 1.5rem; fill: gray; border: 1px solid #d6d6d6; padding: 5px; @@ -142,26 +135,21 @@ float: left; margin-right: 10px; } - .option div { + .option p { + font-weight: 300; + line-height: 1.25; + color: #525252; display: table; } - .option h4 { + .option .option__heading { color: #19865C; - font-size: 19px; - } - .option p { - font-weight: 300; - font-size: 15px; - padding-top: 3px; - color: #757575; + font-size: 1.25rem; + font-weight: 400; } @media (max-width: 996px) { body, footer { max-width: 780px; } - .logo h2 { - margin-left: 0px; - } } @media (max-width: 800px) { footer, main { @@ -192,11 +180,8 @@ main { padding: 0 25px; } - main h2 { - font-size: 18px; - } - main p { - font-size: 14px; + main h1 { + font-size: 1.25rem; } header { padding-left: 20px; @@ -222,78 +207,69 @@ margin-top: 50px; } } + .sr-only { + clip: rect(1px, 1px, 1px, 1px); + clip-path: inset(50%); + height: 1px; + overflow: hidden; + position: absolute; + white-space: nowrap; + width: 1px; + } </style> </head> <body> <header class="u-clearfix"> - <div class="logo"> - <a href="https://www.djangoproject.com/" target="_blank" rel="noopener"> - <h2>django</h2> - </a> - </div> + <a class="logo" href="https://www.djangoproject.com/" target="_blank" rel="noopener"> + django + </a> <div class="release-notes"> <p>{% blocktranslate %}View <a href="https://docs.djangoproject.com/en/{{ version }}/releases/" target="_blank" rel="noopener">release notes</a> for Django {{ version }}{% endblocktranslate %}</p> </div> </header> <main> - <div class="figure"> - <svg class="figure__animation" viewBox="0 0 508 268"> - <path d="M305.2 156.6c0 4.6-.5 9-1.6 13.2-2.5-4.4-5.6-8.4-9.2-12-4.6-4.6-10-8.4-16-11.2 2.8-11.2 4.5-22.9 5-34.6 1.8 1.4 3.5 2.9 5 4.5 10.5 10.3 16.8 24.5 16.8 40.1zm-75-10c-6 2.8-11.4 6.6-16 11.2-3.5 3.6-6.6 7.6-9.1 12-1-4.3-1.6-8.7-1.6-13.2 0-15.7 6.3-29.9 16.6-40.1 1.6-1.6 3.3-3.1 5.1-4.5.6 11.8 2.2 23.4 5 34.6z" fill="#2E3B39" fill-rule="nonzero"/> - <path d="M282.981 152.6c16.125-48.1 6.375-104-29.25-142.6-35.625 38.5-45.25 94.5-29.25 142.6h58.5z" stroke="#FFF" stroke-width="3.396" fill="#6DDCBD"/> - <path d="M271 29.7c-4.4-10.6-9.9-20.6-16.6-29.7-6.7 9-12.2 19-16.6 29.7H271z" stroke="#FFF" stroke-width="3" fill="#2E3B39"/> - <circle fill="#FFF" cx="254.3" cy="76.8" r="15.5"/> - <circle stroke="#FFF" stroke-width="7" fill="#6DDCBD" cx="254.3" cy="76.8" r="12.2"/> - <path class="smoke" d="M507.812 234.24c0-2.16-.632-4.32-1.58-6.24-3.318-6.72-11.85-11.52-21.804-11.52-1.106 0-2.212.12-3.318.24-.474-11.52-12.956-20.76-28.282-20.76-3.318 0-6.636.48-9.638 1.32-4.74-6.72-14.062-11.28-24.806-11.28-.79 0-1.58 0-2.37.12-.79 0-1.58-.12-2.37-.12-10.744 0-20.066 4.56-24.806 11.28a35.326 35.326 0 00-9.638-1.32c-15.642 0-28.282 9.6-28.282 21.48 0 1.32.158 2.76.474 3.96a26.09 26.09 0 00-4.424-.36c-8.058 0-15.01 3.12-19.118 7.8-3.476-1.68-7.742-2.76-12.324-2.76-12.008 0-21.804 7.08-22.752 15.96h-.158c-9.322 0-17.38 4.32-20.856 10.44-4.108-3.6-10.27-6-17.222-6h-1.264c-6.794 0-12.956 2.28-17.222 6-3.476-6.12-11.534-10.44-20.856-10.44h-.158c-.948-9-10.744-15.96-22.752-15.96-4.582 0-8.69.96-12.324 2.76-4.108-4.68-11.06-7.8-19.118-7.8-1.422 0-3.002.12-4.424.36.316-1.32.474-2.64.474-3.96 0-11.88-12.64-21.48-28.282-21.48-3.318 0-6.636.48-9.638 1.32-4.74-6.72-14.062-11.28-24.806-11.28-.79 0-1.58 0-2.37.12-.79 0-1.58-.12-2.37-.12-10.744 0-20.066 4.56-24.806 11.28a35.326 35.326 0 00-9.638-1.32c-15.326 0-27.808 9.24-28.282 20.76-1.106-.12-2.212-.24-3.318-.24-9.954 0-18.486 4.8-21.804 11.52-.948 1.92-1.58 4.08-1.58 6.24 0 4.8 2.528 9.12 6.636 12.36-.79 1.44-1.264 3.12-1.264 4.8 0 7.2 7.742 13.08 17.222 13.08h462.15c9.48 0 17.222-5.88 17.222-13.08 0-1.68-.474-3.36-1.264-4.8 4.582-3.24 7.11-7.56 7.11-12.36z" fill="#E6E9EE"/> - <path fill="#6DDCBD" d="M239 152h30v8h-30z"/> - <path class="exhaust__line" fill="#E6E9EE" d="M250 172h7v90h-7z"/> - <path class="flame" d="M250.27 178.834l-5.32-8.93s-2.47-5.7 3.458-6.118h10.26s6.232.266 3.306 6.194l-5.244 8.93s-3.23 4.37-6.46 0v-.076z" fill="#AA2247"/> - </svg> - </div> - <h2>{% translate "The install worked successfully! Congratulations!" %}</h2> + <svg class="figure" viewBox="0 0 508 268" aria-hidden="true"> + <path d="M305.2 156.6c0 4.6-.5 9-1.6 13.2-2.5-4.4-5.6-8.4-9.2-12-4.6-4.6-10-8.4-16-11.2 2.8-11.2 4.5-22.9 5-34.6 1.8 1.4 3.5 2.9 5 4.5 10.5 10.3 16.8 24.5 16.8 40.1zm-75-10c-6 2.8-11.4 6.6-16 11.2-3.5 3.6-6.6 7.6-9.1 12-1-4.3-1.6-8.7-1.6-13.2 0-15.7 6.3-29.9 16.6-40.1 1.6-1.6 3.3-3.1 5.1-4.5.6 11.8 2.2 23.4 5 34.6z" fill="#2E3B39" fill-rule="nonzero"/> + <path d="M282.981 152.6c16.125-48.1 6.375-104-29.25-142.6-35.625 38.5-45.25 94.5-29.25 142.6h58.5z" stroke="#FFF" stroke-width="3.396" fill="#6DDCBD"/> + <path d="M271 29.7c-4.4-10.6-9.9-20.6-16.6-29.7-6.7 9-12.2 19-16.6 29.7H271z" stroke="#FFF" stroke-width="3" fill="#2E3B39"/> + <circle fill="#FFF" cx="254.3" cy="76.8" r="15.5"/> + <circle stroke="#FFF" stroke-width="7" fill="#6DDCBD" cx="254.3" cy="76.8" r="12.2"/> + <path class="smoke" d="M507.812 234.24c0-2.16-.632-4.32-1.58-6.24-3.318-6.72-11.85-11.52-21.804-11.52-1.106 0-2.212.12-3.318.24-.474-11.52-12.956-20.76-28.282-20.76-3.318 0-6.636.48-9.638 1.32-4.74-6.72-14.062-11.28-24.806-11.28-.79 0-1.58 0-2.37.12-.79 0-1.58-.12-2.37-.12-10.744 0-20.066 4.56-24.806 11.28a35.326 35.326 0 00-9.638-1.32c-15.642 0-28.282 9.6-28.282 21.48 0 1.32.158 2.76.474 3.96a26.09 26.09 0 00-4.424-.36c-8.058 0-15.01 3.12-19.118 7.8-3.476-1.68-7.742-2.76-12.324-2.76-12.008 0-21.804 7.08-22.752 15.96h-.158c-9.322 0-17.38 4.32-20.856 10.44-4.108-3.6-10.27-6-17.222-6h-1.264c-6.794 0-12.956 2.28-17.222 6-3.476-6.12-11.534-10.44-20.856-10.44h-.158c-.948-9-10.744-15.96-22.752-15.96-4.582 0-8.69.96-12.324 2.76-4.108-4.68-11.06-7.8-19.118-7.8-1.422 0-3.002.12-4.424.36.316-1.32.474-2.64.474-3.96 0-11.88-12.64-21.48-28.282-21.48-3.318 0-6.636.48-9.638 1.32-4.74-6.72-14.062-11.28-24.806-11.28-.79 0-1.58 0-2.37.12-.79 0-1.58-.12-2.37-.12-10.744 0-20.066 4.56-24.806 11.28a35.326 35.326 0 00-9.638-1.32c-15.326 0-27.808 9.24-28.282 20.76-1.106-.12-2.212-.24-3.318-.24-9.954 0-18.486 4.8-21.804 11.52-.948 1.92-1.58 4.08-1.58 6.24 0 4.8 2.528 9.12 6.636 12.36-.79 1.44-1.264 3.12-1.264 4.8 0 7.2 7.742 13.08 17.222 13.08h462.15c9.48 0 17.222-5.88 17.222-13.08 0-1.68-.474-3.36-1.264-4.8 4.582-3.24 7.11-7.56 7.11-12.36z" fill="#E6E9EE"/> + <path fill="#6DDCBD" d="M239 152h30v8h-30z"/> + <path class="exhaust__line" fill="#E6E9EE" d="M250 172h7v90h-7z"/> + <path class="flame" d="M250.27 178.834l-5.32-8.93s-2.47-5.7 3.458-6.118h10.26s6.232.266 3.306 6.194l-5.244 8.93s-3.23 4.37-6.46 0v-.076z" fill="#AA2247"/> + </svg> + <h1>{% translate "The install worked successfully! Congratulations!" %}</h1> <p>{% blocktranslate %}You are seeing this page because <a href="https://docs.djangoproject.com/en/{{ version }}/ref/settings/#debug" target="_blank" rel="noopener">DEBUG=True</a> is in your settings file and you have not configured any URLs.{% endblocktranslate %}</p> </main> <footer class="u-clearfix"> - <a href="https://docs.djangoproject.com/en/{{ version }}/" target="_blank" rel="noopener"> - <div class="option one"> - <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> - <defs> - <path d="M0 0h24v24H0V0z" id="a"></path> - </defs> - <clipPath id="b"> - <use overflow="visible" xlink:href="#a"></use> - </clipPath> - <path clip-path="url(#b)" d="M9 21c0 .55.45 1 1 1h4c.55 0 1-.45 1-1v-1H9v1zm3-19C8.14 2 5 5.14 5 9c0 2.38 1.19 4.47 3 5.74V17c0 .55.45 1 1 1h6c.55 0 1-.45 1-1v-2.26c1.81-1.27 3-3.36 3-5.74 0-3.86-3.14-7-7-7zm2.85 11.1l-.85.6V16h-4v-2.3l-.85-.6C7.8 12.16 7 10.63 7 9c0-2.76 2.24-5 5-5s5 2.24 5 5c0 1.63-.8 3.16-2.15 4.1z"></path> - </svg> - <div> - <h4>{% translate "Django Documentation" %}</h4> - <p>{% translate 'Topics, references, & how-to’s' %}</p> - </div> - </div> - </a> - <a href="https://docs.djangoproject.com/en/{{ version }}/intro/tutorial01/" target="_blank" rel="noopener"> - <div class="option two"> - <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"> - <path d="M0 0h24v24H0V0z" fill="none"></path> + <a class="option one" href="https://docs.djangoproject.com/en/{{ version }}/" target="_blank" rel="noopener"> + <svg viewBox="0 0 24 24" aria-hidden="true"> + <path d="M9 21c0 .55.45 1 1 1h4c.55 0 1-.45 1-1v-1H9v1zm3-19C8.14 2 5 5.14 5 9c0 2.38 1.19 4.47 3 5.74V17c0 .55.45 1 1 1h6c.55 0 1-.45 1-1v-2.26c1.81-1.27 3-3.36 3-5.74 0-3.86-3.14-7-7-7zm2.85 11.1l-.85.6V16h-4v-2.3l-.85-.6A4.997 4.997 0 017 9c0-2.76 2.24-5 5-5s5 2.24 5 5c0 1.63-.8 3.16-2.15 4.1z"></path> + </svg> + <p> + <span class="option__heading">{% translate "Django Documentation" %}</span><span class="sr-only">.</span><br> + {% translate 'Topics, references, & how-to’s' %} + </p> + </a> + <a class="option two" href="https://docs.djangoproject.com/en/{{ version }}/intro/tutorial01/" target="_blank" rel="noopener"> + <svg viewBox="0 0 24 24" aria-hidden="true"> <path d="M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z"></path> </svg> - <div> - <h4>{% translate "Tutorial: A Polling App" %}</h4> - <p>{% translate "Get started with Django" %}</p> - </div> - </div> - </a> - <a href="https://www.djangoproject.com/community/" target="_blank" rel="noopener"> - <div class="option three"> - <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"> - <path d="M0 0h24v24H0z" fill="none"></path> + <p> + <span class="option__heading">{% translate "Tutorial: A Polling App" %}</span><span class="sr-only">.</span><br> + {% translate "Get started with Django" %} + </p> + </a> + <a class="option three" href="https://www.djangoproject.com/community/" target="_blank" rel="noopener"> + <svg viewBox="0 0 24 24" aria-hidden="true"> <path d="M16.5 13c-1.2 0-3.07.34-4.5 1-1.43-.67-3.3-1-4.5-1C5.33 13 1 14.08 1 16.25V19h22v-2.75c0-2.17-4.33-3.25-6.5-3.25zm-4 4.5h-10v-1.25c0-.54 2.56-1.75 5-1.75s5 1.21 5 1.75v1.25zm9 0H14v-1.25c0-.46-.2-.86-.52-1.22.88-.3 1.96-.53 3.02-.53 2.44 0 5 1.21 5 1.75v1.25zM7.5 12c1.93 0 3.5-1.57 3.5-3.5S9.43 5 7.5 5 4 6.57 4 8.5 5.57 12 7.5 12zm0-5.5c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2zm9 5.5c1.93 0 3.5-1.57 3.5-3.5S18.43 5 16.5 5 13 6.57 13 8.5s1.57 3.5 3.5 3.5zm0-5.5c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2z"></path> </svg> - <div> - <h4>{% translate "Django Community" %}</h4> - <p>{% translate "Connect, get help, or contribute" %}</p> - </div> - </div> - </a> + <p> + <span class="option__heading">{% translate "Django Community" %}</span><span class="sr-only">.</span><br> + {% translate "Connect, get help, or contribute" %} + </p> + </a> </footer> </body> </html> diff --git a/tests/view_tests/tests/test_debug.py b/tests/view_tests/tests/test_debug.py index a0da6e1adc..35a44451f2 100644 --- a/tests/view_tests/tests/test_debug.py +++ b/tests/view_tests/tests/test_debug.py @@ -243,7 +243,7 @@ class DebugViewTests(SimpleTestCase): response = self.client.get('/') self.assertContains( response, - "<h2>The install worked successfully! Congratulations!</h2>" + "<h1>The install worked successfully! Congratulations!</h1>" ) @override_settings(ROOT_URLCONF='view_tests.regression_21530_urls') |
