Merge pull request 'master' (#116) from master into 110_Biotope_codelists

Reviewed-on: SGD-Nord/konova#116
This commit is contained in:
mpeltriaux 2022-02-16 08:50:40 +01:00
commit aaea58217b
26 changed files with 506 additions and 228 deletions

View File

@ -65,6 +65,26 @@ class KonovaCode(models.Model):
ret_val += ", " + self.parent.long_name ret_val += ", " + self.parent.long_name
return ret_val return ret_val
def add_children(self):
""" Adds all children (resurcively until leaf) as .children to the KonovaCode
Returns:
code (KonovaCode): The manipulated KonovaCode instance
"""
if self.is_leaf:
return None
children = KonovaCode.objects.filter(
code_lists__in=self.code_lists.all(),
parent=self
).order_by(
"long_name"
)
self.children = children
for child in children:
child.add_children()
return self
class KonovaCodeList(models.Model): class KonovaCodeList(models.Model):
""" """

View File

@ -17,10 +17,11 @@ from codelist.models import KonovaCode
from codelist.settings import CODELIST_BIOTOPES_ID, CODELIST_COMPENSATION_ACTION_ID, CODELIST_BIOTOPES_EXTRA_CODES_ID, \ from codelist.settings import CODELIST_BIOTOPES_ID, CODELIST_COMPENSATION_ACTION_ID, CODELIST_BIOTOPES_EXTRA_CODES_ID, \
CODELIST_COMPENSATION_ACTION_DETAIL_ID CODELIST_COMPENSATION_ACTION_DETAIL_ID
from compensation.models import CompensationDocument, EcoAccountDocument from compensation.models import CompensationDocument, EcoAccountDocument
from intervention.inputs import CompensationActionTreeCheckboxSelectMultiple
from konova.contexts import BaseContext from konova.contexts import BaseContext
from konova.forms import BaseModalForm, NewDocumentModalForm, RemoveModalForm from konova.forms import BaseModalForm, NewDocumentModalForm, RemoveModalForm
from konova.models import DeadlineType from konova.models import DeadlineType
from konova.utils.message_templates import FORM_INVALID, ADDED_COMPENSATION_STATE, ADDED_DEADLINE, \ from konova.utils.message_templates import FORM_INVALID, ADDED_COMPENSATION_STATE, \
ADDED_COMPENSATION_ACTION, PAYMENT_EDITED, COMPENSATION_STATE_EDITED, COMPENSATION_ACTION_EDITED, DEADLINE_EDITED ADDED_COMPENSATION_ACTION, PAYMENT_EDITED, COMPENSATION_STATE_EDITED, COMPENSATION_ACTION_EDITED, DEADLINE_EDITED
@ -405,22 +406,13 @@ class NewActionModalForm(BaseModalForm):
""" """
from compensation.models import UnitChoices from compensation.models import UnitChoices
action_type = forms.ModelChoiceField( action_type = forms.MultipleChoiceField(
label=_("Action Type"), label=_("Action Type"),
label_suffix="", label_suffix="",
required=True, required=True,
help_text=_("Select the action type"), help_text=_("An action can consist of multiple different action types. All the selected action types are expected to be performed according to the amount and unit below on this form."),
queryset=KonovaCode.objects.filter( choices=[],
is_archived=False, widget=CompensationActionTreeCheckboxSelectMultiple(),
is_leaf=True,
code_lists__in=[CODELIST_COMPENSATION_ACTION_ID],
),
widget=autocomplete.ModelSelect2(
url="codes-compensation-action-autocomplete",
attrs={
"data-placeholder": _("Action"),
}
),
) )
action_type_details = forms.ModelMultipleChoiceField( action_type_details = forms.ModelMultipleChoiceField(
label=_("Action Type detail"), label=_("Action Type detail"),
@ -482,6 +474,16 @@ class NewActionModalForm(BaseModalForm):
super().__init__(*args, **kwargs) super().__init__(*args, **kwargs)
self.form_title = _("New action") self.form_title = _("New action")
self.form_caption = _("Insert data for the new action") self.form_caption = _("Insert data for the new action")
choices =KonovaCode.objects.filter(
code_lists__in=[CODELIST_COMPENSATION_ACTION_ID],
is_archived=False,
is_leaf=True,
).values_list("id", flat=True)
choices = [
(choice, choice)
for choice in choices
]
self.fields["action_type"].choices = choices
def save(self): def save(self):
action = self.instance.add_action(self) action = self.instance.add_action(self)
@ -496,7 +498,7 @@ class EditCompensationActionModalForm(NewActionModalForm):
self.action = kwargs.pop("action", None) self.action = kwargs.pop("action", None)
super().__init__(*args, **kwargs) super().__init__(*args, **kwargs)
form_data = { form_data = {
"action_type": self.action.action_type, "action_type": list(self.action.action_type.values_list("id", flat=True)),
"action_type_details": self.action.action_type_details.all(), "action_type_details": self.action.action_type_details.all(),
"amount": self.action.amount, "amount": self.action.amount,
"unit": self.action.unit, "unit": self.action.unit,
@ -506,7 +508,7 @@ class EditCompensationActionModalForm(NewActionModalForm):
def save(self): def save(self):
action = self.action action = self.action
action.action_type = self.cleaned_data.get("action_type", None) action.action_type.set(self.cleaned_data.get("action_type", []))
action.action_type_details.set(self.cleaned_data.get("action_type_details", [])) action.action_type_details.set(self.cleaned_data.get("action_type_details", []))
action.amount = self.cleaned_data.get("amount", None) action.amount = self.cleaned_data.get("amount", None)
action.unit = self.cleaned_data.get("unit", None) action.unit = self.cleaned_data.get("unit", None)

View File

@ -8,17 +8,6 @@ Created on: 14.10.21
from django.db import models from django.db import models
class CompensationActionManager(models.Manager):
""" Holds default db fetch setting for this model type
"""
def get_queryset(self):
return super().get_queryset().select_related(
"action_type",
"action_type__parent"
)
class CompensationStateManager(models.Manager): class CompensationStateManager(models.Manager):
""" Holds default db fetch setting for this model type """ Holds default db fetch setting for this model type

View File

@ -0,0 +1,42 @@
# Generated by Django 3.1.3 on 2022-02-10 13:02
from django.db import migrations, models
def migrate_actions(apps, schema_editor):
CompensationAction = apps.get_model('compensation', 'CompensationAction')
actions = CompensationAction.objects.all()
for action in actions:
action_type = action.action_type or []
action.action_type_tmp.set([action_type])
action.save()
if not action.action_type_tmp.count() > 0:
raise ValueError("Migration of actions did not work! Stoped before data loss!")
class Migration(migrations.Migration):
dependencies = [
('codelist', '0001_initial'),
('compensation', '0003_auto_20220202_0846'),
]
operations = [
migrations.AddField(
model_name='compensationaction',
name='action_type_tmp',
field=models.ManyToManyField(blank=True, limit_choices_to={'code_lists__in': [1026], 'is_archived': False, 'is_selectable': True}, related_name='_compensationaction_action_type_+', to='codelist.KonovaCode'),
),
migrations.RunPython(migrate_actions),
migrations.RemoveField(
model_name='compensationaction',
name='action_type',
),
migrations.RenameField(
model_name='compensationaction',
old_name='action_type_tmp',
new_name='action_type',
)
]

View File

@ -10,9 +10,7 @@ from django.utils.translation import gettext_lazy as _
from codelist.models import KonovaCode from codelist.models import KonovaCode
from codelist.settings import CODELIST_COMPENSATION_ACTION_ID, CODELIST_COMPENSATION_ACTION_DETAIL_ID from codelist.settings import CODELIST_COMPENSATION_ACTION_ID, CODELIST_COMPENSATION_ACTION_DETAIL_ID
from compensation.managers import CompensationActionManager
from konova.models import BaseResource from konova.models import BaseResource
from konova.utils.message_templates import COMPENSATION_ACTION_REMOVED
class UnitChoices(models.TextChoices): class UnitChoices(models.TextChoices):
@ -31,10 +29,8 @@ class CompensationAction(BaseResource):
""" """
Compensations include actions like planting trees, refreshing rivers and so on. Compensations include actions like planting trees, refreshing rivers and so on.
""" """
action_type = models.ForeignKey( action_type = models.ManyToManyField(
KonovaCode, KonovaCode,
on_delete=models.SET_NULL,
null=True,
blank=True, blank=True,
limit_choices_to={ limit_choices_to={
"code_lists__in": [CODELIST_COMPENSATION_ACTION_ID], "code_lists__in": [CODELIST_COMPENSATION_ACTION_ID],
@ -57,10 +53,8 @@ class CompensationAction(BaseResource):
unit = models.CharField(max_length=100, null=True, blank=True, choices=UnitChoices.choices) unit = models.CharField(max_length=100, null=True, blank=True, choices=UnitChoices.choices)
comment = models.TextField(blank=True, null=True, help_text="Additional comment") comment = models.TextField(blank=True, null=True, help_text="Additional comment")
objects = CompensationActionManager()
def __str__(self): def __str__(self):
return f"{self.action_type} | {self.amount} {self.unit}" return f"{self.action_type.all()} | {self.amount} {self.unit}"
@property @property
def unit_humanize(self): def unit_humanize(self):

View File

@ -104,12 +104,12 @@ class AbstractCompensation(BaseObject, GeoReferencedMixin):
with transaction.atomic(): with transaction.atomic():
user_action = UserActionLogEntry.get_created_action(user) user_action = UserActionLogEntry.get_created_action(user)
comp_action = CompensationAction.objects.create( comp_action = CompensationAction.objects.create(
action_type=form_data["action_type"],
amount=form_data["amount"], amount=form_data["amount"],
unit=form_data["unit"], unit=form_data["unit"],
comment=form_data["comment"], comment=form_data["comment"],
created=user_action, created=user_action,
) )
comp_action.action_type.set(form_data.get("action_type", []))
comp_action_details = form_data["action_type_details"] comp_action_details = form_data["action_type_details"]
comp_action.action_type_details.set(comp_action_details) comp_action.action_type_details.set(comp_action_details)
self.actions.add(comp_action) self.actions.add(comp_action)

View File

@ -47,13 +47,15 @@
{% for action in actions %} {% for action in actions %}
<tr> <tr>
<td class=""> <td class="">
<span>{{ action.action_type }}</span> {% for type in action.action_type.all %}
{% if action.action_type_details.count > 0 %} <div> {{type.parent.parent.long_name}} {% fa5_icon 'angle-right' %} {{type.parent.long_name}} {% fa5_icon 'angle-right' %} {{type.long_name}} </div>
<br> <hr>
{% for detail in action.action_type_details.all %} {% endfor %}
<span class="badge badge-pill rlp-r" title="{{detail}}">{{detail.long_name}}</span> {% for detail in action.action_type_details.all %}
{% endfor %} <span class="badge badge-pill rlp-r" title="{{detail}}">{{detail.long_name}}</span>
{% endif %} {% empty %}
<span class="badge badge-pill rlp-r-outline" title="{% trans 'No action type details' %}">{% trans 'No action type details' %}</span>
{% endfor %}
</td> </td>
<td class="">{{ action.amount|floatformat:2|intcomma }} {{ action.unit_humanize }}</td> <td class="">{{ action.amount|floatformat:2|intcomma }} {{ action.unit_humanize }}</td>
<td class=""> <td class="">

View File

@ -48,13 +48,13 @@
{% for state in after_states %} {% for state in after_states %}
<tr> <tr>
<td> <td>
<span>{{ state.biotope_type }}</span> <span>{{ state.biotope_type.parent.long_name }} {% fa5_icon 'angle-right' %} {{ state.biotope_type.long_name }} ({{state.biotope_type.short_name}})</span>
{% if state.biotope_type_details.count > 0 %} <br>
<br> {% for detail in state.biotope_type_details.all %}
{% for detail in state.biotope_type_details.all %} <span class="badge badge-pill rlp-r" title="{{detail}}">{{detail.long_name}}</span>
<span class="badge badge-pill rlp-r" title="{{detail}}">{{detail.long_name}}</span> {% empty %}
{% endfor %} <span class="badge badge-pill rlp-r-outline" title="{% trans 'No biotope type details' %}">{% trans 'No biotope type details' %}</span>
{% endif %} {% endfor %}
</td> </td>
<td>{{ state.surface|floatformat:2 }} m²</td> <td>{{ state.surface|floatformat:2 }} m²</td>
<td class="align-middle float-right"> <td class="align-middle float-right">

View File

@ -48,13 +48,13 @@
{% for state in before_states %} {% for state in before_states %}
<tr> <tr>
<td> <td>
<span>{{ state.biotope_type }}</span> <span>{{ state.biotope_type.parent.long_name }} {% fa5_icon 'angle-right' %} {{ state.biotope_type.long_name }} ({{state.biotope_type.short_name}})</span>
{% if state.biotope_type_details.count > 0 %} <br>
<br> {% for detail in state.biotope_type_details.all %}
{% for detail in state.biotope_type_details.all %} <span class="badge badge-pill rlp-r" title="{{detail}}">{{detail.long_name}}</span>
<span class="badge badge-pill rlp-r" title="{{detail}}">{{detail.long_name}}</span> {% empty %}
{% endfor %} <span class="badge badge-pill rlp-r-outline" title="{% trans 'No biotope type details' %}">{% trans 'No biotope type details' %}</span>
{% endif %} {% endfor %}
</td> </td>
<td>{{ state.surface|floatformat:2 }} m²</td> <td>{{ state.surface|floatformat:2 }} m²</td>
<td class="align-middle float-right"> <td class="align-middle float-right">

View File

@ -2,6 +2,7 @@
{% load i18n l10n static fontawesome_5 humanize ksp_filters %} {% load i18n l10n static fontawesome_5 humanize ksp_filters %}
{% block head %} {% block head %}
{% comment %} {% comment %}
dal documentation (django-autocomplete-light) states using form.media for adding needed scripts. dal documentation (django-autocomplete-light) states using form.media for adding needed scripts.
This does not work properly with modal forms, as the scripts are not loaded properly inside the modal. This does not work properly with modal forms, as the scripts are not loaded properly inside the modal.

View File

@ -46,13 +46,15 @@
{% for action in actions %} {% for action in actions %}
<tr> <tr>
<td class=""> <td class="">
<span>{{ action.action_type }}</span> {% for type in action.action_type.all %}
{% if action.action_type_details.count > 0 %} <div> {{type.parent.parent.long_name}} {% fa5_icon 'angle-right' %} {{type.parent.long_name}} {% fa5_icon 'angle-right' %} {{type.long_name}} </div>
<br> <hr>
{% for detail in action.action_type_details.all %} {% endfor %}
<span class="badge badge-pill rlp-r" title="{{detail}}">{{detail.long_name}}</span> {% for detail in action.action_type_details.all %}
{% endfor %} <span class="badge badge-pill rlp-r" title="{{detail}}">{{detail.long_name}}</span>
{% endif %} {% empty %}
<span class="badge badge-pill rlp-r-outline" title="{% trans 'No action type details' %}">{% trans 'No action type details' %}</span>
{% endfor %}
</td> </td>
<td class="">{{ action.amount|floatformat:2|intcomma }} {{ action.unit_humanize }}</td> <td class="">{{ action.amount|floatformat:2|intcomma }} {{ action.unit_humanize }}</td>
<td class=""> <td class="">

View File

@ -48,13 +48,13 @@
{% for state in after_states %} {% for state in after_states %}
<tr> <tr>
<td> <td>
<span>{{ state.biotope_type }}</span> <span>{{ state.biotope_type.parent.long_name }} {% fa5_icon 'angle-right' %} {{ state.biotope_type.long_name }} ({{state.biotope_type.short_name}})</span>
{% if state.biotope_type_details.count > 0 %} <br>
<br> {% for detail in state.biotope_type_details.all %}
{% for detail in state.biotope_type_details.all %} <span class="badge badge-pill rlp-r" title="{{detail}}">{{detail.long_name}}</span>
<span class="badge badge-pill rlp-r" title="{{detail}}">{{detail.long_name}}</span> {% empty %}
{% endfor %} <span class="badge badge-pill rlp-r-outline" title="{% trans 'No biotope type details' %}">{% trans 'No biotope type details' %}</span>
{% endif %} {% endfor %}
</td> </td>
<td>{{ state.surface|floatformat:2 }} m²</td> <td>{{ state.surface|floatformat:2 }} m²</td>
<td class="align-middle float-right"> <td class="align-middle float-right">

View File

@ -48,13 +48,13 @@
{% for state in before_states %} {% for state in before_states %}
<tr> <tr>
<td> <td>
<span>{{ state.biotope_type }}</span> <span>{{ state.biotope_type.parent.long_name }} {% fa5_icon 'angle-right' %} {{ state.biotope_type.long_name }} ({{state.biotope_type.short_name}})</span>
{% if state.biotope_type_details.count > 0 %} <br>
<br> {% for detail in state.biotope_type_details.all %}
{% for detail in state.biotope_type_details.all %} <span class="badge badge-pill rlp-r" title="{{detail}}">{{detail.long_name}}</span>
<span class="badge badge-pill rlp-r" title="{{detail}}">{{detail.long_name}}</span> {% empty %}
{% endfor %} <span class="badge badge-pill rlp-r-outline" title="{% trans 'No biotope type details' %}">{% trans 'No biotope type details' %}</span>
{% endif %} {% endfor %}
</td> </td>
<td>{{ state.surface|floatformat:2 }} m²</td> <td>{{ state.surface|floatformat:2 }} m²</td>
<td class="align-middle float-right"> <td class="align-middle float-right">

View File

@ -2,6 +2,7 @@
{% load i18n l10n static fontawesome_5 humanize %} {% load i18n l10n static fontawesome_5 humanize %}
{% block head %} {% block head %}
{% comment %} {% comment %}
dal documentation (django-autocomplete-light) states using form.media for adding needed scripts. dal documentation (django-autocomplete-light) states using form.media for adding needed scripts.
This does not work properly with modal forms, as the scripts are not loaded properly inside the modal. This does not work properly with modal forms, as the scripts are not loaded properly inside the modal.

View File

@ -44,13 +44,15 @@
{% for action in obj.actions.all %} {% for action in obj.actions.all %}
<tr> <tr>
<td class=""> <td class="">
<span>{{ action.action_type }}</span> {% for type in action.action_type.all %}
{% if action.action_type_details.count > 0 %} <div> {{type.parent.parent.long_name}} {% fa5_icon 'angle-right' %} {{type.parent.long_name}} {% fa5_icon 'angle-right' %} {{type.long_name}} </div>
<br> <hr>
{% for detail in action.action_type_details.all %} {% endfor %}
<span class="badge badge-pill rlp-r" title="{{detail}}">{{detail.long_name}}</span> {% for detail in action.action_type_details.all %}
{% endfor %} <span class="badge badge-pill rlp-r" title="{{detail}}">{{detail.long_name}}</span>
{% endif %} {% empty %}
<span class="badge badge-pill rlp-r-outline" title="{% trans 'No action type details' %}">{% trans 'No action type details' %}</span>
{% endfor %}
</td> </td>
<td class="">{{ action.amount|floatformat:2|intcomma }} {{ action.unit_humanize }}</td> <td class="">{{ action.amount|floatformat:2|intcomma }} {{ action.unit_humanize }}</td>
<td class=""> <td class="">

View File

@ -46,13 +46,13 @@
{% for state in after_states %} {% for state in after_states %}
<tr> <tr>
<td> <td>
<span>{{ state.biotope_type }}</span> <span>{{ state.biotope_type.parent.long_name }} {% fa5_icon 'angle-right' %} {{ state.biotope_type.long_name }} ({{state.biotope_type.short_name}})</span>
{% if state.biotope_type_details.count > 0 %} <br>
<br> {% for detail in state.biotope_type_details.all %}
{% for detail in state.biotope_type_details.all %} <span class="badge badge-pill rlp-r" title="{{detail}}">{{detail.long_name}}</span>
<span class="badge badge-pill rlp-r" title="{{detail}}">{{detail.long_name}}</span> {% empty %}
{% endfor %} <span class="badge badge-pill rlp-r-outline" title="{% trans 'No biotope type details' %}">{% trans 'No biotope type details' %}</span>
{% endif %} {% endfor %}
</td> </td>
<td>{{ state.surface|floatformat:2 }} m²</td> <td>{{ state.surface|floatformat:2 }} m²</td>
<td class="align-middle float-right"> <td class="align-middle float-right">

View File

@ -46,13 +46,13 @@
{% for state in before_states %} {% for state in before_states %}
<tr> <tr>
<td> <td>
<span>{{ state.biotope_type }}</span> <span>{{ state.biotope_type.parent.long_name }} {% fa5_icon 'angle-right' %} {{ state.biotope_type.long_name }} ({{state.biotope_type.short_name}})</span>
{% if state.biotope_type_details.count > 0 %} <br>
<br> {% for detail in state.biotope_type_details.all %}
{% for detail in state.biotope_type_details.all %} <span class="badge badge-pill rlp-r" title="{{detail}}">{{detail.long_name}}</span>
<span class="badge badge-pill rlp-r" title="{{detail}}">{{detail.long_name}}</span> {% empty %}
{% endfor %} <span class="badge badge-pill rlp-r-outline" title="{% trans 'No biotope type details' %}">{% trans 'No biotope type details' %}</span>
{% endif %} {% endfor %}
</td> </td>
<td>{{ state.surface|floatformat:2 }} m²</td> <td>{{ state.surface|floatformat:2 }} m²</td>
<td class="align-middle float-right"> <td class="align-middle float-right">

View File

@ -1,4 +1,6 @@
from django import forms from django import forms
from codelist.models import KonovaCode
from codelist.settings import CODELIST_COMPENSATION_ACTION_ID
class DummyFilterInput(forms.HiddenInput): class DummyFilterInput(forms.HiddenInput):
@ -30,3 +32,51 @@ class GenerateInput(forms.TextInput):
""" """
template_name = "konova/widgets/generate-content-input.html" template_name = "konova/widgets/generate-content-input.html"
class TreeCheckboxSelectMultiple(forms.CheckboxSelectMultiple):
""" Provides multiple selection of parent-child data
"""
template_name = "konova/widgets/checkbox-tree-select.html"
class meta:
abstract = True
class KonovaCodeTreeCheckboxSelectMultiple(TreeCheckboxSelectMultiple):
""" Provides multiple selection of KonovaCodes
"""
filter = None
def __init__(self, *args, **kwargs):
self.code_list = kwargs.pop("code_list", None)
self.filter = kwargs.pop("filter", {})
super().__init__(*args, **kwargs)
def get_context(self, name, value, attrs):
context = super().get_context(name, value, attrs)
codes = KonovaCode.objects.filter(
**self.filter,
)
codes = [
parent_code.add_children()
for parent_code in codes
]
context["codes"] = codes
return context
class CompensationActionTreeCheckboxSelectMultiple(KonovaCodeTreeCheckboxSelectMultiple):
""" Provides multiple selection of CompensationActions
"""
filter = None
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.filter = {
"code_lists__in": [CODELIST_COMPENSATION_ACTION_ID],
"parent": None,
}

View File

@ -5,7 +5,12 @@ Contact: michel.peltriaux@sgdnord.rlp.de
Created on: 07.12.20 Created on: 07.12.20
""" """
import collections
from dal_select2.views import Select2QuerySetView, Select2GroupQuerySetView from dal_select2.views import Select2QuerySetView, Select2GroupQuerySetView
from django.core.exceptions import ImproperlyConfigured
from konova.utils.message_templates import UNGROUPED
from user.models import User from user.models import User
from django.db.models import Q from django.db.models import Q
@ -139,6 +144,8 @@ class KonovaCodeAutocomplete(Select2GroupQuerySetView):
q_or |= Q(short_name__icontains=keyword) q_or |= Q(short_name__icontains=keyword)
q_or |= Q(parent__long_name__icontains=keyword) q_or |= Q(parent__long_name__icontains=keyword)
q_or |= Q(parent__short_name__icontains=keyword) q_or |= Q(parent__short_name__icontains=keyword)
q_or |= Q(parent__parent__long_name__icontains=keyword)
q_or |= Q(parent__parent__short_name__icontains=keyword)
_filter.add(q_or, Q.AND) _filter.add(q_or, Q.AND)
qs = qs.filter(_filter).distinct() qs = qs.filter(_filter).distinct()
return qs return qs
@ -181,7 +188,7 @@ class CompensationActionDetailCodeAutocomplete(KonovaCodeAutocomplete):
def order_by(self, qs): def order_by(self, qs):
return qs.order_by( return qs.order_by(
"parent__long_name" "long_name"
) )
@ -214,6 +221,41 @@ class BiotopeCodeAutocomplete(KonovaCodeAutocomplete):
def get_result_label(self, result): def get_result_label(self, result):
return f"{result.long_name} ({result.short_name})" return f"{result.long_name} ({result.short_name})"
def get_results(self, context):
"""Return the options grouped by a common related model.
Raises ImproperlyConfigured if self.group_by_name is not configured
"""
if not self.group_by_related:
raise ImproperlyConfigured("Missing group_by_related.")
super_groups = collections.OrderedDict()
object_list = context['object_list']
for result in object_list:
group = result.parent if result.parent else None
group_name = f"{group.long_name} ({group.short_name})" if group else UNGROUPED
super_group = result.parent.parent if result.parent else None
super_group_name = f"{super_group.long_name} ({super_group.short_name})" if super_group else UNGROUPED
super_groups.setdefault(super_group_name, {})
super_groups[super_group_name].setdefault(group_name, [])
super_groups[super_group_name][group_name].append(result)
return [{
'id': None,
'text': super_group,
'children': [{
"id": None,
"text": group,
"children": [{
'id': self.get_result_value(result),
'text': self.get_result_label(result),
'selected_text': self.get_selected_result_label(result),
} for result in results]
} for group, results in groups.items()]
} for super_group, groups in super_groups.items()]
class BiotopeExtraCodeAutocomplete(KonovaCodeAutocomplete): class BiotopeExtraCodeAutocomplete(KonovaCodeAutocomplete):
""" """
@ -239,7 +281,7 @@ class BiotopeExtraCodeAutocomplete(KonovaCodeAutocomplete):
qs (QuerySet): The ordered queryset qs (QuerySet): The ordered queryset
""" """
return qs.order_by( return qs.order_by(
"parent__long_name", "long_name",
) )
def get_result_label(self, result): def get_result_label(self, result):
@ -284,6 +326,11 @@ class RegistrationOfficeCodeAutocomplete(KonovaCodeAutocomplete):
self.c = CODELIST_REGISTRATION_OFFICE_ID self.c = CODELIST_REGISTRATION_OFFICE_ID
super().__init__(*args, **kwargs) super().__init__(*args, **kwargs)
def order_by(self, qs):
return qs.order_by(
"parent__long_name"
)
class ConservationOfficeCodeAutocomplete(KonovaCodeAutocomplete): class ConservationOfficeCodeAutocomplete(KonovaCodeAutocomplete):
""" """
@ -297,4 +344,4 @@ class ConservationOfficeCodeAutocomplete(KonovaCodeAutocomplete):
super().__init__(*args, **kwargs) super().__init__(*args, **kwargs)
def get_result_label(self, result): def get_result_label(self, result):
return f"{result.long_name} ({result.short_name})" return f"{result.long_name} ({result.short_name})"

View File

@ -242,15 +242,24 @@ Similar to bootstraps 'shadow-lg'
.select2-results__option--highlighted{ .select2-results__option--highlighted{
background-color: var(--rlp-red) !important; background-color: var(--rlp-red) !important;
} }
/*
.select2-container--default .select2-results__group{ .select2-container--default .select2-results__group{
background-color: var(--rlp-gray-light); background-color: var(--rlp-gray-light);
} }
.select2-container--default .select2-results__option .select2-results__option{ .select2-container--default .select2-results__option .select2-results__option{
padding-left: 2em !important; padding-left: 1em !important;
}
*/
.select2-results__options--nested{
padding-left: 1em !important;
} }
.select2-container--default .select2-results > .select2-results__options{ .select2-container--default .select2-results > .select2-results__options{
max-height: 500px !important; max-height: 500px !important;
} }
/*
.select2-container--default .select2-results__option .select2-results__option{ .select2-container--default .select2-results__option .select2-results__option{
padding-left: 2em; padding-left: 2em;
} }
*/

View File

@ -0,0 +1,21 @@
{% load l10n fontawesome_5 %}
{% for code in codes %}
<div class="ml-4 tree-element">
<label class="tree-label" role="{% if not code.is_leaf%}button{% endif %}" for="input_{{code.pk|unlocalize}}" id="{{code.pk|unlocalize}}" data-toggle="collapse" data-target="#children_{{code.pk|unlocalize}}" aria-expanded="true" aria-controls="children_{{code.pk|unlocalize}}">
{% if code.is_leaf%}
<input class="tree-input" id="input_{{code.pk|unlocalize}}" name="{{ widget.name }}" type="checkbox" value="{{code.pk|unlocalize}}" {% if code.pk|unlocalize in widget.value %}checked{% endif %}/>
{% else %}
{% fa5_icon 'angle-right' %}
{% endif %}
{{code.long_name}}
</label>
{% if not code.is_leaf %}
<div id="children_{{code.pk|unlocalize}}" data-toggle="collapse" class="collapse tree-element-children">
{% with code.children as codes %}
{% include 'konova/widgets/checkbox-tree-select-content.html' %}
{% endwith %}
</div>
{% endif %}
</div>
{% endfor %}

View File

@ -0,0 +1,68 @@
{% load i18n %}
<div class="ml-4 mb-4">
<input id="tree-search-input" class="form-control" type="text" placeholder="{% trans 'Search' %}"/>
</div>
<div id="tree-root">
{% include 'konova/widgets/checkbox-tree-select-content.html' %}
</div>
<script>
function toggleSelectedCssClass(element){
element = $(element);
var cssClass = "badge rlp-r"
var directParent = element.closest(".tree-element-children")
var root = element.parents(".tree-element-children")
var otherCheckedInputsOfParent = directParent.find('.tree-input:checked');
var otherCheckedInputsOfRoot = root.find('.tree-input:checked');
if(otherCheckedInputsOfParent.length == 0){
var parentLabel = directParent.siblings(".tree-label");
parentLabel.removeClass(cssClass)
if(otherCheckedInputsOfRoot.length == 0){
var rootLabel = root.siblings(".tree-label")
rootLabel.removeClass(cssClass)
}
}else{
var rootAndParentLabel = root.siblings(".tree-label");
rootAndParentLabel.addClass(cssClass);
}
}
function changeHandler(event){
toggleSelectedCssClass(this);
}
function searchInputHandler(event){
var elem = $(this);
var val = elem.val()
var allTreeElements = $(".tree-element")
var allTreeElementsContain = $(".tree-element").filter(function(){
var reg = new RegExp(val, "i");
return reg.test($(this).text());
}
);
if(val.length > 0){
allTreeElements.hide()
allTreeElementsContain.show()
}else{
allTreeElements.show()
}
}
// Add event listener on search input
$("#tree-search-input").keyup(searchInputHandler)
// Add event listener on changed checkboxes
$(".tree-input").change(changeHandler);
// initialize all pre-checked checkboxes (e.g. on an edit form)
var preCheckedElements = $(".tree-input:checked");
preCheckedElements.each(function (index, element){
toggleSelectedCssClass(element);
})
</script>

View File

@ -7,7 +7,7 @@ Created on: 02.08.21
""" """
from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext_lazy as _
UNGROUPED = _("Ungrouped")
FORM_INVALID = _("There was an error on this form.") FORM_INVALID = _("There was an error on this form.")
PARAMS_INVALID = _("Invalid parameters") PARAMS_INVALID = _("Invalid parameters")
INTERVENTION_INVALID = _("There are errors in this intervention.") INTERVENTION_INVALID = _("There are errors in this intervention.")

View File

@ -9,9 +9,12 @@ from django.contrib.auth import logout
from django.contrib.auth.decorators import login_required from django.contrib.auth.decorators import login_required
from django.http import HttpRequest, FileResponse from django.http import HttpRequest, FileResponse
from django.shortcuts import redirect, render, get_object_or_404 from django.shortcuts import redirect, render, get_object_or_404
from django.template.loader import render_to_string
from django.utils import timezone from django.utils import timezone
from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext_lazy as _
from codelist.models import KonovaCode
from codelist.settings import CODELIST_COMPENSATION_ACTION_ID
from compensation.models import Compensation, EcoAccount from compensation.models import Compensation, EcoAccount
from intervention.models import Intervention from intervention.models import Intervention
from konova.contexts import BaseContext from konova.contexts import BaseContext

Binary file not shown.

View File

@ -3,9 +3,9 @@
# This file is distributed under the same license as the PACKAGE package. # This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
# #
#: compensation/filters.py:122 compensation/forms/modalForms.py:35 #: compensation/filters.py:122 compensation/forms/modalForms.py:36
#: compensation/forms/modalForms.py:46 compensation/forms/modalForms.py:62 #: compensation/forms/modalForms.py:47 compensation/forms/modalForms.py:63
#: compensation/forms/modalForms.py:355 compensation/forms/modalForms.py:471 #: compensation/forms/modalForms.py:356 compensation/forms/modalForms.py:463
#: intervention/forms/forms.py:54 intervention/forms/forms.py:156 #: intervention/forms/forms.py:54 intervention/forms/forms.py:156
#: intervention/forms/forms.py:168 intervention/forms/modalForms.py:127 #: intervention/forms/forms.py:168 intervention/forms/modalForms.py:127
#: intervention/forms/modalForms.py:140 intervention/forms/modalForms.py:153 #: intervention/forms/modalForms.py:140 intervention/forms/modalForms.py:153
@ -26,7 +26,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-02-10 13:31+0100\n" "POT-Creation-Date: 2022-02-15 15:29+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -45,7 +45,7 @@ msgid "To"
msgstr "Bis" msgstr "Bis"
#: analysis/forms.py:47 compensation/forms/forms.py:77 #: analysis/forms.py:47 compensation/forms/forms.py:77
#: compensation/templates/compensation/detail/eco_account/view.html:58 #: compensation/templates/compensation/detail/eco_account/view.html:59
#: compensation/templates/compensation/report/eco_account/report.html:16 #: compensation/templates/compensation/report/eco_account/report.html:16
#: compensation/utils/quality.py:100 ema/templates/ema/detail/view.html:49 #: compensation/utils/quality.py:100 ema/templates/ema/detail/view.html:49
#: ema/templates/ema/report/report.html:16 ema/utils/quality.py:26 #: ema/templates/ema/report/report.html:16 ema/utils/quality.py:26
@ -95,7 +95,7 @@ msgstr ""
#: analysis/templates/analysis/reports/includes/eco_account/amount.html:3 #: analysis/templates/analysis/reports/includes/eco_account/amount.html:3
#: analysis/templates/analysis/reports/includes/intervention/amount.html:3 #: analysis/templates/analysis/reports/includes/intervention/amount.html:3
#: analysis/templates/analysis/reports/includes/old_data/amount.html:3 #: analysis/templates/analysis/reports/includes/old_data/amount.html:3
#: compensation/forms/modalForms.py:455 #: compensation/forms/modalForms.py:447
#: compensation/templates/compensation/detail/eco_account/includes/deductions.html:34 #: compensation/templates/compensation/detail/eco_account/includes/deductions.html:34
#: intervention/templates/intervention/detail/includes/deductions.html:31 #: intervention/templates/intervention/detail/includes/deductions.html:31
msgid "Amount" msgid "Amount"
@ -137,7 +137,7 @@ msgstr "Zuständigkeitsbereich"
#: analysis/templates/analysis/reports/includes/intervention/compensated_by.html:8 #: analysis/templates/analysis/reports/includes/intervention/compensated_by.html:8
#: analysis/templates/analysis/reports/includes/intervention/laws.html:17 #: analysis/templates/analysis/reports/includes/intervention/laws.html:17
#: compensation/tables.py:40 #: compensation/tables.py:40
#: compensation/templates/compensation/detail/compensation/view.html:63 #: compensation/templates/compensation/detail/compensation/view.html:64
#: intervention/tables.py:39 #: intervention/tables.py:39
#: intervention/templates/intervention/detail/view.html:68 #: intervention/templates/intervention/detail/view.html:68
#: user/models/user_action.py:20 #: user/models/user_action.py:20
@ -153,9 +153,9 @@ msgstr "Geprüft"
#: analysis/templates/analysis/reports/includes/intervention/laws.html:20 #: analysis/templates/analysis/reports/includes/intervention/laws.html:20
#: analysis/templates/analysis/reports/includes/old_data/amount.html:18 #: analysis/templates/analysis/reports/includes/old_data/amount.html:18
#: compensation/tables.py:46 compensation/tables.py:222 #: compensation/tables.py:46 compensation/tables.py:222
#: compensation/templates/compensation/detail/compensation/view.html:77 #: compensation/templates/compensation/detail/compensation/view.html:78
#: compensation/templates/compensation/detail/eco_account/includes/deductions.html:31 #: compensation/templates/compensation/detail/eco_account/includes/deductions.html:31
#: compensation/templates/compensation/detail/eco_account/view.html:44 #: compensation/templates/compensation/detail/eco_account/view.html:45
#: ema/tables.py:44 ema/templates/ema/detail/view.html:35 #: ema/tables.py:44 ema/templates/ema/detail/view.html:35
#: intervention/tables.py:45 #: intervention/tables.py:45
#: intervention/templates/intervention/detail/view.html:82 #: intervention/templates/intervention/detail/view.html:82
@ -213,7 +213,7 @@ msgstr "Abbuchungen"
#: analysis/templates/analysis/reports/includes/eco_account/deductions.html:9 #: analysis/templates/analysis/reports/includes/eco_account/deductions.html:9
#: analysis/templates/analysis/reports/includes/eco_account/deductions.html:11 #: analysis/templates/analysis/reports/includes/eco_account/deductions.html:11
#: compensation/forms/modalForms.py:193 #: compensation/forms/modalForms.py:194
#: compensation/templates/compensation/detail/compensation/includes/states-after.html:36 #: compensation/templates/compensation/detail/compensation/includes/states-after.html:36
#: compensation/templates/compensation/detail/compensation/includes/states-before.html:36 #: compensation/templates/compensation/detail/compensation/includes/states-before.html:36
#: compensation/templates/compensation/detail/eco_account/includes/states-after.html:36 #: compensation/templates/compensation/detail/eco_account/includes/states-after.html:36
@ -239,14 +239,14 @@ msgstr "Kompensationsart"
#: analysis/templates/analysis/reports/includes/intervention/compensated_by.html:15 #: analysis/templates/analysis/reports/includes/intervention/compensated_by.html:15
#: analysis/templates/analysis/reports/includes/old_data/amount.html:29 #: analysis/templates/analysis/reports/includes/old_data/amount.html:29
#: compensation/templates/compensation/detail/compensation/view.html:19 #: compensation/templates/compensation/detail/compensation/view.html:20
#: konova/templates/konova/includes/quickstart/compensations.html:4 #: konova/templates/konova/includes/quickstart/compensations.html:4
#: templates/navbars/navbar.html:28 #: templates/navbars/navbar.html:28
msgid "Compensation" msgid "Compensation"
msgstr "Kompensation" msgstr "Kompensation"
#: analysis/templates/analysis/reports/includes/intervention/compensated_by.html:21 #: analysis/templates/analysis/reports/includes/intervention/compensated_by.html:21
#: compensation/forms/modalForms.py:75 #: compensation/forms/modalForms.py:76
msgid "Payment" msgid "Payment"
msgstr "Zahlung" msgstr "Zahlung"
@ -293,7 +293,7 @@ msgstr "Eingriff"
#: analysis/templates/analysis/reports/includes/old_data/amount.html:34 #: analysis/templates/analysis/reports/includes/old_data/amount.html:34
#: compensation/tables.py:266 #: compensation/tables.py:266
#: compensation/templates/compensation/detail/eco_account/view.html:19 #: compensation/templates/compensation/detail/eco_account/view.html:20
#: intervention/forms/modalForms.py:322 intervention/forms/modalForms.py:329 #: intervention/forms/modalForms.py:322 intervention/forms/modalForms.py:329
#: konova/templates/konova/includes/quickstart/ecoaccounts.html:4 #: konova/templates/konova/includes/quickstart/ecoaccounts.html:4
#: templates/navbars/navbar.html:34 #: templates/navbars/navbar.html:34
@ -327,9 +327,9 @@ msgstr "Automatisch generiert"
#: compensation/forms/forms.py:44 compensation/tables.py:30 #: compensation/forms/forms.py:44 compensation/tables.py:30
#: compensation/tables.py:202 #: compensation/tables.py:202
#: compensation/templates/compensation/detail/compensation/includes/documents.html:28 #: compensation/templates/compensation/detail/compensation/includes/documents.html:28
#: compensation/templates/compensation/detail/compensation/view.html:31 #: compensation/templates/compensation/detail/compensation/view.html:32
#: compensation/templates/compensation/detail/eco_account/includes/documents.html:28 #: compensation/templates/compensation/detail/eco_account/includes/documents.html:28
#: compensation/templates/compensation/detail/eco_account/view.html:31 #: compensation/templates/compensation/detail/eco_account/view.html:32
#: compensation/templates/compensation/report/compensation/report.html:12 #: compensation/templates/compensation/report/compensation/report.html:12
#: compensation/templates/compensation/report/eco_account/report.html:12 #: compensation/templates/compensation/report/eco_account/report.html:12
#: ema/tables.py:34 ema/templates/ema/detail/includes/documents.html:28 #: ema/tables.py:34 ema/templates/ema/detail/includes/documents.html:28
@ -352,8 +352,8 @@ msgstr "Aussagekräftiger Titel"
msgid "Compensation XY; Location ABC" msgid "Compensation XY; Location ABC"
msgstr "Kompensation XY; Flur ABC" msgstr "Kompensation XY; Flur ABC"
#: compensation/forms/forms.py:57 compensation/forms/modalForms.py:61 #: compensation/forms/forms.py:57 compensation/forms/modalForms.py:62
#: compensation/forms/modalForms.py:354 compensation/forms/modalForms.py:470 #: compensation/forms/modalForms.py:355 compensation/forms/modalForms.py:462
#: compensation/templates/compensation/detail/compensation/includes/actions.html:35 #: compensation/templates/compensation/detail/compensation/includes/actions.html:35
#: compensation/templates/compensation/detail/compensation/includes/deadlines.html:34 #: compensation/templates/compensation/detail/compensation/includes/deadlines.html:34
#: compensation/templates/compensation/detail/compensation/includes/documents.html:34 #: compensation/templates/compensation/detail/compensation/includes/documents.html:34
@ -371,13 +371,13 @@ msgstr "Kompensation XY; Flur ABC"
msgid "Comment" msgid "Comment"
msgstr "Kommentar" msgstr "Kommentar"
#: compensation/forms/forms.py:59 compensation/forms/modalForms.py:472 #: compensation/forms/forms.py:59 compensation/forms/modalForms.py:464
#: intervention/forms/forms.py:182 #: intervention/forms/forms.py:182
msgid "Additional comment" msgid "Additional comment"
msgstr "Zusätzlicher Kommentar" msgstr "Zusätzlicher Kommentar"
#: compensation/forms/forms.py:93 #: compensation/forms/forms.py:93
#: compensation/templates/compensation/detail/eco_account/view.html:62 #: compensation/templates/compensation/detail/eco_account/view.html:63
#: compensation/templates/compensation/report/eco_account/report.html:20 #: compensation/templates/compensation/report/eco_account/report.html:20
#: compensation/utils/quality.py:102 ema/templates/ema/detail/view.html:53 #: compensation/utils/quality.py:102 ema/templates/ema/detail/view.html:53
#: ema/templates/ema/report/report.html:20 ema/utils/quality.py:28 #: ema/templates/ema/report/report.html:20 ema/utils/quality.py:28
@ -422,7 +422,7 @@ msgid ""
msgstr "Optional: Handelt es sich um eine Kohärenzsicherungsmaßnahme?" msgstr "Optional: Handelt es sich um eine Kohärenzsicherungsmaßnahme?"
#: compensation/forms/forms.py:156 #: compensation/forms/forms.py:156
#: compensation/templates/compensation/detail/compensation/view.html:35 #: compensation/templates/compensation/detail/compensation/view.html:36
#: compensation/templates/compensation/report/compensation/report.html:16 #: compensation/templates/compensation/report/compensation/report.html:16
msgid "compensates intervention" msgid "compensates intervention"
msgstr "kompensiert Eingriff" msgstr "kompensiert Eingriff"
@ -448,7 +448,7 @@ msgid "The amount that can be used for deductions"
msgstr "Die für Abbuchungen zur Verfügung stehende Menge" msgstr "Die für Abbuchungen zur Verfügung stehende Menge"
#: compensation/forms/forms.py:328 #: compensation/forms/forms.py:328
#: compensation/templates/compensation/detail/eco_account/view.html:66 #: compensation/templates/compensation/detail/eco_account/view.html:67
#: compensation/utils/quality.py:72 #: compensation/utils/quality.py:72
msgid "Agreement date" msgid "Agreement date"
msgstr "Vereinbarungsdatum" msgstr "Vereinbarungsdatum"
@ -469,73 +469,73 @@ msgstr "Ökokonto XY; Flur ABC"
msgid "Edit Eco-Account" msgid "Edit Eco-Account"
msgstr "Ökokonto bearbeiten" msgstr "Ökokonto bearbeiten"
#: compensation/forms/modalForms.py:36 #: compensation/forms/modalForms.py:37
msgid "in Euro" msgid "in Euro"
msgstr "in Euro" msgstr "in Euro"
#: compensation/forms/modalForms.py:45 #: compensation/forms/modalForms.py:46
#: intervention/templates/intervention/detail/includes/payments.html:31 #: intervention/templates/intervention/detail/includes/payments.html:31
msgid "Due on" msgid "Due on"
msgstr "Fällig am" msgstr "Fällig am"
#: compensation/forms/modalForms.py:48 #: compensation/forms/modalForms.py:49
msgid "Due on which date" msgid "Due on which date"
msgstr "Zahlung wird an diesem Datum erwartet" msgstr "Zahlung wird an diesem Datum erwartet"
#: compensation/forms/modalForms.py:63 compensation/forms/modalForms.py:356 #: compensation/forms/modalForms.py:64 compensation/forms/modalForms.py:357
#: intervention/forms/modalForms.py:154 konova/forms.py:395 #: intervention/forms/modalForms.py:154 konova/forms.py:395
msgid "Additional comment, maximum {} letters" msgid "Additional comment, maximum {} letters"
msgstr "Zusätzlicher Kommentar, maximal {} Zeichen" msgstr "Zusätzlicher Kommentar, maximal {} Zeichen"
#: compensation/forms/modalForms.py:76 #: compensation/forms/modalForms.py:77
msgid "Add a payment for intervention '{}'" msgid "Add a payment for intervention '{}'"
msgstr "Neue Ersatzzahlung zu Eingriff '{}' hinzufügen" msgstr "Neue Ersatzzahlung zu Eingriff '{}' hinzufügen"
#: compensation/forms/modalForms.py:96 #: compensation/forms/modalForms.py:97
msgid "If there is no date you can enter, please explain why." msgid "If there is no date you can enter, please explain why."
msgstr "Falls Sie kein Datum angeben können, erklären Sie bitte weshalb." msgstr "Falls Sie kein Datum angeben können, erklären Sie bitte weshalb."
#: compensation/forms/modalForms.py:157 compensation/forms/modalForms.py:169 #: compensation/forms/modalForms.py:158 compensation/forms/modalForms.py:170
msgid "Biotope Type" msgid "Biotope Type"
msgstr "Biotoptyp" msgstr "Biotoptyp"
#: compensation/forms/modalForms.py:160 #: compensation/forms/modalForms.py:161
msgid "Select the biotope type" msgid "Select the biotope type"
msgstr "Biotoptyp wählen" msgstr "Biotoptyp wählen"
#: compensation/forms/modalForms.py:174 compensation/forms/modalForms.py:186 #: compensation/forms/modalForms.py:175 compensation/forms/modalForms.py:187
msgid "Biotope additional type" msgid "Biotope additional type"
msgstr "Zusatzbezeichnung" msgstr "Zusatzbezeichnung"
#: compensation/forms/modalForms.py:177 #: compensation/forms/modalForms.py:178
msgid "Select an additional biotope type" msgid "Select an additional biotope type"
msgstr "Zusatzbezeichnung wählen" msgstr "Zusatzbezeichnung wählen"
#: compensation/forms/modalForms.py:196 intervention/forms/modalForms.py:340 #: compensation/forms/modalForms.py:197 intervention/forms/modalForms.py:340
msgid "in m²" msgid "in m²"
msgstr "" msgstr ""
#: compensation/forms/modalForms.py:207 #: compensation/forms/modalForms.py:208
msgid "New state" msgid "New state"
msgstr "Neuer Zustand" msgstr "Neuer Zustand"
#: compensation/forms/modalForms.py:208 #: compensation/forms/modalForms.py:209
msgid "Insert data for the new state" msgid "Insert data for the new state"
msgstr "Geben Sie die Daten des neuen Zustandes ein" msgstr "Geben Sie die Daten des neuen Zustandes ein"
#: compensation/forms/modalForms.py:215 konova/forms.py:193 #: compensation/forms/modalForms.py:216 konova/forms.py:193
msgid "Object removed" msgid "Object removed"
msgstr "Objekt entfernt" msgstr "Objekt entfernt"
#: compensation/forms/modalForms.py:326 #: compensation/forms/modalForms.py:327
msgid "Deadline Type" msgid "Deadline Type"
msgstr "Fristart" msgstr "Fristart"
#: compensation/forms/modalForms.py:329 #: compensation/forms/modalForms.py:330
msgid "Select the deadline type" msgid "Select the deadline type"
msgstr "Fristart wählen" msgstr "Fristart wählen"
#: compensation/forms/modalForms.py:338 #: compensation/forms/modalForms.py:339
#: compensation/templates/compensation/detail/compensation/includes/deadlines.html:31 #: compensation/templates/compensation/detail/compensation/includes/deadlines.html:31
#: compensation/templates/compensation/detail/eco_account/includes/deadlines.html:31 #: compensation/templates/compensation/detail/eco_account/includes/deadlines.html:31
#: ema/templates/ema/detail/includes/deadlines.html:31 #: ema/templates/ema/detail/includes/deadlines.html:31
@ -543,101 +543,81 @@ msgstr "Fristart wählen"
msgid "Date" msgid "Date"
msgstr "Datum" msgstr "Datum"
#: compensation/forms/modalForms.py:341 #: compensation/forms/modalForms.py:342
msgid "Select date" msgid "Select date"
msgstr "Datum wählen" msgstr "Datum wählen"
#: compensation/forms/modalForms.py:368 #: compensation/forms/modalForms.py:369
msgid "New deadline" msgid "New deadline"
msgstr "Neue Frist" msgstr "Neue Frist"
#: compensation/forms/modalForms.py:369 #: compensation/forms/modalForms.py:370
msgid "Insert data for the new deadline" msgid "Insert data for the new deadline"
msgstr "Geben Sie die Daten der neuen Frist ein" msgstr "Geben Sie die Daten der neuen Frist ein"
#: compensation/forms/modalForms.py:409 #: compensation/forms/modalForms.py:410
msgid "Action Type" msgid "Action Type"
msgstr "Maßnahmentyp" msgstr "Maßnahmentyp"
#: compensation/forms/modalForms.py:412 #: compensation/forms/modalForms.py:413
msgid "Select the action type" msgid ""
msgstr "Maßnahmentyp wählen" "An action can consist of multiple different action types. All the selected "
"action types are expected to be performed according to the amount and unit "
"below on this form."
msgstr ""
"Eine Maßnahme kann aus mehreren verschiedenen Maßnahmentypen bestehen. Alle "
"hier gewählten Einträge sollen mit der weiter unten angegebenen Einheit und "
"Menge umgesetzt werden. "
#: compensation/forms/modalForms.py:421 #: compensation/forms/modalForms.py:418 compensation/forms/modalForms.py:430
#: compensation/templates/compensation/detail/compensation/includes/actions.html:40
#: compensation/templates/compensation/detail/compensation/includes/deadlines.html:39
#: compensation/templates/compensation/detail/compensation/includes/documents.html:39
#: compensation/templates/compensation/detail/compensation/includes/states-after.html:41
#: compensation/templates/compensation/detail/compensation/includes/states-before.html:41
#: compensation/templates/compensation/detail/eco_account/includes/actions.html:39
#: compensation/templates/compensation/detail/eco_account/includes/deadlines.html:38
#: compensation/templates/compensation/detail/eco_account/includes/deductions.html:41
#: compensation/templates/compensation/detail/eco_account/includes/documents.html:38
#: compensation/templates/compensation/detail/eco_account/includes/states-after.html:41
#: compensation/templates/compensation/detail/eco_account/includes/states-before.html:41
#: ema/templates/ema/detail/includes/actions.html:38
#: ema/templates/ema/detail/includes/deadlines.html:38
#: ema/templates/ema/detail/includes/documents.html:38
#: ema/templates/ema/detail/includes/states-after.html:40
#: ema/templates/ema/detail/includes/states-before.html:40
#: intervention/templates/intervention/detail/includes/compensations.html:38
#: intervention/templates/intervention/detail/includes/deductions.html:39
#: intervention/templates/intervention/detail/includes/documents.html:39
#: intervention/templates/intervention/detail/includes/payments.html:39
#: intervention/templates/intervention/detail/includes/revocation.html:43
#: templates/log.html:10
msgid "Action"
msgstr "Aktionen"
#: compensation/forms/modalForms.py:426 compensation/forms/modalForms.py:438
msgid "Action Type detail" msgid "Action Type detail"
msgstr "Zusatzmerkmal" msgstr "Zusatzmerkmal"
#: compensation/forms/modalForms.py:429 #: compensation/forms/modalForms.py:421
msgid "Select the action type detail" msgid "Select the action type detail"
msgstr "Zusatzmerkmal wählen" msgstr "Zusatzmerkmal wählen"
#: compensation/forms/modalForms.py:443 #: compensation/forms/modalForms.py:435
msgid "Unit" msgid "Unit"
msgstr "Einheit" msgstr "Einheit"
#: compensation/forms/modalForms.py:446 #: compensation/forms/modalForms.py:438
msgid "Select the unit" msgid "Select the unit"
msgstr "Einheit wählen" msgstr "Einheit wählen"
#: compensation/forms/modalForms.py:458 #: compensation/forms/modalForms.py:450
msgid "Insert the amount" msgid "Insert the amount"
msgstr "Menge eingeben" msgstr "Menge eingeben"
#: compensation/forms/modalForms.py:483 #: compensation/forms/modalForms.py:475
msgid "New action" msgid "New action"
msgstr "Neue Maßnahme" msgstr "Neue Maßnahme"
#: compensation/forms/modalForms.py:484 #: compensation/forms/modalForms.py:476
msgid "Insert data for the new action" msgid "Insert data for the new action"
msgstr "Geben Sie die Daten der neuen Maßnahme ein" msgstr "Geben Sie die Daten der neuen Maßnahme ein"
#: compensation/models/action.py:22 #: compensation/models/action.py:20
msgid "cm" msgid "cm"
msgstr "" msgstr ""
#: compensation/models/action.py:23 #: compensation/models/action.py:21
msgid "m" msgid "m"
msgstr "" msgstr ""
#: compensation/models/action.py:24 #: compensation/models/action.py:22
msgid "km" msgid "km"
msgstr "" msgstr ""
#: compensation/models/action.py:25 #: compensation/models/action.py:23
msgid "m²" msgid "m²"
msgstr "" msgstr ""
#: compensation/models/action.py:26 #: compensation/models/action.py:24
msgid "ha" msgid "ha"
msgstr "" msgstr ""
#: compensation/models/action.py:27 #: compensation/models/action.py:25
msgid "Pieces" msgid "Pieces"
msgstr "Stück" msgstr "Stück"
@ -685,9 +665,9 @@ msgid "Checked on {} by {}"
msgstr "Am {} von {} geprüft worden" msgstr "Am {} von {} geprüft worden"
#: compensation/tables.py:160 #: compensation/tables.py:160
#: compensation/templates/compensation/detail/compensation/view.html:80 #: compensation/templates/compensation/detail/compensation/view.html:81
#: compensation/templates/compensation/detail/eco_account/includes/deductions.html:58 #: compensation/templates/compensation/detail/eco_account/includes/deductions.html:58
#: compensation/templates/compensation/detail/eco_account/view.html:47 #: compensation/templates/compensation/detail/eco_account/view.html:48
#: ema/tables.py:131 ema/templates/ema/detail/view.html:38 #: ema/tables.py:131 ema/templates/ema/detail/view.html:38
#: intervention/tables.py:157 #: intervention/tables.py:157
#: intervention/templates/intervention/detail/view.html:85 #: intervention/templates/intervention/detail/view.html:85
@ -710,7 +690,7 @@ msgid "Access not granted"
msgstr "Nicht freigegeben - Datensatz nur lesbar" msgstr "Nicht freigegeben - Datensatz nur lesbar"
#: compensation/tables.py:212 #: compensation/tables.py:212
#: compensation/templates/compensation/detail/eco_account/view.html:35 #: compensation/templates/compensation/detail/eco_account/view.html:36
#: konova/templates/konova/widgets/progressbar.html:3 #: konova/templates/konova/widgets/progressbar.html:3
msgid "Available" msgid "Available"
msgstr "Verfügbar" msgstr "Verfügbar"
@ -750,15 +730,46 @@ msgctxt "Compensation"
msgid "Amount" msgid "Amount"
msgstr "Menge" msgstr "Menge"
#: compensation/templates/compensation/detail/compensation/includes/actions.html:66 #: compensation/templates/compensation/detail/compensation/includes/actions.html:40
#: compensation/templates/compensation/detail/eco_account/includes/actions.html:65 #: compensation/templates/compensation/detail/compensation/includes/deadlines.html:39
#: ema/templates/ema/detail/includes/actions.html:63 #: compensation/templates/compensation/detail/compensation/includes/documents.html:39
#: compensation/templates/compensation/detail/compensation/includes/states-after.html:41
#: compensation/templates/compensation/detail/compensation/includes/states-before.html:41
#: compensation/templates/compensation/detail/eco_account/includes/actions.html:39
#: compensation/templates/compensation/detail/eco_account/includes/deadlines.html:38
#: compensation/templates/compensation/detail/eco_account/includes/deductions.html:41
#: compensation/templates/compensation/detail/eco_account/includes/documents.html:38
#: compensation/templates/compensation/detail/eco_account/includes/states-after.html:41
#: compensation/templates/compensation/detail/eco_account/includes/states-before.html:41
#: ema/templates/ema/detail/includes/actions.html:38
#: ema/templates/ema/detail/includes/deadlines.html:38
#: ema/templates/ema/detail/includes/documents.html:38
#: ema/templates/ema/detail/includes/states-after.html:40
#: ema/templates/ema/detail/includes/states-before.html:40
#: intervention/templates/intervention/detail/includes/compensations.html:38
#: intervention/templates/intervention/detail/includes/deductions.html:39
#: intervention/templates/intervention/detail/includes/documents.html:39
#: intervention/templates/intervention/detail/includes/payments.html:39
#: intervention/templates/intervention/detail/includes/revocation.html:43
#: templates/log.html:10
msgid "Action"
msgstr "Aktionen"
#: compensation/templates/compensation/detail/compensation/includes/actions.html:57
#: compensation/templates/compensation/detail/eco_account/includes/actions.html:56
#: ema/templates/ema/detail/includes/actions.html:54
msgid "No action type details"
msgstr "Keine Zusatzmerkmale"
#: compensation/templates/compensation/detail/compensation/includes/actions.html:68
#: compensation/templates/compensation/detail/eco_account/includes/actions.html:67
#: ema/templates/ema/detail/includes/actions.html:65
msgid "Edit action" msgid "Edit action"
msgstr "Maßnahme bearbeiten" msgstr "Maßnahme bearbeiten"
#: compensation/templates/compensation/detail/compensation/includes/actions.html:69 #: compensation/templates/compensation/detail/compensation/includes/actions.html:71
#: compensation/templates/compensation/detail/eco_account/includes/actions.html:68 #: compensation/templates/compensation/detail/eco_account/includes/actions.html:70
#: ema/templates/ema/detail/includes/actions.html:66 #: ema/templates/ema/detail/includes/actions.html:68
msgid "Remove action" msgid "Remove action"
msgstr "Maßnahme entfernen" msgstr "Maßnahme entfernen"
@ -887,6 +898,15 @@ msgstr "Fehlende Flächenmengen laut Ausgangszustand: "
msgid "Biotope type" msgid "Biotope type"
msgstr "Biotoptyp" msgstr "Biotoptyp"
#: compensation/templates/compensation/detail/compensation/includes/states-after.html:56
#: compensation/templates/compensation/detail/compensation/includes/states-before.html:56
#: compensation/templates/compensation/detail/eco_account/includes/states-after.html:56
#: compensation/templates/compensation/detail/eco_account/includes/states-before.html:56
#: ema/templates/ema/detail/includes/states-after.html:54
#: ema/templates/ema/detail/includes/states-before.html:54
msgid "No biotope type details"
msgstr "Keine Zusatzbezeichnungen"
#: compensation/templates/compensation/detail/compensation/includes/states-after.html:62 #: compensation/templates/compensation/detail/compensation/includes/states-after.html:62
#: compensation/templates/compensation/detail/compensation/includes/states-before.html:62 #: compensation/templates/compensation/detail/compensation/includes/states-before.html:62
#: compensation/templates/compensation/detail/eco_account/includes/states-after.html:62 #: compensation/templates/compensation/detail/eco_account/includes/states-after.html:62
@ -924,50 +944,50 @@ msgstr "Neuen Ausgangszustand hinzufügen"
msgid "Missing surfaces according to states after: " msgid "Missing surfaces according to states after: "
msgstr "Fehlende Flächenmengen laut Zielzustand: " msgstr "Fehlende Flächenmengen laut Zielzustand: "
#: compensation/templates/compensation/detail/compensation/view.html:43 #: compensation/templates/compensation/detail/compensation/view.html:44
msgid "Is CEF compensation" msgid "Is CEF compensation"
msgstr "Ist CEF Maßnahme" msgstr "Ist CEF Maßnahme"
#: compensation/templates/compensation/detail/compensation/view.html:46 #: compensation/templates/compensation/detail/compensation/view.html:47
#: compensation/templates/compensation/detail/compensation/view.html:56 #: compensation/templates/compensation/detail/compensation/view.html:57
#: venv/lib/python3.7/site-packages/django/forms/widgets.py:710 #: venv/lib/python3.7/site-packages/django/forms/widgets.py:710
msgid "Yes" msgid "Yes"
msgstr "Ja" msgstr "Ja"
#: compensation/templates/compensation/detail/compensation/view.html:48 #: compensation/templates/compensation/detail/compensation/view.html:49
#: compensation/templates/compensation/detail/compensation/view.html:58 #: compensation/templates/compensation/detail/compensation/view.html:59
#: venv/lib/python3.7/site-packages/django/forms/widgets.py:711 #: venv/lib/python3.7/site-packages/django/forms/widgets.py:711
msgid "No" msgid "No"
msgstr "Nein" msgstr "Nein"
#: compensation/templates/compensation/detail/compensation/view.html:53 #: compensation/templates/compensation/detail/compensation/view.html:54
msgid "Is Coherence keeping compensation" msgid "Is Coherence keeping compensation"
msgstr "Ist Kohärenzsicherungsmaßnahme" msgstr "Ist Kohärenzsicherungsmaßnahme"
#: compensation/templates/compensation/detail/compensation/view.html:70 #: compensation/templates/compensation/detail/compensation/view.html:71
#: intervention/templates/intervention/detail/view.html:75 #: intervention/templates/intervention/detail/view.html:75
msgid "Checked on " msgid "Checked on "
msgstr "Geprüft am " msgstr "Geprüft am "
#: compensation/templates/compensation/detail/compensation/view.html:70 #: compensation/templates/compensation/detail/compensation/view.html:71
#: compensation/templates/compensation/detail/compensation/view.html:84 #: compensation/templates/compensation/detail/compensation/view.html:85
#: compensation/templates/compensation/detail/eco_account/includes/deductions.html:56 #: compensation/templates/compensation/detail/eco_account/includes/deductions.html:56
#: compensation/templates/compensation/detail/eco_account/view.html:51 #: compensation/templates/compensation/detail/eco_account/view.html:52
#: ema/templates/ema/detail/view.html:42 #: ema/templates/ema/detail/view.html:42
#: intervention/templates/intervention/detail/view.html:75 #: intervention/templates/intervention/detail/view.html:75
#: intervention/templates/intervention/detail/view.html:89 #: intervention/templates/intervention/detail/view.html:89
msgid "by" msgid "by"
msgstr "von" msgstr "von"
#: compensation/templates/compensation/detail/compensation/view.html:84 #: compensation/templates/compensation/detail/compensation/view.html:85
#: compensation/templates/compensation/detail/eco_account/view.html:51 #: compensation/templates/compensation/detail/eco_account/view.html:52
#: ema/templates/ema/detail/view.html:42 #: ema/templates/ema/detail/view.html:42
#: intervention/templates/intervention/detail/view.html:89 #: intervention/templates/intervention/detail/view.html:89
msgid "Recorded on " msgid "Recorded on "
msgstr "Verzeichnet am" msgstr "Verzeichnet am"
#: compensation/templates/compensation/detail/compensation/view.html:91 #: compensation/templates/compensation/detail/compensation/view.html:92
#: compensation/templates/compensation/detail/eco_account/view.html:74 #: compensation/templates/compensation/detail/eco_account/view.html:75
#: compensation/templates/compensation/report/compensation/report.html:24 #: compensation/templates/compensation/report/compensation/report.html:24
#: compensation/templates/compensation/report/eco_account/report.html:41 #: compensation/templates/compensation/report/eco_account/report.html:41
#: ema/templates/ema/detail/view.html:61 #: ema/templates/ema/detail/view.html:61
@ -977,8 +997,8 @@ msgstr "Verzeichnet am"
msgid "Last modified" msgid "Last modified"
msgstr "Zuletzt bearbeitet" msgstr "Zuletzt bearbeitet"
#: compensation/templates/compensation/detail/compensation/view.html:99 #: compensation/templates/compensation/detail/compensation/view.html:100
#: compensation/templates/compensation/detail/eco_account/view.html:82 #: compensation/templates/compensation/detail/eco_account/view.html:83
#: ema/templates/ema/detail/view.html:76 intervention/forms/modalForms.py:56 #: ema/templates/ema/detail/view.html:76 intervention/forms/modalForms.py:56
#: intervention/templates/intervention/detail/view.html:116 #: intervention/templates/intervention/detail/view.html:116
msgid "Shared with" msgid "Shared with"
@ -1037,14 +1057,14 @@ msgstr "Abbuchung bearbeiten"
msgid "Remove Deduction" msgid "Remove Deduction"
msgstr "Abbuchung entfernen" msgstr "Abbuchung entfernen"
#: compensation/templates/compensation/detail/eco_account/view.html:34 #: compensation/templates/compensation/detail/eco_account/view.html:35
msgid "No surface deductable" msgid "No surface deductable"
msgstr "Keine Flächenmenge für Abbuchungen eingegeben. Bitte bearbeiten." msgstr "Keine Flächenmenge für Abbuchungen eingegeben. Bitte bearbeiten."
#: compensation/templates/compensation/detail/eco_account/view.html:57 #: compensation/templates/compensation/detail/eco_account/view.html:58
#: compensation/templates/compensation/detail/eco_account/view.html:61 #: compensation/templates/compensation/detail/eco_account/view.html:62
#: compensation/templates/compensation/detail/eco_account/view.html:65 #: compensation/templates/compensation/detail/eco_account/view.html:66
#: compensation/templates/compensation/detail/eco_account/view.html:69 #: compensation/templates/compensation/detail/eco_account/view.html:70
#: ema/templates/ema/detail/view.html:48 ema/templates/ema/detail/view.html:52 #: ema/templates/ema/detail/view.html:48 ema/templates/ema/detail/view.html:52
#: ema/templates/ema/detail/view.html:56 #: ema/templates/ema/detail/view.html:56
#: intervention/templates/intervention/detail/view.html:30 #: intervention/templates/intervention/detail/view.html:30
@ -1060,7 +1080,7 @@ msgstr "Keine Flächenmenge für Abbuchungen eingegeben. Bitte bearbeiten."
msgid "Missing" msgid "Missing"
msgstr "fehlt" msgstr "fehlt"
#: compensation/templates/compensation/detail/eco_account/view.html:70 #: compensation/templates/compensation/detail/eco_account/view.html:71
#: compensation/templates/compensation/report/eco_account/report.html:24 #: compensation/templates/compensation/report/eco_account/report.html:24
#: ema/templates/ema/detail/view.html:57 #: ema/templates/ema/detail/view.html:57
#: ema/templates/ema/report/report.html:24 #: ema/templates/ema/report/report.html:24
@ -1746,6 +1766,11 @@ msgstr "Neu"
msgid "Show" msgid "Show"
msgstr "Anzeigen" msgstr "Anzeigen"
#: konova/templates/konova/widgets/checkbox-tree-select.html:4
#: templates/generic_index.html:56
msgid "Search"
msgstr "Suchen"
#: konova/templates/konova/widgets/generate-content-input.html:6 #: konova/templates/konova/widgets/generate-content-input.html:6
msgid "Generate new" msgid "Generate new"
msgstr "Neu generieren" msgstr "Neu generieren"
@ -1786,6 +1811,10 @@ msgstr "{} - Freigegebene Daten geprüft"
msgid "Request for new API token" msgid "Request for new API token"
msgstr "Anfrage für neuen API Token" msgstr "Anfrage für neuen API Token"
#: konova/utils/message_templates.py:10
msgid "Ungrouped"
msgstr "Ohne Zuordnung"
#: konova/utils/message_templates.py:11 #: konova/utils/message_templates.py:11
msgid "There was an error on this form." msgid "There was an error on this form."
msgstr "Es gab einen Fehler im Formular." msgstr "Es gab einen Fehler im Formular."
@ -1976,7 +2005,7 @@ msgstr "{} wurde erfolgreich vom Nutzer {} geprüft! {}"
msgid "missing" msgid "missing"
msgstr "fehlt" msgstr "fehlt"
#: konova/views.py:96 templates/navbars/navbar.html:16 #: konova/views.py:99 templates/navbars/navbar.html:16
msgid "Home" msgid "Home"
msgstr "Home" msgstr "Home"
@ -2251,10 +2280,6 @@ msgstr "Neu"
msgid "Search for keywords" msgid "Search for keywords"
msgstr "Nach Schlagwörtern suchen" msgstr "Nach Schlagwörtern suchen"
#: templates/generic_index.html:56
msgid "Search"
msgstr "Suchen"
#: templates/generic_index.html:57 #: templates/generic_index.html:57
msgid "Start search" msgid "Start search"
msgstr "Starte Suche" msgstr "Starte Suche"
@ -3984,6 +4009,9 @@ msgstr ""
msgid "Unable to connect to qpid with SASL mechanism %s" msgid "Unable to connect to qpid with SASL mechanism %s"
msgstr "" msgstr ""
#~ msgid "Select the action type"
#~ msgstr "Maßnahmentyp wählen"
#~ msgid "No revocation" #~ msgid "No revocation"
#~ msgstr "Kein Widerspruch" #~ msgstr "Kein Widerspruch"
@ -3993,9 +4021,6 @@ msgstr ""
#~ msgid "General data edited" #~ msgid "General data edited"
#~ msgstr "Allgemeine Daten bearbeitet" #~ msgstr "Allgemeine Daten bearbeitet"
#~ msgid "Action type details"
#~ msgstr "Zusatzmerkmale"
#~ msgid "On registered data edited" #~ msgid "On registered data edited"
#~ msgstr "Wenn meine freigegebenen Daten bearbeitet wurden" #~ msgstr "Wenn meine freigegebenen Daten bearbeitet wurden"