Skip to content

Commit cad3e66

Browse files
committed
adds an option for an additional footer
1 parent 80fab0f commit cad3e66

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

djangocms_frontend/contrib/modal/cms_plugins.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
from ... import settings
55
from ...cms_plugins import CMSUIPlugin
6-
from ...common.attributes import AttributesMixin
6+
from ...common import AttributesMixin
77
from .. import modal
88
from . import forms, models
99

djangocms_frontend/contrib/modal/forms.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ class Meta:
8989
"attributes",
9090
"modal_centered",
9191
"modal_static",
92+
"modal_footer",
9293
"modal_scrollable",
9394
"modal_size",
9495
"modal_fullscreen",
@@ -114,6 +115,12 @@ class Meta:
114115
help_text=_("If selected, the modal will not close when clicking outside of it."),
115116
)
116117

118+
modal_footer = forms.BooleanField(
119+
label=_("Footer"),
120+
required=False,
121+
help_text=_("If selected, the modal will display a footer with a close button."),
122+
)
123+
117124
modal_scrollable = forms.BooleanField(
118125
label=_("Scrollable"),
119126
required=False,

djangocms_frontend/contrib/modal/templates/djangocms_frontend/bootstrap5/modal-container.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@
66
{% for plugin in instance.child_plugin_instances %}
77
{% with forloop as parentloop %}{% render_plugin plugin %}{% endwith %}
88
{% endfor %}
9+
{% if instance.modal_footer %}
910
<div class="modal-footer">
1011
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
1112
</div>
13+
{% endif %}
1214
</div>
1315
</div>
1416
</div>

0 commit comments

Comments
 (0)