Skip to content

Commit

Permalink
feat: Add Django 4.2 admin support (#500)
Browse files Browse the repository at this point in the history
* Fix: avoid `<html data-theme="undefined">`

* Add bundle

* Fix broken color input

* Add Django as dependency

* Fix: `.flex-container` styling

* Add multicolumn display for django 4.2+

* Avoided overflow for inline admin

* Fix: Invalid menu background on admin page

* Style delete link

* Update build

* Update changelog
  • Loading branch information
fsbraun authored Jan 3, 2024
1 parent a71b381 commit 7ee48a8
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 19 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
Changelog
=========

unreleased
==========

* Style delete links
* Fix read-only fields overlapping with their labels
* Adjust flex-container in newer Django versions

3.2.6 (2023-09-18)
==================

Expand Down
16 changes: 8 additions & 8 deletions djangocms_admin_style/sass/components/_content.scss
Original file line number Diff line number Diff line change
Expand Up @@ -304,14 +304,14 @@ ul.messagelist + #content {
box-shadow: none;
.deletelink-box {
margin: 0;
.deletelink {
@include button-variant($btn-default-color, $btn-default-bgcolor, $btn-default-border, true);
@include icon(trash-o);
display: block;
padding: 9px 20px !important;
height: 36px;
box-sizing: border-box;
}
}
.deletelink {
@include button-variant($btn-default-color, $btn-default-bgcolor, $btn-default-border, true);
@include icon(trash-o);
display: block;
padding: 9px 20px !important;
height: 36px;
box-sizing: border-box;
}
input[type="submit"] {
padding: 10px 20px !important;
Expand Down
25 changes: 18 additions & 7 deletions djangocms_admin_style/sass/components/_forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ form {
padding: 25px 25px;
background-color: $white;
box-shadow: $base-box-shadow;
fieldset {
fieldset, .inline-group {
width: 80%;
}
// only uses this styles if form-row is not set on a table row because before and after breaks tables #247
Expand All @@ -21,7 +21,7 @@ form {
}
.form-row {
// Improve readability by increasing contrast
& > div > label:not(.vCheckboxLabel) {
& div > label:not(.vCheckboxLabel) {
color: $gray-darker !important;
font-weight: bold !important;
width: 100% !important;
Expand Down Expand Up @@ -100,13 +100,15 @@ form {
}

// only affects field boxes when they are next to each other
.fieldBox {
& > .fieldBox, & > div > .fieldBox,
& > div > .flex-container > div:not(.related-widget-wrapper, .cke, .widget),
.form-multiline > div:not(.related-widget-wrapper, .cke, .widget) {
margin-right: 0px;
box-sizing: border-box;
width: 50%;
max-width: 500px;

& > label {
& > label {
text-transform: inherit;
}
& + .fieldBox {
Expand All @@ -115,7 +117,7 @@ form {

&:not(:first-child) {
border-top: none;
padding-right: 2vw;
// padding-right: 2vw;
}

&:nth-of-type(1) {
Expand Down Expand Up @@ -186,7 +188,7 @@ form {
.cke {
box-sizing: border-box;
}
.aligned {
& {
.field-number_of_visits p {
margin-left: 0;
padding-left: 0;
Expand Down Expand Up @@ -222,7 +224,7 @@ form {
content: none;
}
& + div.readonly {
margin-top: -30px;
margin-top: -5px;
}
}
label + label {
Expand Down Expand Up @@ -466,6 +468,15 @@ form {

.form-row .select2-container {
min-width: 250px + 12px;
&.select2-container--admin-autocomplete .select2-selection {
min-height: 36px;
.select2-selection__arrow {
height: 32px;
}
.select2-selection__clear {
margin-top: 5px;
}
}
} // standard input width + default input padding

.inline-group .module:not(.aligned) .form-row input,
Expand Down
3 changes: 2 additions & 1 deletion djangocms_admin_style/sass/components/_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@
border: 1px solid $white;
border-top: none;
border-radius: 0 0 4px 4px;
background: rgba($white, .97);
background: $white;
filter: opacity(.95);
box-shadow: 0 1px 1px rgba($black-fallback, .4);
&.submenu-open {
display: block;
Expand Down
2 changes: 1 addition & 1 deletion djangocms_admin_style/sass/components/_tables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@
select {
float: none;
vertical-align: top;
width: auto !important;
// width: auto !important;
}
}
&.delete {
Expand Down

Large diffs are not rendered by default.

0 comments on commit 7ee48a8

Please sign in to comment.