Used CSS flex for admin's submit row.

This commit is contained in:
Tom Carrick 2022-08-17 18:01:35 +02:00 committed by Mariusz Felisiak
parent aed60aee38
commit bd36023100
5 changed files with 23 additions and 35 deletions

View File

@ -254,12 +254,15 @@ fieldset.monospace textarea {
/* SUBMIT ROW */ /* SUBMIT ROW */
.submit-row { .submit-row {
padding: 12px 14px 7px; padding: 12px 14px 12px;
margin: 0 0 20px; margin: 0 0 20px;
background: var(--darkened-bg); background: var(--darkened-bg);
border: 1px solid var(--hairline-color); border: 1px solid var(--hairline-color);
border-radius: 4px; border-radius: 4px;
overflow: hidden; overflow: hidden;
display: flex;
gap: 10px;
flex-wrap: wrap;
} }
body.popup .submit-row { body.popup .submit-row {
@ -269,20 +272,18 @@ body.popup .submit-row {
.submit-row input { .submit-row input {
height: 35px; height: 35px;
line-height: 15px; line-height: 15px;
margin: 0 5px 5px 0; }
.submit-row input, .submit-row a {
margin: 0;
} }
.submit-row input.default { .submit-row input.default {
text-transform: uppercase; text-transform: uppercase;
} }
.submit-row p { .submit-row a.deletelink {
margin: 0.3em; margin-left: auto;
}
.submit-row p.deletelink-box {
float: right;
margin: 0;
} }
.submit-row a.deletelink { .submit-row a.deletelink {
@ -292,7 +293,6 @@ body.popup .submit-row {
padding: 10px 15px; padding: 10px 15px;
height: 15px; height: 15px;
line-height: 15px; line-height: 15px;
margin-bottom: 5px;
color: var(--button-fg); color: var(--button-fg);
} }
@ -303,7 +303,6 @@ body.popup .submit-row {
padding: 10px 15px; padding: 10px 15px;
height: 15px; height: 15px;
line-height: 15px; line-height: 15px;
margin: 0 5px 5px 0;
color: var(--button-fg); color: var(--button-fg);
} }

View File

@ -232,7 +232,7 @@ input[type="submit"], button {
} }
.submit-row { .submit-row {
padding: 8px 8px 3px 8px; padding: 8px;
} }
.submit-row a.deletelink { .submit-row a.deletelink {
@ -819,30 +819,23 @@ input[type="submit"], button {
/* Submit row */ /* Submit row */
.submit-row { .submit-row {
padding: 10px 10px 5px; padding: 10px;
margin: 0 0 15px; margin: 0 0 15px;
display: flex;
flex-direction: column; flex-direction: column;
} gap: 8px;
.submit-row > * {
width: 100%;
} }
.submit-row input, .submit-row input.default, .submit-row a { .submit-row input, .submit-row input.default, .submit-row a {
float: none;
margin: 0 0 10px;
text-align: center; text-align: center;
} }
.submit-row a.closelink { .submit-row a.closelink {
float: none;
padding: 10px 0; padding: 10px 0;
text-align: center; text-align: center;
} }
.submit-row p.deletelink-box { .submit-row a.deletelink {
order: 4; margin: 0;
} }
/* Messages */ /* Messages */

View File

@ -114,16 +114,9 @@ thead th.sorted .text {
float: right; float: right;
} }
.submit-row p.deletelink-box { .submit-row a.deletelink {
float: left; margin-left: 0;
} margin-right: auto;
.submit-row input.default {
margin: 0 0 5px 5px;
}
.submit-row input {
margin: 0 0 5px 5px;
} }
.vDateField, .vTimeField { .vDateField, .vTimeField {

View File

@ -8,7 +8,7 @@
{% if show_close %}<a href="{% url opts|admin_urlname:'changelist' %}" class="closelink">{% translate 'Close' %}</a>{% endif %} {% if show_close %}<a href="{% url opts|admin_urlname:'changelist' %}" class="closelink">{% translate 'Close' %}</a>{% endif %}
{% if show_delete_link and original %} {% if show_delete_link and original %}
{% url opts|admin_urlname:'delete' original.pk|admin_urlquote as delete_url %} {% url opts|admin_urlname:'delete' original.pk|admin_urlquote as delete_url %}
<p class="deletelink-box"><a href="{% add_preserved_filters delete_url %}" class="deletelink">{% translate "Delete" %}</a></p> <a href="{% add_preserved_filters delete_url %}" class="deletelink">{% translate "Delete" %}</a>
{% endif %} {% endif %}
{% endblock %} {% endblock %}
</div> </div>

View File

@ -1303,7 +1303,10 @@ class TestReadOnlyChangeViewInlinePermissions(TestCase):
'<a href="/admin/admin_inlines/poll/" class="closelink">Close</a>', '<a href="/admin/admin_inlines/poll/" class="closelink">Close</a>',
html=True, html=True,
) )
delete_link = '<p class="deletelink-box"><a href="/admin/admin_inlines/poll/%s/delete/" class="deletelink">Delete</a></p>' # noqa delete_link = (
'<a href="/admin/admin_inlines/poll/%s/delete/" class="deletelink">Delete'
"</a>"
)
self.assertNotContains(response, delete_link % self.poll.id, html=True) self.assertNotContains(response, delete_link % self.poll.id, html=True)
self.assertNotContains( self.assertNotContains(
response, response,