Skip to content

Commit 1abe124

Browse files
authored
Merge branch 'django-cms:master' into master
2 parents 1d735ba + 74dd2de commit 1abe124

File tree

5 files changed

+13
-5
lines changed

5 files changed

+13
-5
lines changed

djangocms_frontend/contrib/link/forms.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,10 @@ def build_attrs(self, base_attrs, extra_attrs=None):
114114
return attrs
115115

116116
def optgroups(self, name, value, attr=None):
117-
return super(forms.Select, self).optgroups(name, value)
117+
groups = super(forms.Select, self).optgroups(name, value)
118+
if not self.is_required:
119+
groups[0][1].insert(0, self.create_option(name, "", "", False, 0))
120+
return groups
118121

119122

120123
class SmartLinkField(forms.ChoiceField):

djangocms_frontend/contrib/utilities/frameworks/bootstrap5.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ def render(self, context, instance, placeholder):
66
)
77
else:
88
instance.add_classes(
9-
f"{instance.space_property}{instance.space_sides}-{ instance.space_device }-{instance.space_size}"
9+
f"{instance.space_property}{instance.space_sides}-{instance.space_device}-{instance.space_size}"
1010
)
1111
return super().render(context, instance, placeholder)
1212

djangocms_frontend/static/djangocms_frontend/css/base.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

private/sass/components/_grid-layout.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@
3030
padding: 0;
3131
min-width: 800px;
3232

33+
> div > div:not([class]) { // fix a quirk of djangocms-admin-style
34+
width: unset !important;
35+
max-width: unset !important;
36+
}
3337
.field-box:first-child {
3438
width: 115px !important;
3539
}
@@ -39,6 +43,7 @@
3943
box-sizing: content-box;
4044
width: 86px !important;
4145
flex: none;
46+
display: block;
4247
padding: 15px 10px;
4348
margin: 0 !important;
4449
border-bottom: 1px solid #eee;

tests/link/test_plugins.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ def test_plugin(self):
119119
def test_smart_link_field(self):
120120
slf = SmartLinkField()
121121
choices = get_choices(None)
122-
self.assertEqual("example.com", choices[0][0]) # Site name
123-
self.assertIn(("2-1", "home"), choices[0][1])
122+
self.assertEqual("example.com", choices[1][0]) # Site name
123+
self.assertIn(("2-1", "home"), choices[1][1])
124124

125125
cleaned = slf.clean("2-1")
126126
self.assertEqual(dict(model="cms.page", pk=1), cleaned)

0 commit comments

Comments
 (0)