blob: f3a4cf559f51b52dd2f2387cea22b7982493cf34 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
{% load i18n inline_formset table_form %}
<div class="modal-dialog modal-lg modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h2>{{page_name|safe}}</h2>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<form enctype="multipart/form-data" action="{{url}}" method="post"
id="qa-action">{% csrf_token %}
<div class="modal-body body-scroll">
<div class='form'>
{% for error in form.non_field_errors %}
<p>{{ error }}</p>
{% endfor %}
{% bs_form form %}
{% if confirm %}{% for field in form %}
{% if field.value %}
<label>{{field.label}}</label> {{ field.value }}
{% endif %}
{% endfor %}{% endif %}
</div>
</div>
<div class="modal-footer">
<button type="submit" id="submit_form" name='validate'
value="validate" class="btn btn-success">
{% if confirm %}
{% trans "Confirm" %}
{% else %}
{% trans "Modify" %}
{% endif %}
</button>
<button type="button" data-dismiss="modal"
aria-label="Close" class="btn btn-secondary">
{% trans "Cancel" %}
</button>
</div>
</form>
</div>
</div>
<script type="text/javascript">
$('#qa-action').on('submit', function(event){
event.preventDefault();
$('#modal-dynamic-form').modal("hide");
short_wait();
ajax_post(
"{{url}}", $(this).serialize(), "#modal-dynamic-form",
function(){
$('#modal-dynamic-form').modal("show");
}
);
});
</script>
|