Skip to content

Commit

Permalink
adds an option for an additional footer
Browse files Browse the repository at this point in the history
  • Loading branch information
mavoIn committed Nov 14, 2024
1 parent 80fab0f commit cad3e66
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion djangocms_frontend/contrib/modal/cms_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from ... import settings
from ...cms_plugins import CMSUIPlugin
from ...common.attributes import AttributesMixin
from ...common import AttributesMixin
from .. import modal
from . import forms, models

Expand Down
7 changes: 7 additions & 0 deletions djangocms_frontend/contrib/modal/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ class Meta:
"attributes",
"modal_centered",
"modal_static",
"modal_footer",
"modal_scrollable",
"modal_size",
"modal_fullscreen",
Expand All @@ -114,6 +115,12 @@ class Meta:
help_text=_("If selected, the modal will not close when clicking outside of it."),
)

modal_footer = forms.BooleanField(
label=_("Footer"),
required=False,
help_text=_("If selected, the modal will display a footer with a close button."),
)

modal_scrollable = forms.BooleanField(
label=_("Scrollable"),
required=False,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
{% for plugin in instance.child_plugin_instances %}
{% with forloop as parentloop %}{% render_plugin plugin %}{% endwith %}
{% endfor %}
{% if instance.modal_footer %}
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
</div>
{% endif %}
</div>
</div>
</div>
Expand Down

0 comments on commit cad3e66

Please sign in to comment.