{% extends "coderedcms/blocks/base_block.html" %}
{% load wagtailcore_tags wagtailimages_tags coderedcms_tags %}
{% block block_render %}
{% generate_random_id as modal_id %}
<button data-bs-toggle="modal" data-bs-target="#{{modal_id}}" type="button" class="btn {{self.button_size}} {{self.button_style}}">{{self.button_title}}</button>
<div id="{{modal_id}}" class="modal fade" role="dialog">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        {% if self.header %}
        <h5 class="modal-title">{% include_block self.header %}</h5>
        {% endif %}
        <button type="button" class="btn-close" data-bs-dismiss="modal" title="Close" aria-label="Close"></button>
      </div>
      <div class="modal-body">
        {% include_block self.content %}
      </div>
      {% if self.footer %}
      <div class="modal-footer">
        {% include_block self.footer %}
      </div>
      {% endif %}
    </div>
  </div>
</div>
{% endblock %}
