mirror of
https://github.com/django/django.git
synced 2025-03-06 15:32:33 +00:00
[5.2.x] Fixed #36055 -- Prevented overlap of object-tools buttons and page header in the admin.
Backport of b1324a680add78de24c763911d0eefa19b9263bc from main.
This commit is contained in:
parent
303c2569da
commit
d03102a5a8
@ -773,7 +773,6 @@ a.deletelink:focus, a.deletelink:hover {
|
|||||||
padding-left: 0;
|
padding-left: 0;
|
||||||
float: right;
|
float: right;
|
||||||
position: relative;
|
position: relative;
|
||||||
margin-top: -48px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.object-tools li {
|
.object-tools li {
|
||||||
@ -821,6 +820,10 @@ a.deletelink:focus, a.deletelink:hover {
|
|||||||
background-image: url(../img/tooltag-add.svg);
|
background-image: url(../img/tooltag-add.svg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.object-tools:has(a.addlink) {
|
||||||
|
margin-top: -48px;
|
||||||
|
}
|
||||||
|
|
||||||
/* OBJECT HISTORY */
|
/* OBJECT HISTORY */
|
||||||
|
|
||||||
#change-history table {
|
#change-history table {
|
||||||
|
@ -98,9 +98,9 @@
|
|||||||
<div id="content" class="{% block coltype %}colM{% endblock %}">
|
<div id="content" class="{% block coltype %}colM{% endblock %}">
|
||||||
{% block pretitle %}{% endblock %}
|
{% block pretitle %}{% endblock %}
|
||||||
{% block content_title %}{% if title %}<h1>{{ title }}</h1>{% endif %}{% endblock %}
|
{% block content_title %}{% if title %}<h1>{{ title }}</h1>{% endif %}{% endblock %}
|
||||||
|
{% block object-tools %}{% endblock %}
|
||||||
{% block content_subtitle %}{% if subtitle %}<h2>{{ subtitle }}</h2>{% endif %}{% endblock %}
|
{% block content_subtitle %}{% if subtitle %}<h2>{{ subtitle }}</h2>{% endif %}{% endblock %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{% block object-tools %}{% endblock %}
|
|
||||||
{{ content }}
|
{{ content }}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block sidebar %}{% endblock %}
|
{% block sidebar %}{% endblock %}
|
||||||
|
@ -24,7 +24,6 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% block content %}<div id="content-main">
|
|
||||||
{% block object-tools %}
|
{% block object-tools %}
|
||||||
{% if change and not is_popup %}
|
{% if change and not is_popup %}
|
||||||
<ul class="object-tools">
|
<ul class="object-tools">
|
||||||
@ -34,6 +33,8 @@
|
|||||||
</ul>
|
</ul>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}<div id="content-main">
|
||||||
<form {% if has_file_field %}enctype="multipart/form-data" {% endif %}{% if form_url %}action="{{ form_url }}" {% endif %}method="post" id="{{ opts.model_name }}_form" novalidate>{% csrf_token %}{% block form_top %}{% endblock %}
|
<form {% if has_file_field %}enctype="multipart/form-data" {% endif %}{% if form_url %}action="{{ form_url }}" {% endif %}method="post" id="{{ opts.model_name }}_form" novalidate>{% csrf_token %}{% block form_top %}{% endblock %}
|
||||||
<div>
|
<div>
|
||||||
{% if is_popup %}<input type="hidden" name="{{ is_popup_var }}" value="1">{% endif %}
|
{% if is_popup %}<input type="hidden" name="{{ is_popup_var }}" value="1">{% endif %}
|
||||||
|
@ -39,15 +39,16 @@
|
|||||||
|
|
||||||
{% block coltype %}{% endblock %}
|
{% block coltype %}{% endblock %}
|
||||||
|
|
||||||
|
{% block object-tools %}
|
||||||
|
<ul class="object-tools">
|
||||||
|
{% block object-tools-items %}
|
||||||
|
{% change_list_object_tools %}
|
||||||
|
{% endblock %}
|
||||||
|
</ul>
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div id="content-main">
|
<div id="content-main">
|
||||||
{% block object-tools %}
|
|
||||||
<ul class="object-tools">
|
|
||||||
{% block object-tools-items %}
|
|
||||||
{% change_list_object_tools %}
|
|
||||||
{% endblock %}
|
|
||||||
</ul>
|
|
||||||
{% endblock %}
|
|
||||||
{% if cl.formset and cl.formset.errors %}
|
{% if cl.formset and cl.formset.errors %}
|
||||||
<p class="errornote">
|
<p class="errornote">
|
||||||
{% blocktranslate count counter=cl.formset.total_error_count %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktranslate %}
|
{% blocktranslate count counter=cl.formset.total_error_count %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktranslate %}
|
||||||
|
@ -127,6 +127,7 @@ from .models import (
|
|||||||
Song,
|
Song,
|
||||||
State,
|
State,
|
||||||
Story,
|
Story,
|
||||||
|
Subscriber,
|
||||||
SuperSecretHideout,
|
SuperSecretHideout,
|
||||||
SuperVillain,
|
SuperVillain,
|
||||||
Telegram,
|
Telegram,
|
||||||
@ -6861,6 +6862,24 @@ class SeleniumTests(AdminSeleniumTestCase):
|
|||||||
name_input_value = name_input.get_attribute("value")
|
name_input_value = name_input.get_attribute("value")
|
||||||
self.assertEqual(name_input_value, "Test section 1")
|
self.assertEqual(name_input_value, "Test section 1")
|
||||||
|
|
||||||
|
@screenshot_cases(["desktop_size", "mobile_size", "rtl", "dark", "high_contrast"])
|
||||||
|
def test_long_object_str_on_change_view(self):
|
||||||
|
from selenium.webdriver.common.by import By
|
||||||
|
|
||||||
|
self.admin_login(
|
||||||
|
username="super", password="secret", login_url=reverse("admin:index")
|
||||||
|
)
|
||||||
|
s = Subscriber.objects.create(name="a " * 40, email="b " * 80)
|
||||||
|
self.selenium.get(
|
||||||
|
self.live_server_url
|
||||||
|
+ reverse("admin:admin_views_subscriber_change", args=(s.pk,))
|
||||||
|
)
|
||||||
|
object_tools = self.selenium.find_elements(
|
||||||
|
By.CSS_SELECTOR, "div#content ul.object-tools li"
|
||||||
|
)
|
||||||
|
self.assertGreater(len(object_tools), 0)
|
||||||
|
self.take_screenshot("not-overwrap")
|
||||||
|
|
||||||
|
|
||||||
@override_settings(ROOT_URLCONF="admin_views.urls")
|
@override_settings(ROOT_URLCONF="admin_views.urls")
|
||||||
class ReadonlyTest(AdminFieldExtractionMixin, TestCase):
|
class ReadonlyTest(AdminFieldExtractionMixin, TestCase):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user