Skip to content

Commit

Permalink
Merge branch 'master' into chore/update-build-system
Browse files Browse the repository at this point in the history
  • Loading branch information
fsbraun authored Jan 29, 2024
2 parents 91fea80 + 89589a8 commit 1e82ce1
Show file tree
Hide file tree
Showing 8 changed files with 89 additions and 47 deletions.
9 changes: 6 additions & 3 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
Changelog
=========

unreleased
==========
3.3.0 (2024-01-14)
==================

* Adjiust flex-container in newer Django versions (4.2+) for submit row and admin header
* Allow more than two columns (as in the original Django admin)
* Adjust flex-container in newer Django versions (4.2+) for submit row and admin header
* Fix help texts for checkboxes and radio buttons
* Fix logout menu entry to work with Django 5

3.2.7 (2024-01-04)
==================
Expand Down
2 changes: 1 addition & 1 deletion djangocms_admin_style/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
10. Publish the release when ready
11. Github actions will publish the new package to pypi
"""
__version__ = '3.2.7'
__version__ = '3.3.0'
4 changes: 2 additions & 2 deletions djangocms_admin_style/sass/components/_content.scss
Original file line number Diff line number Diff line change
Expand Up @@ -374,12 +374,12 @@ ul.messagelist + #content {
width: 100% !important;
input {
width: calc(100% - 50px) !important;
margin: 5px 50px 5px 0 !important;
margin: 0px 50px 5px 0 !important;
}
img {
position: absolute;
right: 0;
margin: 5px 0;
margin: 0;

order: 2;
}
Expand Down
69 changes: 34 additions & 35 deletions djangocms_admin_style/sass/components/_forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,27 @@ form {
fieldset, .inline-group {
width: 80%;
}

// Newer Django admin styles use flexbox, we do not
.flex-container {
display: block;
margin-right: 20px;
}
.flex-container.form-multiline {
display: flex;
margin-right: 0;
div.fieldBox {
display: block;
//margin-right: 0;
}
div:has(div.hidden) {
display: none;
}
}
fieldset.module > h2 {
margin-right: 20px;
}

// only uses this styles if form-row is not set on a table row because before and after breaks tables #247
.form-row:not(tr) {
// adds clearfix because overflow hidden truncates highlighted focus fields #242
Expand Down Expand Up @@ -100,9 +121,11 @@ form {
}

// only affects field boxes when they are next to each other
& > .fieldBox, & > div > .fieldBox,
& > div > .flex-container > div:not(.related-widget-wrapper, .cke, .widget),
.form-multiline > div:not(.related-widget-wrapper, .cke, .widget) {
& > .fieldBox, & > div:not([class]) > .fieldBox,
& > div:not([class]) > .flex-container > div:not(.related-widget-wrapper, .cke, .widget),
.form-multiline > div:not(.related-widget-wrapper,
.form-multiline > div:not([class]) > div:not(.related-widget-wrapper),
.cke, .widget) {
margin-right: 0px;
box-sizing: border-box;
width: 50%;
Expand All @@ -119,26 +142,6 @@ form {
border-top: none;
// padding-right: 2vw;
}

&:nth-of-type(1) {
&:nth-last-of-type(2) {
width: 50%;
box-sizing: border-box;
margin: 0 !important;
padding-right: 10px;
padding-left: 0;
}
}

&:nth-of-type(2) {
&:nth-last-of-type(1) {
width: 50%;
box-sizing: border-box;
margin: 0 !important;
padding-left: 10px;
padding-top: 0;
}
}
}
}
input[type="color"] {
Expand Down Expand Up @@ -430,7 +433,7 @@ form {
}
.checkbox-row {
line-height: 20px;
margin-bottom: -10px;
margin-bottom: -5px;
// wraps checkbox rows with border #188
padding-top: 15px;
border-top: solid 1px $gray-lighter;
Expand Down Expand Up @@ -459,10 +462,13 @@ form {
}

// backport from django 1.9
.aligned label + p {
padding: 6px 0;
margin-top: 0;
margin-bottom: 0;
.aligned label.vCheckboxLabel {
display: inline;
+ p {
padding: 6px 0;
margin-top: 0;
margin-bottom: 0;
}
}
}

Expand Down Expand Up @@ -996,10 +1002,3 @@ form select[multiple] {
.related-widget-wrapper-link:link:hover {
opacity: 1;
}

form .flex-container {
display: block;
div.fieldBox {
display: inline-block;
}
}
34 changes: 34 additions & 0 deletions djangocms_admin_style/sass/components/_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,40 @@
background: $color-primary;
}
}
form {
box-shadow: none;
margin: 0;
padding: 0;
button {
float: none;
white-space: nowrap;
line-height: 30px;
height: 30px;
padding: 0 10px 0 15px !important;
cursor: pointer;

border: none !important;
border-radius: 0 !important;
width: 100% !important;
color: $black !important;
font-size: $font-size-normal !important;
font-family: $base-font-family !important;
text-align: left;

&:active,
&:focus {
filter: none !important;
box-shadow: none !important;
text-decoration: underline !important;
}
&:hover {
filter: none !important;
color: $white !important;
background: $color-primary !important;
text-decoration: none !important;
}
}
}
}
}
}
Expand Down
1 change: 1 addition & 0 deletions djangocms_admin_style/sass/components/_login.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ body.login.djangocms-admin-style {
width: 35.5% !important;
min-width: 320px !important;
margin-top: 165px;
padding: 20px 0;
border: none;
box-shadow: $base-box-shadow;
background-color: $white !important;
Expand Down

Large diffs are not rendered by default.

15 changes: 10 additions & 5 deletions djangocms_admin_style/templates/admin/inc/branding.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,16 @@ <h1>{{ site_header|default:_('Django Administration') }}</h1>
</li>
<li class="toolbar-item-navigation-break">-----</li>
{% endif %}
<li>
<a href="{% url 'admin:logout' %}">
<span>{% trans 'Log out' %} {% firstof user.get_short_name user.get_username %}</span>
</a>
</li>
{% if user.is_authenticated %}
<li>
<form method="POST" action="{% url 'admin:logout' %}">
{% csrf_token %}
<button type="submit">
<b>{% trans 'Log out' %} {% firstof user.get_short_name user.get_username %}</b>
</button>
</form>
</li>
{% endif %}
</ul>
</li>
</ul>
Expand Down

0 comments on commit 1e82ce1

Please sign in to comment.