{# /** * @file * Default theme implementation to display a Bootstrap Modal component. * * Available variables: * - attributes: Attributes for the outer modal div. * - body: The body of the modal. * - body_attributes: Attributes for the modal body div. * - close_button: Flag indicating whether or not to show the close button in * the header. * - content_attributes: Attributes for the modal content div. * - description: (optional) A list of description properties containing: * - content: (optional) A description of the modal, may not be set. * - attributes: (optional) A list of HTML attributes to apply to the * modal description div. Will only be set when description is set. * - position: (optional) A display setting that can have these values: * - before: The description is displayed before the body. This is the * default value. * - after: The description is display after the body. * - invisible: The description is displayed after the element, hidden * visually but available to screen readers. * - dialog_attributes: Attributes for the inner modal div. * - footer: The footer of the modal. * - footer_attributes: Attributes for the modal footer div. * - header_attributes: Attributes for the modal header div. * - size: The size of the modal. Can be empty, "modal-sm" or "modal-lg". * - title: The title for the modal. * - title_attributes: Attributes for the modal title. * * @ingroup templates */ #} {% if theme.settings.modal_enabled %} {{ attach_library('bootstrap/modal') }} {% set classes = [ 'modal', theme.settings.modal_animation ? 'fade', ] %} {% set dialog_classes = [ 'modal-dialog', size ? size|clean_class, ] -%} {% set content_classes = ['modal-content'] -%} {% if title -%} {% block title -%} {% set header_classes = ['modal-header'] -%} {% set title_classes = ['modal-title'] -%} {% if close_button -%} {% endif -%} {{ title }} {% endblock -%} {% endif -%} {% block body -%} {% set body_classes = ['modal-body'] -%} {% set description_classes = [ 'help-block', description and description.position == 'invisible' ? 'sr-only', ] %} {% if description and description.position == 'before' %} {{ description.content }}

{% endif %} {{ body }} {% if description and description.position == 'after' or description.position == 'invisible' %} {{ description.content }}

{% endif %} {% endblock -%} {% if footer is not empty -%} {% block footer -%} {% set footer_classes = ['modal-footer'] -%} {{ footer }} {% endblock -%} {% endif -%} {% endif %}