mirror of
https://github.com/django/django.git
synced 2025-08-21 01:09:13 +00:00
Regression in 849f8307a5bb33465252d0891a9b2c47dde65889. In order to prevent underlines on links styled like buttons, role="button" was added. This has been removed and the style updated to reflect that these are links.
This commit is contained in:
parent
94c2f3b993
commit
792ca148a2
@ -129,7 +129,8 @@ a:not(
|
|||||||
[role="button"],
|
[role="button"],
|
||||||
#header a,
|
#header a,
|
||||||
#nav-sidebar a,
|
#nav-sidebar a,
|
||||||
#content-main.app-list a
|
#content-main.app-list a,
|
||||||
|
.object-tools a,
|
||||||
) {
|
) {
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
{% block object-tools-items %}
|
{% block object-tools-items %}
|
||||||
<li>
|
<li>
|
||||||
{% url opts|admin_urlname:'history' original.pk|admin_urlquote as history_url %}
|
{% url opts|admin_urlname:'history' original.pk|admin_urlquote as history_url %}
|
||||||
<a role="button" href="{% add_preserved_filters history_url %}" class="historylink">{% translate "History" %}</a>
|
<a href="{% add_preserved_filters history_url %}" class="historylink">{% translate "History" %}</a>
|
||||||
</li>
|
</li>
|
||||||
{% if has_absolute_url %}<li><a href="{{ absolute_url }}" class="viewsitelink">{% translate "View on site" %}</a></li>{% endif %}
|
{% if has_absolute_url %}<li><a href="{{ absolute_url }}" class="viewsitelink">{% translate "View on site" %}</a></li>{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
{% if has_add_permission %}
|
{% if has_add_permission %}
|
||||||
<li>
|
<li>
|
||||||
{% url cl.opts|admin_urlname:'add' as add_url %}
|
{% url cl.opts|admin_urlname:'add' as add_url %}
|
||||||
<a role="button" href="{% add_preserved_filters add_url is_popup to_field %}" class="addlink">
|
<a href="{% add_preserved_filters add_url is_popup to_field %}" class="addlink">
|
||||||
{% blocktranslate with cl.opts.verbose_name as name %}Add {{ name }}{% endblocktranslate %}
|
{% blocktranslate with cl.opts.verbose_name as name %}Add {{ name }}{% endblocktranslate %}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
@ -4086,7 +4086,7 @@ class AdminViewStringPrimaryKeyTest(TestCase):
|
|||||||
)
|
)
|
||||||
self.assertContains(
|
self.assertContains(
|
||||||
response,
|
response,
|
||||||
'<a role="button" href="%s" class="historylink"' % escape(expected_link),
|
'<a href="%s" class="historylink"' % escape(expected_link),
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_redirect_on_add_view_continue_button(self):
|
def test_redirect_on_add_view_continue_button(self):
|
||||||
@ -6956,6 +6956,34 @@ class SeleniumTests(AdminSeleniumTestCase):
|
|||||||
with self.wait_page_loaded():
|
with self.wait_page_loaded():
|
||||||
save_button.click()
|
save_button.click()
|
||||||
|
|
||||||
|
@screenshot_cases(["desktop_size", "mobile_size", "rtl", "dark", "high_contrast"])
|
||||||
|
def test_object_tools(self):
|
||||||
|
from selenium.webdriver.common.by import By
|
||||||
|
|
||||||
|
state = State.objects.create(name="Korea")
|
||||||
|
city = City.objects.create(state=state, name="Gwangju")
|
||||||
|
self.admin_login(
|
||||||
|
username="super", password="secret", login_url=reverse("admin:index")
|
||||||
|
)
|
||||||
|
self.selenium.get(
|
||||||
|
self.live_server_url + reverse("admin:admin_views_city_changelist")
|
||||||
|
)
|
||||||
|
object_tools = self.selenium.find_elements(
|
||||||
|
By.CSS_SELECTOR, "ul.object-tools li a"
|
||||||
|
)
|
||||||
|
self.assertEqual(len(object_tools), 1)
|
||||||
|
self.take_screenshot("changelist")
|
||||||
|
|
||||||
|
self.selenium.get(
|
||||||
|
self.live_server_url
|
||||||
|
+ reverse("admin:admin_views_city_change", args=(city.pk,))
|
||||||
|
)
|
||||||
|
object_tools = self.selenium.find_elements(
|
||||||
|
By.CSS_SELECTOR, "ul.object-tools li a"
|
||||||
|
)
|
||||||
|
self.assertEqual(len(object_tools), 2)
|
||||||
|
self.take_screenshot("changeform")
|
||||||
|
|
||||||
@screenshot_cases(["desktop_size", "mobile_size", "rtl", "dark", "high_contrast"])
|
@screenshot_cases(["desktop_size", "mobile_size", "rtl", "dark", "high_contrast"])
|
||||||
def test_long_header_with_object_tools_layout(self):
|
def test_long_header_with_object_tools_layout(self):
|
||||||
from selenium.webdriver.common.by import By
|
from selenium.webdriver.common.by import By
|
||||||
@ -8415,7 +8443,7 @@ class AdminKeepChangeListFiltersTests(TestCase):
|
|||||||
|
|
||||||
# Check the history link.
|
# Check the history link.
|
||||||
history_link = re.search(
|
history_link = re.search(
|
||||||
'<a role="button" href="(.*?)" class="historylink">History</a>',
|
'<a href="(.*?)" class="historylink">History</a>',
|
||||||
response.text,
|
response.text,
|
||||||
)
|
)
|
||||||
self.assertURLEqual(history_link[1], self.get_history_url())
|
self.assertURLEqual(history_link[1], self.get_history_url())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user