summaryrefslogtreecommitdiff
path: root/ishtar_common/templates/ishtar/forms/modify_parcels.html
blob: 4c7c391209f49ca6702f8a3411f92e77c72e4901 (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
58
59
60
61
62
63
64
{% load i18n l10n inline_formset table_form %}

<div class="modal-dialog modal-lg">
    <div class="modal-content">
        <div class="modal-header">
            <h2>{{ formset.form_label }}</h2>
            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                <span aria-hidden="true">&times;</span>
            </button>
        </div>
        <form enctype="multipart/form-data" action="{{url}}" method="post" id="qa-action">
            {{ formset.management_form }}
            <div class='form container'>
            {% bs_form formset.selection_form %}
            </div>
            {% csrf_token %}
            <div class="modal-body body-scroll">
                <div class='form'>
                    {% block main_form %}
                    <table class='inline-table'>
                        <tr>
                            {% for field in formset.forms.0 %}
                            {% if field.name != 'pk' %}{% if field.required %}<th{%else%}<td{% endif %}{% if not forloop.last %} rowspan='2'{% endif %}>
                            {{ field.label_tag }}{% if field.required %}</th>{%else%}</td>{% endif %}{% endif %}{% endfor %}
                        </tr>
                        <tr><td>({% trans "all"%} <input type='checkbox' name='check-all' class='check-all-parcel'/>)</td></tr>
                        {% inline_formset 'Parcels' formset.forms False %}
                    </table>

                    {% endblock %}
                </div>
            </div>
            <div class="modal-footer">
                {% block footer %}
                    <button type="submit" id="submit_form" name='validate'
                        value="validate" class="btn btn-success">
                        {% if action_name %}
                            {{ action_name }}
                        {% else %}
                            {% trans "Add/Modify" %}
                        {% endif %}
                    </button>
                    <button type="button" data-dismiss="modal"
                        aria-label="Close" class="btn btn-secondary">
                        {% trans "Close" %}
                    </button>
                {% endblock %}
            </div>
        </form>
    </div>
</div>
<script type="text/javascript">{% localize off %}
    {% block js %}
    {% endblock %}
    $(document).ready(function(){
        qa_action_register("{{url}}");
        var delete_parcel_checked= false;
        $(document).on("click", '.check-all-parcel', function(){
           $('input[id$="-DELETE"]:checkbox').prop('checked', $(this).is(':checked'));
        });
    {% block js_ready %}
    {% endblock %}
    });
{% endlocalize %}</script>