diff options
| author | laserhyena <laserhyena95@gmail.com> | 2023-10-19 15:48:12 -0400 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2023-10-20 06:20:32 +0200 |
| commit | bba963df50f73f14f7e48f285f9bc920e48093cb (patch) | |
| tree | 74a4aa96ba526921321957ae520e5b797cc96f55 | |
| parent | 31bdf67a9c443c9acfee8eba53e8f7a3f379241f (diff) | |
[5.0.x] Fixed #34911 -- Corrected HTML heading levels on admindocs' main page.
Backport of 21382e2743d06efbf5623e7c9b6dccf2a325669b from main
| -rw-r--r-- | django/contrib/admindocs/templates/admin_doc/index.html | 10 | ||||
| -rw-r--r-- | tests/admin_views/tests.py | 11 |
2 files changed, 16 insertions, 5 deletions
diff --git a/django/contrib/admindocs/templates/admin_doc/index.html b/django/contrib/admindocs/templates/admin_doc/index.html index 1be7873632..1b95a210b3 100644 --- a/django/contrib/admindocs/templates/admin_doc/index.html +++ b/django/contrib/admindocs/templates/admin_doc/index.html @@ -14,19 +14,19 @@ <h1>{% translate 'Documentation' %}</h1> <div id="content-main"> - <h3><a href="tags/">{% translate 'Tags' %}</a></h3> + <h2><a href="tags/">{% translate 'Tags' %}</a></h2> <p>{% translate 'List of all the template tags and their functions.' %}</p> - <h3><a href="filters/">{% translate 'Filters' %}</a></h3> + <h2><a href="filters/">{% translate 'Filters' %}</a></h2> <p>{% translate 'Filters are actions which can be applied to variables in a template to alter the output.' %}</p> - <h3><a href="models/">{% translate 'Models' %}</a></h3> + <h2><a href="models/">{% translate 'Models' %}</a></h2> <p>{% translate 'Models are descriptions of all the objects in the system and their associated fields. Each model has a list of fields which can be accessed as template variables' %}.</p> - <h3><a href="views/">{% translate 'Views' %}</a></h3> + <h2><a href="views/">{% translate 'Views' %}</a></h2> <p>{% translate 'Each page on the public site is generated by a view. The view defines which template is used to generate the page and which objects are available to that template.' %}</p> - <h3><a href="bookmarklets/">{% translate 'Bookmarklets' %}</a></h3> + <h2><a href="bookmarklets/">{% translate 'Bookmarklets' %}</a></h2> <p>{% translate 'Tools for your browser to quickly access admin functionality.' %}</p> </div> diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py index 3ab9fd6a26..a6a897d5aa 100644 --- a/tests/admin_views/tests.py +++ b/tests/admin_views/tests.py @@ -7568,6 +7568,17 @@ class AdminDocsTest(TestCase): response, '<li><a href="#built_in-add">add</a></li>', html=True ) + def test_index_headers(self): + response = self.client.get(reverse("django-admindocs-docroot")) + self.assertContains(response, "<h1>Documentation</h1>") + self.assertContains(response, '<h2><a href="tags/">Tags</a></h2>') + self.assertContains(response, '<h2><a href="filters/">Filters</a></h2>') + self.assertContains(response, '<h2><a href="models/">Models</a></h2>') + self.assertContains(response, '<h2><a href="views/">Views</a></h2>') + self.assertContains( + response, '<h2><a href="bookmarklets/">Bookmarklets</a></h2>' + ) + @override_settings( ROOT_URLCONF="admin_views.urls", |
