You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
2.2 KiB
54 lines
2.2 KiB
{% extends get_global_template('list') %}
|
|
|
|
{% block list_table %}
|
|
{{ parent() }}
|
|
<div class="modal fade" tabindex="-1" role="dialog" id="inscripcionModal" aria-labelledby="wmModalLabel">
|
|
<div class="modal-dialog" role="document">
|
|
<div class="loader"></div>
|
|
<div class="modal-content">
|
|
|
|
</div><!-- /.modal-content -->
|
|
</div><!-- /.modal-dialog -->
|
|
</div><!-- /.modal -->
|
|
{% endblock %}
|
|
{% block javascripts %}
|
|
{{ parent() }}
|
|
<script>
|
|
$(function() {
|
|
let reload = false;
|
|
$("a.inscripcion_link").on('click', function (e) {
|
|
e.preventDefault();
|
|
let $modal = $("#inscripcionModal");
|
|
let $modalContent = $modal.find('.modal-content');
|
|
$modalContent.html('');
|
|
$modal.modal('show');
|
|
$modal.find('.loader').show();
|
|
let url = $(this).attr('href');
|
|
$modal.data('formUrl', url);
|
|
$.get(url, function(response){
|
|
console.log(response);
|
|
$modal.find('.loader').hide();
|
|
$modalContent.html(response);
|
|
});
|
|
});
|
|
$("#inscripcionModal").on('click', "#submit-inscripcion", function (e) {
|
|
let $modal = $("#inscripcionModal");
|
|
let $modalContent = $modal.find('.modal-content');
|
|
let formData = $modal.find('form').serialize();
|
|
$modal.find('.loader').show();
|
|
$.post($modal.data('formUrl'), formData, function(response){
|
|
console.log(response);
|
|
$modalContent.find('.modal-footer').find('.btn-success').remove();
|
|
$modalContent.find('.modal-footer').find('.btn-danger').remove();
|
|
$modalContent.find('.body-content-scrollable').html(response);
|
|
reload = true;
|
|
});
|
|
});
|
|
$("#inscripcionModal").on('hidden.bs.modal', function () {
|
|
if(reload){
|
|
window.location.reload();
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
{% endblock %}
|