Skip to content

Commit

Permalink
Merge branch 'django-cms:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
fsbraun authored Oct 5, 2023
2 parents 941cb9a + 56ee1ea commit 683f27b
Show file tree
Hide file tree
Showing 18 changed files with 741 additions and 659 deletions.
2 changes: 1 addition & 1 deletion djangocms_frontend/contrib/carousel/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class Meta:
untangled_fields = ("tag_type",)

template = forms.ChoiceField(
label=_("Template"),
label=_("Layout"),
choices=CAROUSEL_TEMPLATE_CHOICES,
initial=first_choice(CAROUSEL_TEMPLATE_CHOICES),
help_text=_("This is the template that will be used for the component."),
Expand Down
2 changes: 1 addition & 1 deletion djangocms_frontend/contrib/image/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class Meta:
link_is_optional = True

template = forms.ChoiceField(
label=_("Template"),
label=_("Layout"),
choices=get_templates(),
initial=first_choice(get_templates()),
)
Expand Down
5 changes: 4 additions & 1 deletion djangocms_frontend/contrib/image/frameworks/bootstrap5.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
from djangocms_frontend.helpers import is_first_child


class ImageRenderMixin:
def render(self, context, instance, placeholder):
# assign link to a context variable to be performant
Expand All @@ -17,7 +20,7 @@ def render(self, context, instance, placeholder):
instance.add_classes("img-thumbnail")
if instance.parent and instance.parent.plugin_type == "CardPlugin":
instance.add_classes(
"card-img-top" if instance.position == 0 else "card-img-bottom"
"card-img-top" if is_first_child(instance, instance.parent) else "card-img-bottom"
)
elif instance.parent and instance.parent.plugin_type == "FigurePlugin":
instance.add_classes("figure-img")
Expand Down
2 changes: 1 addition & 1 deletion djangocms_frontend/contrib/jumbotron/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class Meta:
untangled_fields = ("tag_type",)

template = forms.ChoiceField(
label=_("Template"),
label=_("Layout"),
choices=settings.JUMBOTRON_TEMPLATE_CHOICES,
initial=first_choice(settings.JUMBOTRON_TEMPLATE_CHOICES),
)
Expand Down
2 changes: 1 addition & 1 deletion djangocms_frontend/contrib/link/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ class Meta:
required=False,
)
template = forms.ChoiceField(
label=_("Template"),
label=_("Layout"),
choices=settings.LINK_TEMPLATE_CHOICES,
initial=first_choice(settings.LINK_TEMPLATE_CHOICES),
)
Expand Down
2 changes: 1 addition & 1 deletion djangocms_frontend/contrib/navigation/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class Meta:
untangled_fields = ()

template = forms.ChoiceField(
label=_("Template"),
label=_("Layout"),
choices=settings.NAVIGATION_TEMPLATE_CHOICES,
initial=first_choice(settings.NAVIGATION_TEMPLATE_CHOICES),
help_text=_("Defines the whole template set for this navigation."),
Expand Down
2 changes: 1 addition & 1 deletion djangocms_frontend/contrib/tabs/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class Meta:
untangled_fields = ("tag_type",)

template = forms.ChoiceField(
label=_("Template"),
label=_("Layout"),
choices=TAB_TEMPLATE_CHOICES,
initial=first_choice(TAB_TEMPLATE_CHOICES),
help_text=_("This is the template that will be used for the component."),
Expand Down
Loading

0 comments on commit 683f27b

Please sign in to comment.