mirror of
https://github.com/django/django.git
synced 2025-03-13 19:00:45 +00:00
Fixed #34618 -- Added icon descriptions in "Recent Actions" on the admin index.
This commit is contained in:
parent
2cf76f2d5d
commit
27fed08e5f
@ -1139,3 +1139,16 @@ a.deletelink:focus, a.deletelink:hover {
|
|||||||
.base-svgs {
|
.base-svgs {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.visually-hidden {
|
||||||
|
position: absolute;
|
||||||
|
width: 1px;
|
||||||
|
height: 1px;
|
||||||
|
padding: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
clip: rect(0,0,0,0);
|
||||||
|
white-space: nowrap;
|
||||||
|
border: 0;
|
||||||
|
color: var(--body-fg);
|
||||||
|
background-color: var(--body-bg);
|
||||||
|
}
|
||||||
|
@ -122,16 +122,3 @@ html[data-theme="dark"] .theme-toggle svg.theme-icon-when-dark {
|
|||||||
html[data-theme="light"] .theme-toggle svg.theme-icon-when-light {
|
html[data-theme="light"] .theme-toggle svg.theme-icon-when-light {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.visually-hidden {
|
|
||||||
position: absolute;
|
|
||||||
width: 1px;
|
|
||||||
height: 1px;
|
|
||||||
padding: 0;
|
|
||||||
overflow: hidden;
|
|
||||||
clip: rect(0,0,0,0);
|
|
||||||
white-space: nowrap;
|
|
||||||
border: 0;
|
|
||||||
color: var(--body-fg);
|
|
||||||
background-color: var(--body-bg);
|
|
||||||
}
|
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
<ul class="actionlist">
|
<ul class="actionlist">
|
||||||
{% for entry in admin_log %}
|
{% for entry in admin_log %}
|
||||||
<li class="{% if entry.is_addition %}addlink{% endif %}{% if entry.is_change %}changelink{% endif %}{% if entry.is_deletion %}deletelink{% endif %}">
|
<li class="{% if entry.is_addition %}addlink{% endif %}{% if entry.is_change %}changelink{% endif %}{% if entry.is_deletion %}deletelink{% endif %}">
|
||||||
|
<span class="visually-hidden">{% if entry.is_addition %}{% translate 'Added:' %}{% elif entry.is_change %}{% translate 'Changed:' %}{% elif entry.is_deletion %}{% translate 'Deleted:' %}{% endif %}</span>
|
||||||
{% if entry.is_deletion or not entry.get_admin_url %}
|
{% if entry.is_deletion or not entry.get_admin_url %}
|
||||||
{{ entry.object_repr }}
|
{{ entry.object_repr }}
|
||||||
{% else %}
|
{% else %}
|
||||||
|
@ -3704,6 +3704,22 @@ class AdminViewStringPrimaryKeyTest(TestCase):
|
|||||||
2,
|
2,
|
||||||
change_message="Changed something",
|
change_message="Changed something",
|
||||||
)
|
)
|
||||||
|
LogEntry.objects.log_action(
|
||||||
|
user_pk,
|
||||||
|
content_type_pk,
|
||||||
|
cls.pk,
|
||||||
|
cls.pk,
|
||||||
|
1,
|
||||||
|
change_message="Added something",
|
||||||
|
)
|
||||||
|
LogEntry.objects.log_action(
|
||||||
|
user_pk,
|
||||||
|
content_type_pk,
|
||||||
|
cls.pk,
|
||||||
|
cls.pk,
|
||||||
|
3,
|
||||||
|
change_message="Deleted something",
|
||||||
|
)
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.client.force_login(self.superuser)
|
self.client.force_login(self.superuser)
|
||||||
@ -3762,6 +3778,14 @@ class AdminViewStringPrimaryKeyTest(TestCase):
|
|||||||
should_contain = """<a href="%s">%s</a>""" % (escape(link), escape(self.pk))
|
should_contain = """<a href="%s">%s</a>""" % (escape(link), escape(self.pk))
|
||||||
self.assertContains(response, should_contain)
|
self.assertContains(response, should_contain)
|
||||||
|
|
||||||
|
def test_recentactions_description(self):
|
||||||
|
response = self.client.get(reverse("admin:index"))
|
||||||
|
for operation in ["Added", "Changed", "Deleted"]:
|
||||||
|
with self.subTest(operation):
|
||||||
|
self.assertContains(
|
||||||
|
response, f'<span class="visually-hidden">{operation}:'
|
||||||
|
)
|
||||||
|
|
||||||
def test_deleteconfirmation_link(self):
|
def test_deleteconfirmation_link(self):
|
||||||
""" "
|
""" "
|
||||||
The link from the delete confirmation page referring back to the
|
The link from the delete confirmation page referring back to the
|
||||||
|
Loading…
x
Reference in New Issue
Block a user