<div class="modal-dialog modal-lg">
    <div class="modal-content">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
            <h4 class="modal-title">{% block title %}{% endblock %}</h4>
        </div>
        <div class="modal-body">
            {% block content %}{% endblock %}
        </div>
        <div class="modal-footer">
            {% block footer %}{% endblock %}
        </div>
        <script>
            $('.modal-content form').on('submit', function(e) {
                e.preventDefault();
                data = $(this).serialize();
                action = $(this).attr('action');
                console.log(action)
                $.post(action, data, function(resp) {
                    $('#modal').html(resp);
                });
            });
        </script>
    </div>
</div>
