HTML improvements

* refactors initializing and rendering of a map view into map/geom_form.html, which leads to simple includes on the detail views instead of redundant html
* refactors django-autocomplete-light form media links and scripts into dal/scripts.html, which can be included on the header blocks of detail views to support form modals using dal easier without the need for form.media
* changes filter behaviour on eco account index: instead of hiding recorded accounts (like in interventions), the filter option there has been replaced with "Show only unrecorded" which can be used to hide all recorded ones
   * background: eco accounts shall be visible when recorded, since they can only be used for withdrawing if they are recorded. Hiding the recorded ones does not make any sense, just like in interventions
* updates some code documentation
* adds/updates translations
This commit is contained in:
mipel
2021-08-10 13:12:15 +02:00
parent 72d61a23da
commit 07a428d0e5
9 changed files with 131 additions and 87 deletions

View File

@@ -0,0 +1,15 @@
{% comment %}
These are the scripts, which are generally loaded by using form.meda, as stated in the
dal documentation (django-autocomplete-light). By including these scripts independent from any script
we can easily use dal in modal forms.
https://django-autocomplete-light.readthedocs.io/en/master/tutorial.html#using-autocompletes-outside-the-admin
{% endcomment %}
<link href="/static/admin/css/vendor/select2/select2.css" type="text/css" media="screen" rel="stylesheet">
<link href="/static/admin/css/autocomplete.css" type="text/css" media="screen" rel="stylesheet">
<link href="/static/autocomplete_light/select2.css" type="text/css" media="screen" rel="stylesheet">
<script src="/static/admin/js/vendor/select2/select2.full.js"></script>
<script src="/static/autocomplete_light/autocomplete_light.js"></script>
<script src="/static/autocomplete_light/select2.js"></script>
<script src="/static/autocomplete_light/i18n/de.js"></script>

View File

@@ -0,0 +1,12 @@
{% load i18n %}
{% comment %}
Encapsules the rendering and initializing of a geometry view component, e.g. used in the detail views.
{% endcomment %}
{% if geom_form.area == 0 %}
<div class="alert alert-info">{% trans 'No geometry added, yet.' %}</div>
{% endif %}
{{geom_form.media}}
{{geom_form.geom}}