Skip to content

Commit 982739e

Browse files
committed
Fix: Carousel links
1 parent 75d616a commit 982739e

File tree

3 files changed

+10
-16
lines changed

3 files changed

+10
-16
lines changed

djangocms_frontend/contrib/carousel/cms_plugins.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -81,18 +81,8 @@ class CarouselSlidePlugin(
8181
)
8282
},
8383
),
84-
(
85-
_("Link settings"),
86-
{
87-
"classes": ("collapse",),
88-
"fields": (
89-
("external_link", "internal_link"),
90-
("mailto", "phone"),
91-
("anchor", "target"),
92-
),
93-
},
94-
),
9584
]
85+
link_fieldset_position = 1
9686

9787
def get_render_template(self, context, instance, placeholder):
9888
return get_plugin_template(

djangocms_frontend/contrib/carousel/forms.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from ...helpers import first_choice
1919
from ...models import FrontendUIItem
2020
from .. import carousel
21-
from ..link.forms import AbstractLinkForm
21+
from ..link.forms import LinkFormMixin
2222
from .constants import (
2323
CAROUSEL_ASPECT_RATIO_CHOICES,
2424
CAROUSEL_PAUSE_CHOICES,
@@ -143,8 +143,8 @@ class Meta:
143143

144144
class CarouselSlideForm(
145145
mixin_factory("CarouselSlide"),
146-
AbstractLinkForm,
147146
BackgroundFormMixin,
147+
LinkFormMixin,
148148
EntangledModelForm,
149149
):
150150
"""

djangocms_frontend/contrib/link/forms.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from djangocms_link.fields import LinkFormField
66

77
# from djangocms_link.validators import IntranetURLValidator
8-
from entangled.forms import EntangledModelForm
8+
from entangled.forms import EntangledModelForm, EntangledModelFormMixin
99

1010
from ... import settings
1111
from ...common import SpacingFormMixin
@@ -46,7 +46,7 @@ def __init__(self, *args, **kwargs):
4646
)
4747
from djangocms_url_manager.models import UrlGrouper
4848

49-
class AbstractLinkForm(EntangledModelForm):
49+
class LinkFormMixin(EntangledModelFormMixin):
5050
class Meta:
5151
entangled_fields = {
5252
"config": [
@@ -70,7 +70,7 @@ class Meta:
7070

7171
else:
7272

73-
class AbstractLinkForm(EntangledModelForm):
73+
class LinkFormMixin(EntangledModelFormMixin):
7474
class Meta:
7575
entangled_fields = {
7676
"config": [
@@ -97,6 +97,10 @@ def __init__(self, *args, **kwargs):
9797
self.fields["link"].required = not self.link_is_optional
9898

9999

100+
class AbstractLinkForm(LinkFormMixin, EntangledModelForm):
101+
pass
102+
103+
100104
class LinkForm(mixin_factory("Link"), SpacingFormMixin, TemplateChoiceMixin, AbstractLinkForm):
101105
class Meta:
102106
model = FrontendUIItem

0 commit comments

Comments
 (0)