Updated modal forms

This commit is contained in:
Oliver Walters 2020-10-27 22:29:34 +11:00
parent 646fe40950
commit 4055a36db2
2 changed files with 19 additions and 6 deletions

View File

@ -719,6 +719,11 @@ function handleModalForm(url, options) {
}
// Form was returned, invalid!
else {
var warningDiv = $(modal).find('#form-validation-warning');
warningDiv.css('display', 'block');
if (response.html_form) {
injectModalForm(modal, response.html_form);

View File

@ -1,3 +1,5 @@
{% load i18n %}
<div class='modal fade modal-fixed-footer modal-primary' tabindex='-1' role='dialog' id='modal-form'>
<div class='modal-dialog'>
<div class='modal-content'>
@ -5,13 +7,16 @@
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h3 id='modal-title'>Form Title Here</h3>
<h3 id='modal-title'><i>Form Title Here</i></h3>
</div>
<div class='alert alert-block alert-danger' id='form-validation-warning' style='display: none;'>
{% trans "Form errors exist" %}
</div>
<div class='modal-form-content'>
</div>
<div class='modal-footer'>
<button type='button' class='btn btn-default' id='modal-form-close' data-dismiss='modal'>Close</button>
<button type='button' class='btn btn-primary' id='modal-form-submit'>Submit</button>
<button type='button' class='btn btn-default' id='modal-form-close' data-dismiss='modal'>{% trans "Close" %}</button>
<button type='button' class='btn btn-primary' id='modal-form-submit'>{% trans "Submit" %}</button>
</div>
</div>
</div>
@ -24,13 +29,16 @@
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h3 id='modal-title'>Form Title Here</h3>
<h3 id='modal-title'><i>Form Title Here</i></h3>
</div>
<div class='alert alert-block alert-danger' id='form-validation-warning' style="display: none;">
{% trans "Form errors exist" %}
</div>
<div class='modal-form-content'>
</div>
<div class='modal-footer'>
<button type='button' class='btn btn-default' id='modal-form-close' data-dismiss='modal'>Close</button>
<button type='button' class='btn btn-primary' id='modal-form-submit'>Submit</button>
<button type='button' class='btn btn-default' id='modal-form-close' data-dismiss='modal'>{% trans "Close" %}</button>
<button type='button' class='btn btn-primary' id='modal-form-submit'>{% trans "Submit" %}</button>
</div>
</div>
</div>