summaryrefslogtreecommitdiff
path: root/ishtar_common/templates
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2024-09-16 12:45:00 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2024-09-16 12:46:09 +0200
commit12e9870e2aa0659de98a9122fbc4ab16b0877449 (patch)
tree36d375089b787fbc3649ad54bb9e7e3b2b5741e0 /ishtar_common/templates
parentdb5ecbb7b69ff668ca005bd9535bf595b79e649e (diff)
downloadIshtar-12e9870e2aa0659de98a9122fbc4ab16b0877449.tar.bz2
Ishtar-12e9870e2aa0659de98a9122fbc4ab16b0877449.zip
✨ Context records relations: remove form from the wizard to put in a specific form
Diffstat (limited to 'ishtar_common/templates')
-rw-r--r--ishtar_common/templates/ishtar/forms/modify_parcels.html6
-rw-r--r--ishtar_common/templates/ishtar/forms/modify_relations.html59
2 files changed, 62 insertions, 3 deletions
diff --git a/ishtar_common/templates/ishtar/forms/modify_parcels.html b/ishtar_common/templates/ishtar/forms/modify_parcels.html
index 4c7c39120..c6d50fdef 100644
--- a/ishtar_common/templates/ishtar/forms/modify_parcels.html
+++ b/ishtar_common/templates/ishtar/forms/modify_parcels.html
@@ -20,11 +20,11 @@
<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 %}
+ {% if field.name != 'pk' %}<th{% if not forloop.last %} rowspan='2'{% endif %}>
+ {{field.label}}</th>{% 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 %}
+ {% inline_formset _('Parcels') formset.forms False %}
</table>
{% endblock %}
diff --git a/ishtar_common/templates/ishtar/forms/modify_relations.html b/ishtar_common/templates/ishtar/forms/modify_relations.html
new file mode 100644
index 000000000..faec8b3fc
--- /dev/null
+++ b/ishtar_common/templates/ishtar/forms/modify_relations.html
@@ -0,0 +1,59 @@
+{% 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 }}
+ {% csrf_token %}
+ <div class="modal-body body-scroll">
+ <div class='form'>
+ {% block main_form %}
+ <table class='w-100 inline-table text-center'>
+ <tr>
+ {% for field in formset.forms.0 %}
+ {% if field.name != 'pk' %}<th{% if not forloop.last %} rowspan='2'{% endif %}>
+ {% if field.label %}{{field.label}}{% else %}{% trans "Delete" %}{% endif %}</th>{% endif %}{% endfor %}
+ </tr>
+ <tr><td>({% trans "all"%} <input type='checkbox' name='check-all' class='check-all-relations'/>)</td></tr>
+ {% inline_formset _("Relations") 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}}");
+ $(document).on("click", '.check-all-relations', function(){
+ $('input[id$="-DELETE"]:checkbox').prop('checked', $(this).is(':checked'));
+ });
+ {% block js_ready %}
+ {% endblock %}
+ });
+{% endlocalize %}</script>