Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: sometimes data-theme="undefined" gets added to the <html> tag #498

Merged
merged 7 commits into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
Changelog
=========

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

* Fix bug which adds 'data-theme="undefined"' to admin html tag
* Fix broken styling with `.flex-container`
* Fix broken color input (#429)
* Add Django as requirement in setup.py (#423)

3.2.5 (2023-08-22)
==================

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.5'
__version__ = '3.2.6'
10 changes: 10 additions & 0 deletions djangocms_admin_style/sass/components/_forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ form {
}
}
}
input[type="color"] {
width: revert;
}
button,
input[type="text"],
input[type="email"],
Expand Down Expand Up @@ -981,3 +984,10 @@ form select[multiple] {
.related-widget-wrapper-link:link:hover {
opacity: 1;
}

form .flex-container {
display: block;
div.fieldBox {
display: inline-block;
}
}

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ function getTopWindow() {
function getColorSchemeFromSettings(CMS) {
var colorScheme;

if (!CMS) {
return;
}

if (CMS.settings && CMS.settings.color_scheme) {
// Use color_scheme from settings.py
colorScheme = CMS.settings.color_scheme;
Expand Down Expand Up @@ -54,16 +58,12 @@ function darkModeSettings() {
// CMS not loaded: set color scheme for admin site according to settings
colorScheme = JSON.parse(localStorage.getItem('cms_cookie') || '{}').color_scheme;
}

if (colorScheme === 'auto' || colorScheme === undefined) {
document.documentElement.dataset.theme = 'auto';
} else {
document.documentElement.dataset.theme = colorScheme;
}
}
}
}
document.documentElement.dataset.theme = colorScheme;
if (colorScheme) {
document.documentElement.dataset.theme = colorScheme;
}
}

module.exports = darkModeSettings;
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
from djangocms_admin_style import __version__


REQUIREMENTS = []
REQUIREMENTS = [
"Django",
]


CLASSIFIERS = [
Expand Down
Loading