Compare commits

..

No commits in common. "6fbdc3c1fb5ff340e4ed2f4fc58c5ea55b5edcbd" and "1b5cda648e8273dc36ab7ce47f46daed631a78e7" have entirely different histories.

41 changed files with 312 additions and 924 deletions

View File

@ -18,10 +18,10 @@ from codelist.settings import CODELIST_BIOTOPES_ID, CODELIST_COMPENSATION_ACTION
CODELIST_COMPENSATION_ACTION_DETAIL_ID
from compensation.models import CompensationDocument, EcoAccountDocument
from konova.contexts import BaseContext
from konova.forms import BaseModalForm, NewDocumentModalForm, RemoveModalForm
from konova.forms import BaseModalForm, NewDocumentForm, RemoveModalForm
from konova.models import DeadlineType
from konova.utils.message_templates import FORM_INVALID, ADDED_COMPENSATION_STATE, ADDED_DEADLINE, \
ADDED_COMPENSATION_ACTION, PAYMENT_EDITED, COMPENSATION_STATE_EDITED, COMPENSATION_ACTION_EDITED, DEADLINE_EDITED
ADDED_COMPENSATION_ACTION, PAYMENT_EDITED
class NewPaymentForm(BaseModalForm):
@ -261,29 +261,6 @@ class NewStateModalForm(BaseModalForm):
raise NotImplementedError
class EditCompensationStateModalForm(NewStateModalForm):
state = None
def __init__(self, *args, **kwargs):
self.state = kwargs.pop("state", None)
super().__init__(*args, **kwargs)
form_data = {
"biotope_type": self.state.biotope_type,
"biotope_extra": self.state.biotope_type_details.all(),
"surface": self.state.surface,
}
self.load_initial_data(form_data)
def save(self, is_before_state: bool = False):
state = self.state
state.biotope_type = self.cleaned_data.get("biotope_type", None)
state.biotope_type_details.set(self.cleaned_data.get("biotope_extra", []))
state.surface = self.cleaned_data.get("surface", None)
state.save()
self.instance.mark_as_edited(self.user, self.request, edit_comment=COMPENSATION_STATE_EDITED)
return state
class RemoveCompensationStateModalForm(RemoveModalForm):
""" Removing modal form for CompensationState
@ -373,29 +350,6 @@ class NewDeadlineModalForm(BaseModalForm):
return deadline
class EditDeadlineModalForm(NewDeadlineModalForm):
deadline = None
def __init__(self, *args, **kwargs):
self.deadline = kwargs.pop("deadline", None)
super().__init__(*args, **kwargs)
form_data = {
"type": self.deadline.type,
"date": str(self.deadline.date),
"comment": self.deadline.comment,
}
self.load_initial_data(form_data)
def save(self):
deadline = self.deadline
deadline.type = self.cleaned_data.get("type", None)
deadline.date = self.cleaned_data.get("date", None)
deadline.comment = self.cleaned_data.get("comment", None)
deadline.save()
self.instance.mark_as_edited(self.user, self.request, edit_comment=DEADLINE_EDITED)
return deadline
class NewActionModalForm(BaseModalForm):
""" Form handling action related input
@ -489,36 +443,9 @@ class NewActionModalForm(BaseModalForm):
return action
class EditCompensationActionModalForm(NewActionModalForm):
action = None
def __init__(self, *args, **kwargs):
self.action = kwargs.pop("action", None)
super().__init__(*args, **kwargs)
form_data = {
"action_type": self.action.action_type,
"action_type_details": self.action.action_type_details.all(),
"amount": self.action.amount,
"unit": self.action.unit,
"comment": self.action.comment,
}
self.load_initial_data(form_data)
def save(self):
action = self.action
action.action_type = self.cleaned_data.get("action_type", None)
action.action_type_details.set(self.cleaned_data.get("action_type_details", []))
action.amount = self.cleaned_data.get("amount", None)
action.unit = self.cleaned_data.get("unit", None)
action.comment = self.cleaned_data.get("comment", None)
action.save()
self.instance.mark_as_edited(self.user, self.request, edit_comment=COMPENSATION_ACTION_EDITED)
return action
class NewCompensationDocumentModalForm(NewDocumentModalForm):
class NewCompensationDocumentForm(NewDocumentForm):
document_model = CompensationDocument
class NewEcoAccountDocumentModalForm(NewDocumentModalForm):
class NewEcoAccountDocumentForm(NewDocumentForm):
document_model = EcoAccountDocument

View File

@ -35,7 +35,7 @@
{% trans 'Comment' %}
</th>
{% if is_default_member and has_access %}
<th class="w-10" scope="col">
<th scope="col">
<span class="float-right">
{% trans 'Action' %}
</span>
@ -61,12 +61,9 @@
{{ action.comment }}
</div>
</td>
<td class="align-middle float-right">
<td class="">
{% if is_default_member and has_access %}
<button data-form-url="{% url 'compensation:action-edit' obj.id action.id %}" class="btn btn-default btn-modal" title="{% trans 'Edit action' %}">
{% fa5_icon 'edit' %}
</button>
<button data-form-url="{% url 'compensation:action-remove' obj.id action.id %}" class="btn btn-default btn-modal" title="{% trans 'Remove action' %}">
<button data-form-url="{% url 'compensation:action-remove' obj.id action.id %}" class="btn btn-default btn-modal float-right" title="{% trans 'Remove action' %}">
{% fa5_icon 'trash' %}
</button>
{% endif %}

View File

@ -34,7 +34,7 @@
{% trans 'Comment' %}
</th>
{% if is_default_member and has_access %}
<th class="w-10" scope="col">
<th scope="col">
<span class="float-right">
{% trans 'Action' %}
</span>
@ -54,12 +54,9 @@
{{ deadline.comment }}
</div>
</td>
<td class="align-middle float-right">
<td>
{% if is_default_member and has_access %}
<button data-form-url="{% url 'compensation:deadline-edit' obj.id deadline.id %}" class="btn btn-default btn-modal" title="{% trans 'Edit deadline' %}">
{% fa5_icon 'edit' %}
</button>
<button data-form-url="{% url 'compensation:deadline-remove' obj.id deadline.id %}" class="btn btn-default btn-modal" title="{% trans 'Remove deadline' %}">
<button data-form-url="{% url 'compensation:deadline-remove' obj.id deadline.id %}" class="btn btn-default btn-modal float-right" title="{% trans 'Remove deadline' %}">
{% fa5_icon 'trash' %}
</button>
{% endif %}

View File

@ -27,14 +27,11 @@
<th scope="col">
{% trans 'Title' %}
</th>
<th scope="col">
{% trans 'Created on' %}
</th>
<th scope="col">
{% trans 'Comment' %}
</th>
{% if is_default_member and has_access %}
<th class="w-10" scope="col">
<th scope="col">
<span class="float-right">
{% trans 'Action' %}
</span>
@ -46,24 +43,18 @@
{% for doc in obj.documents.all %}
<tr>
<td class="align-middle">
<a href="{% url 'compensation:get-doc' obj.id doc.id %}">
<a href="{% url 'compensation:get-doc' doc.id %}">
{{ doc.title }}
</a>
</td>
<td class="align-middle">
{{ doc.date_of_creation }}
</td>
<td class="align-middle">
<div class="scroll-150">
{{ doc.comment }}
</div>
</td>
<td class="align-middle float-right">
<td class="align-middle">
{% if is_default_member and has_access %}
<button data-form-url="{% url 'compensation:edit-doc' obj.id doc.id %}" class="btn btn-default btn-modal" title="{% trans 'Edit document' %}">
{% fa5_icon 'edit' %}
</button>
<button data-form-url="{% url 'compensation:remove-doc' obj.id doc.id %}" class="btn btn-default btn-modal" title="{% trans 'Remove document' %}">
<button data-form-url="{% url 'compensation:remove-doc' doc.id %}" class="btn btn-default btn-modal float-right" title="{% trans 'Remove document' %}">
{% fa5_icon 'trash' %}
</button>
{% endif %}

View File

@ -36,7 +36,7 @@
{% trans 'Surface' %}
</th>
{% if is_default_member and has_access %}
<th class="w-10" scope="col">
<th scope="col">
<span class="float-right">
{% trans 'Action' %}
</span>
@ -57,12 +57,9 @@
{% endif %}
</td>
<td>{{ state.surface|floatformat:2 }} m²</td>
<td class="align-middle float-right">
<td>
{% if is_default_member and has_access %}
<button data-form-url="{% url 'compensation:state-edit' obj.id state.id %}" class="btn btn-default btn-modal" title="{% trans 'Edit state' %}">
{% fa5_icon 'edit' %}
</button>
<button data-form-url="{% url 'compensation:state-remove' obj.id state.id %}" class="btn btn-default btn-modal" title="{% trans 'Remove state' %}">
<button data-form-url="{% url 'compensation:state-remove' obj.id state.id %}" class="btn btn-default btn-modal float-right" title="{% trans 'Remove state' %}">
{% fa5_icon 'trash' %}
</button>
{% endif %}

View File

@ -36,7 +36,7 @@
{% trans 'Surface' %}
</th>
{% if is_default_member and has_access %}
<th class="w-10" scope="col">
<th scope="col">
<span class="float-right">
{% trans 'Action' %}
</span>
@ -57,12 +57,9 @@
{% endif %}
</td>
<td>{{ state.surface|floatformat:2 }} m²</td>
<td class="align-middle float-right">
<td>
{% if is_default_member and has_access %}
<button data-form-url="{% url 'compensation:state-edit' obj.id state.id %}" class="btn btn-default btn-modal" title="{% trans 'Edit state' %}">
{% fa5_icon 'edit' %}
</button>
<button data-form-url="{% url 'compensation:state-remove' obj.id state.id %}" class="btn btn-default btn-modal" title="{% trans 'Remove state' %}">
<button data-form-url="{% url 'compensation:state-remove' obj.id state.id %}" class="btn btn-default btn-modal float-right" title="{% trans 'Remove state' %}">
{% fa5_icon 'trash' %}
</button>
{% endif %}

View File

@ -34,7 +34,7 @@
{% trans 'Comment' %}
</th>
{% if is_default_member and has_access %}
<th class="w-10" scope="col">
<th scope="col">
<span class="float-right">
{% trans 'Action' %}
</span>
@ -60,12 +60,9 @@
{{ action.comment }}
</div>
</td>
<td class="align-middle float-right">
<td class="">
{% if is_default_member and has_access %}
<button data-form-url="{% url 'compensation:acc:action-edit' obj.id action.id %}" class="btn btn-default btn-modal" title="{% trans 'Edit action' %}">
{% fa5_icon 'edit' %}
</button>
<button data-form-url="{% url 'compensation:acc:action-remove' obj.id action.id %}" class="btn btn-default btn-modal" title="{% trans 'Remove action' %}">
<button data-form-url="{% url 'compensation:acc:action-remove' obj.id action.id %}" class="btn btn-default btn-modal float-right" title="{% trans 'Remove action' %}">
{% fa5_icon 'trash' %}
</button>
{% endif %}

View File

@ -33,7 +33,7 @@
<th scope="col">
{% trans 'Comment' %}
</th>
<th class="w-10" scope="col">
<th scope="col">
<span class="float-right">
{% trans 'Action' %}
</span>
@ -52,12 +52,9 @@
{{ deadline.comment }}
</div>
</td>
<td class="align-middle float-right">
<td class="align-middle">
{% if is_default_member and has_access %}
<button data-form-url="{% url 'compensation:acc:deadline-edit' obj.id deadline.id %}" class="btn btn-default btn-modal" title="{% trans 'Edit deadline' %}">
{% fa5_icon 'edit' %}
</button>
<button data-form-url="{% url 'compensation:acc:deadline-remove' obj.id deadline.id %}" class="btn btn-default btn-modal" title="{% trans 'Remove deadline' %}">
<button data-form-url="{% url 'compensation:acc:deadline-remove' obj.id deadline.id %}" class="btn btn-default btn-modal float-right" title="{% trans 'Remove deadline' %}">
{% fa5_icon 'trash' %}
</button>
{% endif %}

View File

@ -36,7 +36,7 @@
<th scope="col">
{% trans 'Created' %}
</th>
<th class="w-10" scope="col">
<th scope="col">
<span class="float-right">
{% trans 'Action' %}
</span>

View File

@ -27,13 +27,10 @@
<th scope="col">
{% trans 'Title' %}
</th>
<th scope="col">
{% trans 'Created on' %}
</th>
<th scope="col">
{% trans 'Comment' %}
</th>
<th class="w-10" scope="col">
<th scope="col">
<span class="float-right">
{% trans 'Action' %}
</span>
@ -44,24 +41,18 @@
{% for doc in obj.documents.all %}
<tr>
<td class="align-middle">
<a href="{% url 'compensation:acc:get-doc' obj.id doc.id %}">
<a href="{% url 'compensation:acc:get-doc' doc.id %}">
{{ doc.title }}
</a>
</td>
<td class="align-middle">
{{ doc.date_of_creation }}
</td>
<td class="align-middle">
<div class="scroll-150">
{{ doc.comment }}
</div>
</td>
<td class="align-middle float-right">
<td class="align-middle">
{% if is_default_member and has_access %}
<button data-form-url="{% url 'compensation:acc:edit-doc' obj.id doc.id %}" class="btn btn-default btn-modal" title="{% trans 'Edit document' %}">
{% fa5_icon 'edit' %}
</button>
<button data-form-url="{% url 'compensation:acc:remove-doc' obj.id doc.id %}" class="btn btn-default btn-modal" title="{% trans 'Remove document' %}">
<button data-form-url="{% url 'compensation:acc:remove-doc' doc.id %}" class="btn btn-default btn-modal float-right" title="{% trans 'Remove document' %}">
{% fa5_icon 'trash' %}
</button>
{% endif %}

View File

@ -36,7 +36,7 @@
{% trans 'Surface' %}
</th>
{% if is_default_member and has_access %}
<th class="w-10" scope="col">
<th scope="col">
<span class="float-right">
{% trans 'Action' %}
</span>
@ -57,12 +57,9 @@
{% endif %}
</td>
<td>{{ state.surface|floatformat:2 }} m²</td>
<td class="align-middle float-right">
<td>
{% if is_default_member and has_access %}
<button data-form-url="{% url 'compensation:acc:state-edit' obj.id state.id %}" class="btn btn-default btn-modal" title="{% trans 'Edit state' %}">
{% fa5_icon 'edit' %}
</button>
<button data-form-url="{% url 'compensation:acc:state-remove' obj.id state.id %}" class="btn btn-default btn-modal" title="{% trans 'Remove state' %}">
<button data-form-url="{% url 'compensation:acc:state-remove' obj.id state.id %}" class="btn btn-default btn-modal float-right" title="{% trans 'Remove state' %}">
{% fa5_icon 'trash' %}
</button>
{% endif %}

View File

@ -36,7 +36,7 @@
{% trans 'Surface' %}
</th>
{% if is_default_member and has_access %}
<th class="w-10" scope="col">
<th scope="col">
<span class="float-right">
{% trans 'Action' %}
</span>
@ -57,12 +57,9 @@
{% endif %}
</td>
<td>{{ state.surface|floatformat:2 }} m²</td>
<td class="align-middle float-right">
<td>
{% if is_default_member and has_access %}
<button data-form-url="{% url 'compensation:acc:state-edit' obj.id state.id %}" class="btn btn-default btn-modal" title="{% trans 'Edit state' %}">
{% fa5_icon 'edit' %}
</button>
<button data-form-url="{% url 'compensation:acc:state-remove' obj.id state.id %}" class="btn btn-default btn-modal" title="{% trans 'Remove state' %}">
<button data-form-url="{% url 'compensation:acc:state-remove' obj.id state.id %}" class="btn btn-default btn-modal float-right" title="{% trans 'Remove state' %}">
{% fa5_icon 'trash' %}
</button>
{% endif %}

View File

@ -8,7 +8,6 @@ Created on: 07.02.22
from django.test.client import Client
from django.urls import reverse
from konova.models import Deadline, DeadlineType
from konova.settings import DEFAULT_GROUP
from konova.tests.test_views import BaseViewTestCase
@ -32,13 +31,6 @@ class CompensationViewTestCase(BaseViewTestCase):
action = self.create_dummy_action()
self.compensation.actions.set([action])
self.deadline = Deadline.objects.get_or_create(
type=DeadlineType.FINISHED,
date="2020-01-01",
comment="TESTDEADDLINECOMMENT"
)[0]
self.compensation.deadlines.add(self.deadline)
# Prepare urls
self.index_url = reverse("compensation:index", args=())
self.new_url = reverse("compensation:new", args=(self.intervention.id,))
@ -51,8 +43,6 @@ class CompensationViewTestCase(BaseViewTestCase):
self.state_new_url = reverse("compensation:new-state", args=(self.compensation.id,))
self.action_new_url = reverse("compensation:new-action", args=(self.compensation.id,))
self.deadline_new_url = reverse("compensation:new-deadline", args=(self.compensation.id,))
self.deadline_edit_url = reverse("compensation:deadline-edit", args=(self.compensation.id, self.deadline.id))
self.deadline_remove_url = reverse("compensation:deadline-remove", args=(self.compensation.id, self.deadline.id))
self.new_doc_url = reverse("compensation:new-doc", args=(self.compensation.id,))
self.state_remove_url = reverse("compensation:state-remove", args=(self.compensation.id, self.comp_state.id,))
@ -82,8 +72,6 @@ class CompensationViewTestCase(BaseViewTestCase):
self.state_new_url,
self.action_new_url,
self.deadline_new_url,
self.deadline_edit_url,
self.deadline_remove_url,
self.state_remove_url,
self.action_remove_url,
self.new_doc_url,
@ -121,8 +109,6 @@ class CompensationViewTestCase(BaseViewTestCase):
self.state_new_url,
self.action_new_url,
self.deadline_new_url,
self.deadline_edit_url,
self.deadline_remove_url,
self.state_remove_url,
self.action_remove_url,
self.new_doc_url,
@ -161,8 +147,6 @@ class CompensationViewTestCase(BaseViewTestCase):
self.state_new_url,
self.action_new_url,
self.deadline_new_url,
self.deadline_edit_url,
self.deadline_remove_url,
self.state_remove_url,
self.action_remove_url,
self.new_doc_url,
@ -197,8 +181,6 @@ class CompensationViewTestCase(BaseViewTestCase):
self.state_new_url,
self.action_new_url,
self.deadline_new_url,
self.deadline_edit_url,
self.deadline_remove_url,
self.state_remove_url,
self.action_remove_url,
self.new_doc_url,
@ -235,8 +217,6 @@ class CompensationViewTestCase(BaseViewTestCase):
self.state_new_url,
self.action_new_url,
self.deadline_new_url,
self.deadline_edit_url,
self.deadline_remove_url,
self.state_remove_url,
self.action_remove_url,
self.new_doc_url,

View File

@ -9,7 +9,6 @@ from django.urls import reverse
from django.test import Client
from compensation.tests.compensation.test_views import CompensationViewTestCase
from konova.models import DeadlineType, Deadline
from konova.settings import DEFAULT_GROUP
@ -45,27 +44,12 @@ class EcoAccountViewTestCase(CompensationViewTestCase):
self.edit_url = reverse("compensation:acc:edit", args=(self.eco_account.id,))
self.remove_url = reverse("compensation:acc:remove", args=(self.eco_account.id,))
self.report_url = reverse("compensation:acc:report", args=(self.eco_account.id,))
self.state_new_url = reverse("compensation:acc:new-state", args=(self.eco_account.id,))
self.state_edit_url = reverse("compensation:acc:state-edit", args=(self.eco_account.id, self.comp_state.id))
self.state_remove_url = reverse("compensation:acc:state-remove", args=(self.eco_account.id, self.comp_state.id,))
self.action_new_url = reverse("compensation:acc:new-action", args=(self.eco_account.id,))
self.action_edit_url = reverse("compensation:acc:action-edit", args=(self.eco_account.id, self.comp_action.id))
self.action_remove_url = reverse("compensation:acc:action-remove", args=(self.eco_account.id, self.comp_action.id,))
self.deadline = Deadline.objects.get_or_create(
type=DeadlineType.FINISHED,
date="2020-01-01",
comment="DEADLINE COMMENT"
)[0]
self.eco_account.deadlines.add(self.deadline)
self.deadline_new_url = reverse("compensation:acc:new-deadline", args=(self.eco_account.id,))
self.deadline_edit_url = reverse("compensation:acc:deadline-edit", args=(self.eco_account.id, self.deadline.id))
self.deadline_remove_url = reverse("compensation:acc:deadline-remove", args=(self.eco_account.id, self.deadline.id))
self.new_doc_url = reverse("compensation:acc:new-doc", args=(self.eco_account.id,))
self.state_remove_url = reverse("compensation:acc:state-remove", args=(self.eco_account.id, self.comp_state.id,))
self.action_remove_url = reverse("compensation:acc:action-remove", args=(self.eco_account.id, self.comp_action.id,))
def test_logged_in_no_groups_shared(self):
""" Check correct status code for all requests
@ -94,14 +78,10 @@ class EcoAccountViewTestCase(CompensationViewTestCase):
self.edit_url,
self.remove_url,
self.state_new_url,
self.state_edit_url,
self.state_remove_url,
self.action_new_url,
self.action_edit_url,
self.action_remove_url,
self.deadline_new_url,
self.deadline_edit_url,
self.deadline_remove_url,
self.state_remove_url,
self.action_remove_url,
self.new_doc_url,
]
@ -135,14 +115,10 @@ class EcoAccountViewTestCase(CompensationViewTestCase):
self.edit_url,
self.remove_url,
self.state_new_url,
self.state_edit_url,
self.state_remove_url,
self.action_new_url,
self.action_edit_url,
self.action_remove_url,
self.deadline_new_url,
self.deadline_edit_url,
self.deadline_remove_url,
self.state_remove_url,
self.action_remove_url,
self.new_doc_url,
]
@ -173,15 +149,11 @@ class EcoAccountViewTestCase(CompensationViewTestCase):
self.new_id_url,
self.edit_url,
self.state_new_url,
self.state_edit_url,
self.state_remove_url,
self.action_new_url,
self.action_edit_url,
self.deadline_new_url,
self.state_remove_url,
self.action_remove_url,
self.new_doc_url,
self.deadline_new_url,
self.deadline_edit_url,
self.deadline_remove_url,
self.log_url,
self.remove_url,
]
@ -212,17 +184,13 @@ class EcoAccountViewTestCase(CompensationViewTestCase):
fail_urls = [
self.edit_url,
self.state_new_url,
self.state_edit_url,
self.state_remove_url,
self.action_new_url,
self.action_edit_url,
self.deadline_new_url,
self.state_remove_url,
self.action_remove_url,
self.new_doc_url,
self.log_url,
self.remove_url,
self.deadline_new_url,
self.deadline_edit_url,
self.deadline_remove_url,
]
self.assert_url_fail(client, fail_urls)
self.assert_url_success(client, success_urls)

View File

@ -18,24 +18,17 @@ urlpatterns = [
path('<id>/log', log_view, name='log'),
path('<id>/edit', edit_view, name='edit'),
path('<id>/remove', remove_view, name='remove'),
path('<id>/state/new', state_new_view, name='new-state'),
path('<id>/state/<state_id>/edit', state_edit_view, name='state-edit'),
path('<id>/state/<state_id>/remove', state_remove_view, name='state-remove'),
path('<id>/action/new', action_new_view, name='new-action'),
path('<id>/action/<action_id>/edit', action_edit_view, name='action-edit'),
path('<id>/state/<state_id>/remove', state_remove_view, name='state-remove'),
path('<id>/action/<action_id>/remove', action_remove_view, name='action-remove'),
path('<id>/deadline/new', deadline_new_view, name="new-deadline"),
path('<id>/deadline/<deadline_id>/edit', deadline_edit_view, name='deadline-edit'),
path('<id>/deadline/<deadline_id>/remove', deadline_remove_view, name='deadline-remove'),
path('<id>/report', report_view, name='report'),
# Documents
path('<id>/document/new/', new_document_view, name='new-doc'),
path('<id>/document/<doc_id>', get_document_view, name='get-doc'),
path('<id>/document/<doc_id>/remove/', remove_document_view, name='remove-doc'),
path('<id>/document/<doc_id>/edit/', edit_document_view, name='edit-doc'),
path('document/<doc_id>', get_document_view, name='get-doc'),
path('document/<doc_id>/remove/', remove_document_view, name='remove-doc'),
]

View File

@ -19,27 +19,19 @@ urlpatterns = [
path('<id>/report', report_view, name='report'),
path('<id>/edit', edit_view, name='edit'),
path('<id>/remove', remove_view, name='remove'),
path('<id>/state/new', state_new_view, name='new-state'),
path('<id>/state/<state_id>/edit', state_edit_view, name='state-edit'),
path('<id>/state/<state_id>/remove', state_remove_view, name='state-remove'),
path('<id>/action/new', action_new_view, name='new-action'),
path('<id>/action/<action_id>/edit', action_edit_view, name='action-edit'),
path('<id>/state/<state_id>/remove', state_remove_view, name='state-remove'),
path('<id>/action/<action_id>/remove', action_remove_view, name='action-remove'),
path('<id>/deadline/new', deadline_new_view, name="new-deadline"),
path('<id>/deadline/<deadline_id>/edit', deadline_edit_view, name='deadline-edit'),
path('<id>/deadline/<deadline_id>/remove', deadline_remove_view, name='deadline-remove'),
path('<id>/deadline/new', deadline_new_view, name="new-deadline"),
path('<id>/share/<token>', share_view, name='share'),
path('<id>/share', create_share_view, name='share-create'),
# Documents
path('<id>/document/new/', new_document_view, name='new-doc'),
path('<id>/document/<doc_id>', get_document_view, name='get-doc'),
path('<id>/document/<doc_id>/edit', edit_document_view, name='edit-doc'),
path('<id>/document/<doc_id>/remove/', remove_document_view, name='remove-doc'),
path('document/<doc_id>', get_document_view, name='get-doc'),
path('document/<doc_id>/remove/', remove_document_view, name='remove-doc'),
# Eco-account deductions
path('<id>/deduction/<deduction_id>/remove', deduction_remove_view, name='remove-deduction'),

View File

@ -6,14 +6,13 @@ from django.utils.translation import gettext_lazy as _
from compensation.forms.forms import NewCompensationForm, EditCompensationForm
from compensation.forms.modalForms import NewStateModalForm, NewDeadlineModalForm, NewActionModalForm, \
NewCompensationDocumentModalForm, RemoveCompensationActionModalForm, RemoveCompensationStateModalForm, \
EditCompensationStateModalForm, EditCompensationActionModalForm, EditDeadlineModalForm
NewCompensationDocumentForm, RemoveCompensationActionModalForm, RemoveCompensationStateModalForm
from compensation.models import Compensation, CompensationState, CompensationAction, CompensationDocument
from compensation.tables import CompensationTable
from intervention.models import Intervention
from konova.contexts import BaseContext
from konova.decorators import *
from konova.forms import RemoveModalForm, SimpleGeomForm, RemoveDeadlineModalForm, EditDocumentModalForm
from konova.forms import RemoveModalForm, SimpleGeomForm, RemoveDeadlineModalForm
from konova.models import Deadline
from konova.sub_settings.context_settings import TAB_TITLE_IDENTIFIER
from konova.utils.documents import get_document, remove_document
@ -21,8 +20,7 @@ from konova.utils.generators import generate_qr_code
from konova.utils.message_templates import FORM_INVALID, IDENTIFIER_REPLACED, DATA_UNSHARED_EXPLANATION, \
CHECKED_RECORDED_RESET, COMPENSATION_ADDED_TEMPLATE, COMPENSATION_REMOVED_TEMPLATE, DOCUMENT_ADDED, \
COMPENSATION_STATE_REMOVED, COMPENSATION_STATE_ADDED, COMPENSATION_ACTION_REMOVED, COMPENSATION_ACTION_ADDED, \
DEADLINE_ADDED, DEADLINE_REMOVED, DOCUMENT_EDITED, COMPENSATION_STATE_EDITED, COMPENSATION_ACTION_EDITED, \
DEADLINE_EDITED
DEADLINE_ADDED, DEADLINE_REMOVED
from konova.utils.user_checks import in_group
@ -278,7 +276,7 @@ def new_document_view(request: HttpRequest, id: str):
"""
comp = get_object_or_404(Compensation, id=id)
form = NewCompensationDocumentModalForm(request.POST or None, request.FILES or None, instance=comp, request=request)
form = NewCompensationDocumentForm(request.POST or None, request.FILES or None, instance=comp, request=request)
return form.process_request(
request,
msg_success=DOCUMENT_ADDED,
@ -288,42 +286,45 @@ def new_document_view(request: HttpRequest, id: str):
@login_required
@default_group_required
@shared_access_required(Compensation, "id")
def get_document_view(request: HttpRequest, id: str, doc_id: str):
def get_document_view(request: HttpRequest, doc_id: str):
""" Returns the document as downloadable file
Wraps the generic document fetcher function from konova.utils.
Args:
request (HttpRequest): The incoming request
id (str): The compensation id
doc_id (str): The document id
Returns:
"""
comp = get_object_or_404(Compensation, id=id)
doc = get_object_or_404(CompensationDocument, id=doc_id)
user = request.user
instance = doc.instance
# File download only possible if related instance is shared with user
if not instance.users.filter(id=user.id):
messages.info(
request,
DATA_UNSHARED
)
return redirect("compensation:detail", id=instance.id)
return get_document(doc)
@login_required
@default_group_required
@shared_access_required(Compensation, "id")
def remove_document_view(request: HttpRequest, id: str, doc_id: str):
def remove_document_view(request: HttpRequest, doc_id: str):
""" Removes the document from the database and file system
Wraps the generic functionality from konova.utils.
Args:
request (HttpRequest): The incoming request
id (str): The compensation id
doc_id (str): The document id
Returns:
"""
comp = get_object_or_404(Compensation, id=id)
doc = get_object_or_404(CompensationDocument, id=doc_id)
return remove_document(
request,
@ -331,32 +332,6 @@ def remove_document_view(request: HttpRequest, id: str, doc_id: str):
)
@login_required
@default_group_required
@shared_access_required(Compensation, "id")
def edit_document_view(request: HttpRequest, id: str, doc_id: str):
""" Removes the document from the database and file system
Wraps the generic functionality from konova.utils.
Args:
request (HttpRequest): The incoming request
id (str): The compensation id
doc_id (str): The document id
Returns:
"""
comp = get_object_or_404(Compensation, id=id)
doc = get_object_or_404(CompensationDocument, id=doc_id)
form = EditDocumentModalForm(request.POST or None, request.FILES or None, instance=comp, document=doc, request=request)
return form.process_request(
request,
DOCUMENT_EDITED,
reverse("compensation:detail", args=(id,)) + "#related_data"
)
@login_required
@default_group_required
@shared_access_required(Compensation, "id")
@ -401,30 +376,6 @@ def action_new_view(request: HttpRequest, id: str):
)
@login_required
@default_group_required
@shared_access_required(Compensation, "id")
def action_edit_view(request: HttpRequest, id: str, action_id: str):
""" Renders a form for editing actions for a compensation
Args:
request (HttpRequest): The incoming request
id (str): The compensation's id
action_id (str): The action's id
Returns:
"""
comp = get_object_or_404(Compensation, id=id)
action = get_object_or_404(CompensationAction, id=action_id)
form = EditCompensationActionModalForm(request.POST or None, instance=comp, action=action, request=request)
return form.process_request(
request,
msg_success=COMPENSATION_ACTION_EDITED,
redirect_url=reverse("compensation:detail", args=(id,)) + "#related_data"
)
@login_required
@default_group_required
@shared_access_required(Compensation, "id")
@ -447,30 +398,6 @@ def deadline_new_view(request: HttpRequest, id: str):
)
@login_required
@default_group_required
@shared_access_required(Compensation, "id")
def deadline_edit_view(request: HttpRequest, id: str, deadline_id: str):
""" Renders a form for editing deadlines from a compensation
Args:
request (HttpRequest): The incoming request
id (str): The compensation's id
deadline_id (str): The deadline's id
Returns:
"""
comp = get_object_or_404(Compensation, id=id)
deadline = get_object_or_404(Deadline, id=deadline_id)
form = EditDeadlineModalForm(request.POST or None, instance=comp, deadline=deadline, request=request)
return form.process_request(
request,
msg_success=DEADLINE_EDITED,
redirect_url=reverse("compensation:detail", args=(id,)) + "#related_data"
)
@login_required
@default_group_required
@shared_access_required(Compensation, "id")
@ -519,30 +446,6 @@ def state_remove_view(request: HttpRequest, id: str, state_id: str):
)
@login_required
@default_group_required
@shared_access_required(Compensation, "id")
def state_edit_view(request: HttpRequest, id: str, state_id: str):
""" Renders a form for editing a compensation state
Args:
request (HttpRequest): The incoming request
id (str): The compensation's id
state_id (str): The state's id
Returns:
"""
comp = get_object_or_404(Compensation, id=id)
state = get_object_or_404(CompensationState, id=state_id)
form = EditCompensationStateModalForm(request.POST or None, instance=comp, state=state, request=request)
return form.process_request(
request,
msg_success=COMPENSATION_STATE_EDITED,
redirect_url=reverse("compensation:detail", args=(id,)) + "#related_data"
)
@login_required
@default_group_required
@shared_access_required(Compensation, "id")

View File

@ -16,8 +16,7 @@ from django.shortcuts import render, get_object_or_404, redirect
from compensation.forms.forms import NewEcoAccountForm, EditEcoAccountForm
from compensation.forms.modalForms import NewStateModalForm, NewActionModalForm, NewDeadlineModalForm, \
NewEcoAccountDocumentModalForm, RemoveCompensationActionModalForm, RemoveCompensationStateModalForm, \
EditCompensationStateModalForm, EditCompensationActionModalForm, EditDeadlineModalForm
NewEcoAccountDocumentForm, RemoveCompensationActionModalForm, RemoveCompensationStateModalForm
from compensation.models import EcoAccount, EcoAccountDocument, CompensationState, CompensationAction
from compensation.tables import EcoAccountTable
from intervention.forms.modalForms import NewDeductionModalForm, ShareModalForm, RemoveEcoAccountDeductionModalForm, \
@ -25,8 +24,7 @@ from intervention.forms.modalForms import NewDeductionModalForm, ShareModalForm,
from konova.contexts import BaseContext
from konova.decorators import any_group_check, default_group_required, conservation_office_group_required, \
shared_access_required
from konova.forms import RemoveModalForm, SimpleGeomForm, NewDocumentModalForm, RecordModalForm, \
RemoveDeadlineModalForm, EditDocumentModalForm
from konova.forms import RemoveModalForm, SimpleGeomForm, NewDocumentForm, RecordModalForm, RemoveDeadlineModalForm
from konova.models import Deadline
from konova.settings import DEFAULT_GROUP, ZB_GROUP, ETS_GROUP
from konova.sub_settings.context_settings import TAB_TITLE_IDENTIFIER
@ -35,7 +33,7 @@ from konova.utils.generators import generate_qr_code
from konova.utils.message_templates import IDENTIFIER_REPLACED, FORM_INVALID, DATA_UNSHARED, DATA_UNSHARED_EXPLANATION, \
CANCEL_ACC_RECORDED_OR_DEDUCTED, DEDUCTION_REMOVED, DEDUCTION_ADDED, DOCUMENT_ADDED, COMPENSATION_STATE_REMOVED, \
COMPENSATION_STATE_ADDED, COMPENSATION_ACTION_REMOVED, COMPENSATION_ACTION_ADDED, DEADLINE_ADDED, DEADLINE_REMOVED, \
DEDUCTION_EDITED, DOCUMENT_EDITED, COMPENSATION_STATE_EDITED, COMPENSATION_ACTION_EDITED, DEADLINE_EDITED
DEDUCTION_EDITED
from konova.utils.user_checks import in_group
@ -443,30 +441,6 @@ def state_remove_view(request: HttpRequest, id: str, state_id: str):
)
@login_required
@default_group_required
@shared_access_required(EcoAccount, "id")
def state_edit_view(request: HttpRequest, id: str, state_id: str):
""" Renders a form for editing a compensation state
Args:
request (HttpRequest): The incoming request
id (str): The compensation's id
state_id (str): The state's id
Returns:
"""
acc = get_object_or_404(EcoAccount, id=id)
state = get_object_or_404(CompensationState, id=state_id)
form = EditCompensationStateModalForm(request.POST or None, instance=acc, state=state, request=request)
return form.process_request(
request,
msg_success=COMPENSATION_STATE_EDITED,
redirect_url=reverse("compensation:acc:detail", args=(id,)) + "#related_data"
)
@login_required
@default_group_required
@shared_access_required(EcoAccount, "id")
@ -491,54 +465,6 @@ def action_remove_view(request: HttpRequest, id: str, action_id: str):
)
@login_required
@default_group_required
@shared_access_required(EcoAccount, "id")
def action_edit_view(request: HttpRequest, id: str, action_id: str):
""" Renders a form for editing a compensation action
Args:
request (HttpRequest): The incoming request
id (str): The compensation's id
id (str): The action's id
Returns:
"""
acc = get_object_or_404(EcoAccount, id=id)
action = get_object_or_404(CompensationAction, id=action_id)
form = EditCompensationActionModalForm(request.POST or None, instance=acc, action=action, request=request)
return form.process_request(
request,
msg_success=COMPENSATION_ACTION_EDITED,
redirect_url=reverse("compensation:acc:detail", args=(id,)) + "#related_data"
)
@login_required
@default_group_required
@shared_access_required(EcoAccount, "id")
def deadline_edit_view(request: HttpRequest, id: str, deadline_id: str):
""" Renders a form for editing deadlines from a compensation
Args:
request (HttpRequest): The incoming request
id (str): The compensation's id
deadline_id (str): The deadline's id
Returns:
"""
comp = get_object_or_404(EcoAccount, id=id)
deadline = get_object_or_404(Deadline, id=deadline_id)
form = EditDeadlineModalForm(request.POST or None, instance=comp, deadline=deadline, request=request)
return form.process_request(
request,
msg_success=DEADLINE_EDITED,
redirect_url=reverse("compensation:acc:detail", args=(id,)) + "#related_data"
)
@login_required
@default_group_required
@shared_access_required(EcoAccount, "id")
@ -598,7 +524,7 @@ def new_document_view(request: HttpRequest, id: str):
"""
acc = get_object_or_404(EcoAccount, id=id)
form = NewEcoAccountDocumentModalForm(request.POST or None, request.FILES or None, instance=acc, request=request)
form = NewEcoAccountDocumentForm(request.POST or None, request.FILES or None, instance=acc, request=request)
return form.process_request(
request,
msg_success=DOCUMENT_ADDED,
@ -608,68 +534,46 @@ def new_document_view(request: HttpRequest, id: str):
@login_required
@default_group_required
@shared_access_required(EcoAccount, "id")
def get_document_view(request: HttpRequest, id:str, doc_id: str):
def get_document_view(request: HttpRequest, doc_id: str):
""" Returns the document as downloadable file
Wraps the generic document fetcher function from konova.utils.
Args:
request (HttpRequest): The incoming request
id (str): The account id
doc_id (str): The document id
Returns:
"""
acc = get_object_or_404(EcoAccount, id=id)
doc = get_object_or_404(EcoAccountDocument, id=doc_id)
user = request.user
instance = doc.instance
# File download only possible if related instance is shared with user
if not instance.users.filter(id=user.id):
messages.info(
request,
DATA_UNSHARED
)
return redirect("compensation:acc:detail", id=instance.id)
return get_document(doc)
@login_required
@default_group_required
@shared_access_required(EcoAccount, "id")
def edit_document_view(request: HttpRequest, id: str, doc_id: str):
def remove_document_view(request: HttpRequest, doc_id: str):
""" Removes the document from the database and file system
Wraps the generic functionality from konova.utils.
Args:
request (HttpRequest): The incoming request
id (str): The account id
doc_id (str): The document id
Returns:
"""
acc = get_object_or_404(EcoAccount, id=id)
doc = get_object_or_404(EcoAccountDocument, id=doc_id)
form = EditDocumentModalForm(request.POST or None, request.FILES or None, instance=acc, document=doc, request=request)
return form.process_request(
request,
DOCUMENT_EDITED,
reverse("compensation:acc:detail", args=(id,)) + "#related_data"
)
@login_required
@default_group_required
@shared_access_required(EcoAccount, "id")
def remove_document_view(request: HttpRequest, id: str, doc_id: str):
""" Removes the document from the database and file system
Wraps the generic functionality from konova.utils.
Args:
request (HttpRequest): The incoming request
id (str): The account id
doc_id (str): The document id
Returns:
"""
acc = get_object_or_404(EcoAccount, id=id)
doc = get_object_or_404(EcoAccountDocument, id=doc_id)
return remove_document(
request,

View File

@ -15,7 +15,7 @@ from django.utils.translation import gettext_lazy as _
from compensation.forms.forms import AbstractCompensationForm, CompensationResponsibleFormMixin
from ema.models import Ema, EmaDocument
from intervention.models import Responsibility
from konova.forms import SimpleGeomForm, NewDocumentModalForm
from konova.forms import SimpleGeomForm, NewDocumentForm
from user.models import UserActionLogEntry
@ -150,5 +150,5 @@ class EditEmaForm(NewEmaForm):
return self.instance
class NewEmaDocumentModalForm(NewDocumentModalForm):
class NewEmaDocumentForm(NewDocumentForm):
document_model = EmaDocument

View File

@ -33,7 +33,7 @@
<th scope="col">
{% trans 'Comment' %}
</th>
<th class="w-10" scope="col">
<th scope="col">
<span class="float-right">
{% trans 'Action' %}
</span>
@ -58,12 +58,9 @@
{{ action.comment }}
</div>
</td>
<td class="align-middle float-right">
<td class="">
{% if is_default_member and has_access %}
<button data-form-url="{% url 'ema:action-edit' obj.id action.id %}" class="btn btn-default btn-modal" title="{% trans 'Edit action' %}">
{% fa5_icon 'edit' %}
</button>
<button data-form-url="{% url 'ema:action-remove' obj.id action.id %}" class="btn btn-default btn-modal" title="{% trans 'Remove action' %}">
<button data-form-url="{% url 'ema:action-remove' obj.id action.id %}" class="btn btn-default btn-modal float-right" title="{% trans 'Remove action' %}">
{% fa5_icon 'trash' %}
</button>
{% endif %}

View File

@ -33,7 +33,7 @@
<th scope="col">
{% trans 'Comment' %}
</th>
<th class="w-10" scope="col">
<th scope="col">
<span class="float-right">
{% trans 'Action' %}
</span>
@ -52,12 +52,9 @@
{{ deadline.comment }}
</div>
</td>
<td class="align-middle float-right">
<td class="align-middle">
{% if is_default_member and has_access %}
<button data-form-url="{% url 'ema:deadline-edit' obj.id deadline.id %}" class="btn btn-default btn-modal" title="{% trans 'Edit deadline' %}">
{% fa5_icon 'edit' %}
</button>
<button data-form-url="{% url 'ema:deadline-remove' obj.id deadline.id %}" class="btn btn-default btn-modal" title="{% trans 'Remove deadline' %}">
<button data-form-url="{% url 'ema:deadline-remove' obj.id deadline.id %}" class="btn btn-default btn-modal float-right" title="{% trans 'Remove deadline' %}">
{% fa5_icon 'trash' %}
</button>
{% endif %}

View File

@ -27,13 +27,10 @@
<th scope="col">
{% trans 'Title' %}
</th>
<th scope="col">
{% trans 'Created on' %}
</th>
<th scope="col">
{% trans 'Comment' %}
</th>
<th class="w-10" scope="col">
<th scope="col">
<span class="float-right">
{% trans 'Action' %}
</span>
@ -44,24 +41,18 @@
{% for doc in obj.documents.all %}
<tr>
<td class="align-middle">
<a href="{% url 'ema:get-doc' obj.id doc.id %}">
<a href="{% url 'ema:get-doc' doc.id %}">
{{ doc.title }}
</a>
</td>
<td class="align-middle">
{{ doc.date_of_creation }}
</td>
<td class="align-middle">
<div class="scroll-150">
{{ doc.comment }}
</div>
</td>
<td class="align-middle float-right">
<td class="align-middle">
{% if is_default_member and has_access %}
<button data-form-url="{% url 'ema:edit-doc' obj.id doc.id %}" class="btn btn-default btn-modal" title="{% trans 'Edit document' %}">
{% fa5_icon 'edit' %}
</button>
<button data-form-url="{% url 'ema:remove-doc' obj.id doc.id %}" class="btn btn-default btn-modal" title="{% trans 'Remove document' %}">
<button data-form-url="{% url 'ema:remove-doc' doc.id %}" class="btn btn-default btn-modal float-right" title="{% trans 'Remove document' %}">
{% fa5_icon 'trash' %}
</button>
{% endif %}

View File

@ -35,7 +35,7 @@
<th scope="col">
{% trans 'Surface' %}
</th>
<th class="w-10" scope="col">
<th scope="col">
<span class="float-right">
{% trans 'Action' %}
</span>
@ -55,12 +55,9 @@
{% endif %}
</td>
<td>{{ state.surface|floatformat:2 }} m²</td>
<td class="align-middle float-right">
<td>
{% if is_default_member and has_access %}
<button data-form-url="{% url 'ema:state-edit' obj.id state.id %}" class="btn btn-default btn-modal" title="{% trans 'Edit state' %}">
{% fa5_icon 'edit' %}
</button>
<button data-form-url="{% url 'ema:state-remove' obj.id state.id %}" class="btn btn-default btn-modal" title="{% trans 'Remove state' %}">
<button data-form-url="{% url 'ema:state-remove' obj.id state.id %}" class="btn btn-default btn-modal float-right" title="{% trans 'Remove state' %}">
{% fa5_icon 'trash' %}
</button>
{% endif %}

View File

@ -35,7 +35,7 @@
<th scope="col">
{% trans 'Surface' %}
</th>
<th class="w-10" scope="col">
<th scope="col">
<span class="float-right">
{% trans 'Action' %}
</span>
@ -55,12 +55,9 @@
{% endif %}
</td>
<td>{{ state.surface|floatformat:2 }} m²</td>
<td class="align-middle float-right">
<td>
{% if is_default_member and has_access %}
<button data-form-url="{% url 'ema:state-edit' obj.id state.id %}" class="btn btn-default btn-modal" title="{% trans 'Edit state' %}">
{% fa5_icon 'edit' %}
</button>
<button data-form-url="{% url 'ema:state-remove' obj.id state.id %}" class="btn btn-default btn-modal" title="{% trans 'Remove state' %}">
<button data-form-url="{% url 'ema:state-remove' obj.id state.id %}" class="btn btn-default btn-modal float-right" title="{% trans 'Remove state' %}">
{% fa5_icon 'trash' %}
</button>
{% endif %}

View File

@ -13,7 +13,7 @@ from django.test.client import Client
from compensation.tests.compensation.test_views import CompensationViewTestCase
from ema.models import Ema
from intervention.models import Responsibility
from konova.models import Geometry, Deadline, DeadlineType
from konova.models import Geometry
from konova.settings import DEFAULT_GROUP, ETS_GROUP
from user.models import UserActionLogEntry
@ -54,25 +54,11 @@ class EmaViewTestCase(CompensationViewTestCase):
self.record_url = reverse("ema:record", args=(self.ema.id,))
self.report_url = reverse("ema:report", args=(self.ema.id,))
self.new_doc_url = reverse("ema:new-doc", args=(self.ema.id,))
self.state_new_url = reverse("ema:new-state", args=(self.ema.id,))
self.state_edit_url = reverse("ema:state-edit", args=(self.ema.id, state.id))
self.state_remove_url = reverse("ema:state-remove", args=(self.ema.id, state.id,))
self.action_new_url = reverse("ema:new-action", args=(self.ema.id,))
self.action_edit_url = reverse("ema:action-edit", args=(self.ema.id, action.id))
self.action_remove_url = reverse("ema:action-remove", args=(self.ema.id, action.id,))
self.deadline = Deadline.objects.get_or_create(
type=DeadlineType.FINISHED,
date="2020-01-01",
comment="TESTCOMMENT",
)[0]
self.ema.deadlines.add(self.deadline)
self.deadline_new_url = reverse("ema:new-deadline", args=(self.ema.id,))
self.deadline_edit_url = reverse("ema:deadline-edit", args=(self.ema.id, self.deadline.id))
self.deadline_remove_url = reverse("ema:deadline-remove", args=(self.ema.id, self.deadline.id))
self.state_remove_url = reverse("ema:state-remove", args=(self.ema.id, state.id,))
self.action_remove_url = reverse("ema:action-remove", args=(self.ema.id, action.id,))
def create_dummy_data(self):
# Create dummy data
@ -122,14 +108,10 @@ class EmaViewTestCase(CompensationViewTestCase):
self.new_id_url,
self.edit_url,
self.state_new_url,
self.state_remove_url,
self.state_edit_url,
self.deadline_new_url,
self.deadline_edit_url,
self.deadline_remove_url,
self.action_edit_url,
self.action_remove_url,
self.action_new_url,
self.deadline_new_url,
self.state_remove_url,
self.action_remove_url,
self.new_doc_url,
self.log_url,
self.remove_url,
@ -172,14 +154,10 @@ class EmaViewTestCase(CompensationViewTestCase):
self.new_id_url,
self.edit_url,
self.state_new_url,
self.state_edit_url,
self.state_remove_url,
self.action_new_url,
self.action_edit_url,
self.action_remove_url,
self.deadline_new_url,
self.deadline_edit_url,
self.deadline_remove_url,
self.state_remove_url,
self.action_remove_url,
self.new_doc_url,
self.log_url,
self.remove_url,
@ -213,13 +191,9 @@ class EmaViewTestCase(CompensationViewTestCase):
self.new_id_url,
self.edit_url,
self.state_new_url,
self.state_edit_url,
self.state_remove_url,
self.deadline_new_url,
self.deadline_edit_url,
self.deadline_remove_url,
self.action_new_url,
self.action_edit_url,
self.deadline_new_url,
self.state_remove_url,
self.action_remove_url,
self.new_doc_url,
self.log_url,
@ -255,13 +229,9 @@ class EmaViewTestCase(CompensationViewTestCase):
fail_urls = [
self.edit_url,
self.state_new_url,
self.state_edit_url,
self.state_remove_url,
self.deadline_new_url,
self.deadline_edit_url,
self.deadline_remove_url,
self.action_new_url,
self.action_edit_url,
self.deadline_new_url,
self.state_remove_url,
self.action_remove_url,
self.new_doc_url,
self.log_url,

View File

@ -19,26 +19,18 @@ urlpatterns = [
path('<id>/remove', remove_view, name='remove'),
path('<id>/record', record_view, name='record'),
path('<id>/report', report_view, name='report'),
path('<id>/state/new', state_new_view, name='new-state'),
path('<id>/state/<state_id>/remove', state_remove_view, name='state-remove'),
path('<id>/state/<state_id>/edit', state_edit_view, name='state-edit'),
path('<id>/action/new', action_new_view, name='new-action'),
path('<id>/action/<action_id>/edit', action_edit_view, name='action-edit'),
path('<id>/state/<state_id>/remove', state_remove_view, name='state-remove'),
path('<id>/action/<action_id>/remove', action_remove_view, name='action-remove'),
path('<id>/deadline/new', deadline_new_view, name="new-deadline"),
path('<id>/deadline/<deadline_id>/edit', deadline_edit_view, name='deadline-edit'),
path('<id>/deadline/<deadline_id>/remove', deadline_remove_view, name='deadline-remove'),
path('<id>/deadline/new', deadline_new_view, name="new-deadline"),
path('<id>/share/<token>', share_view, name='share'),
path('<id>/share', create_share_view, name='share-create'),
# Documents
path('<id>/document/new/', document_new_view, name='new-doc'),
path('<id>/document/<doc_id>', get_document_view, name='get-doc'),
path('<id>/document/<doc_id>/edit/', edit_document_view, name='edit-doc'),
path('<id>/document/<doc_id>/remove/', remove_document_view, name='remove-doc'),
path('document/<doc_id>', get_document_view, name='get-doc'),
path('document/<doc_id>/remove/', remove_document_view, name='remove-doc'),
]

View File

@ -7,17 +7,15 @@ from django.urls import reverse
from django.utils.translation import gettext_lazy as _
from compensation.forms.modalForms import NewStateModalForm, NewActionModalForm, NewDeadlineModalForm, \
RemoveCompensationActionModalForm, RemoveCompensationStateModalForm, EditCompensationStateModalForm, \
EditCompensationActionModalForm, EditDeadlineModalForm
RemoveCompensationActionModalForm, RemoveCompensationStateModalForm
from compensation.models import CompensationAction, CompensationState
from ema.forms import NewEmaForm, EditEmaForm, NewEmaDocumentModalForm
from ema.forms import NewEmaForm, EditEmaForm, NewEmaDocumentForm
from ema.tables import EmaTable
from intervention.forms.modalForms import ShareModalForm
from konova.contexts import BaseContext
from konova.decorators import conservation_office_group_required, shared_access_required
from ema.models import Ema, EmaDocument
from konova.forms import RemoveModalForm, SimpleGeomForm, RecordModalForm, RemoveDeadlineModalForm, \
EditDocumentModalForm
from konova.forms import RemoveModalForm, SimpleGeomForm, RecordModalForm, RemoveDeadlineModalForm
from konova.models import Deadline
from konova.settings import DEFAULT_GROUP, ZB_GROUP, ETS_GROUP
from konova.sub_settings.context_settings import TAB_TITLE_IDENTIFIER
@ -25,8 +23,7 @@ from konova.utils.documents import get_document, remove_document
from konova.utils.generators import generate_qr_code
from konova.utils.message_templates import IDENTIFIER_REPLACED, FORM_INVALID, DATA_UNSHARED, DATA_UNSHARED_EXPLANATION, \
DOCUMENT_ADDED, COMPENSATION_STATE_REMOVED, COMPENSATION_STATE_ADDED, COMPENSATION_ACTION_REMOVED, \
COMPENSATION_ACTION_ADDED, DEADLINE_ADDED, DEADLINE_REMOVED, DOCUMENT_EDITED, COMPENSATION_STATE_EDITED, \
COMPENSATION_ACTION_EDITED, DEADLINE_EDITED
COMPENSATION_ACTION_ADDED, DEADLINE_ADDED, DEADLINE_REMOVED
from konova.utils.user_checks import in_group
@ -324,30 +321,6 @@ def action_new_view(request: HttpRequest, id: str):
)
@login_required
@conservation_office_group_required
@shared_access_required(Ema, "id")
def action_edit_view(request: HttpRequest, id: str, action_id: str):
""" Renders a form for editing an actions for an EMA
Args:
request (HttpRequest): The incoming request
id (str): The EMA's id
action_id (str): The action id
Returns:
"""
ema = get_object_or_404(Ema, id=id)
action = get_object_or_404(CompensationAction, id=action_id)
form = EditCompensationActionModalForm(request.POST or None, instance=ema, action=action, request=request)
return form.process_request(
request,
msg_success=COMPENSATION_ACTION_EDITED,
redirect_url=reverse("ema:detail", args=(id,)) + "#related_data"
)
@login_required
@conservation_office_group_required
@shared_access_required(Ema, "id")
@ -383,7 +356,7 @@ def document_new_view(request: HttpRequest, id: str):
"""
ema = get_object_or_404(Ema, id=id)
form = NewEmaDocumentModalForm(request.POST or None, request.FILES or None, instance=ema, request=request)
form = NewEmaDocumentForm(request.POST or None, request.FILES or None, instance=ema, request=request)
return form.process_request(
request,
msg_success=DOCUMENT_ADDED,
@ -393,68 +366,45 @@ def document_new_view(request: HttpRequest, id: str):
@login_required
@conservation_office_group_required
@shared_access_required(Ema, "id")
def get_document_view(request: HttpRequest, id: str, doc_id: str):
def get_document_view(request: HttpRequest, doc_id: str):
""" Returns the document as downloadable file
Wraps the generic document fetcher function from konova.utils.
Args:
request (HttpRequest): The incoming request
id (str): The EMA id
doc_id (str): The document id
Returns:
"""
ema = get_object_or_404(Ema, id=id)
doc = get_object_or_404(EmaDocument, id=doc_id)
user = request.user
instance = doc.instance
# File download only possible if related instance is shared with user
if not instance.users.filter(id=user.id):
messages.info(
request,
DATA_UNSHARED
)
return redirect("ema:detail", id=instance.id)
return get_document(doc)
@login_required
@conservation_office_group_required
@shared_access_required(Ema, "id")
def edit_document_view(request: HttpRequest, id: str, doc_id: str):
def remove_document_view(request: HttpRequest, doc_id: str):
""" Removes the document from the database and file system
Wraps the generic functionality from konova.utils.
Args:
request (HttpRequest): The incoming request
id (str): The EMA id
doc_id (str): The document id
Returns:
"""
ema = get_object_or_404(Ema, id=id)
doc = get_object_or_404(EmaDocument, id=doc_id)
form = EditDocumentModalForm(request.POST or None, request.FILES or None, instance=ema, document=doc, request=request)
return form.process_request(
request,
DOCUMENT_EDITED,
reverse("ema:detail", args=(id,)) + "#related_data"
)
@login_required
@conservation_office_group_required
@shared_access_required(Ema, "id")
def remove_document_view(request: HttpRequest, id:str, doc_id: str):
""" Removes the document from the database and file system
Wraps the generic functionality from konova.utils.
Args:
request (HttpRequest): The incoming request
id (str): The EMA id
doc_id (str): The document id
Returns:
"""
ema = get_object_or_404(Ema, id=id)
doc = get_object_or_404(EmaDocument, id=doc_id)
return remove_document(
request,
@ -486,30 +436,6 @@ def state_remove_view(request: HttpRequest, id: str, state_id: str):
)
@login_required
@conservation_office_group_required
@shared_access_required(Ema, "id")
def state_edit_view(request: HttpRequest, id: str, state_id: str):
""" Renders a form for editing an EMA state
Args:
request (HttpRequest): The incoming request
id (str): The ema id
state_id (str): The state's id
Returns:
"""
ema = get_object_or_404(Ema, id=id)
state = get_object_or_404(CompensationState, id=state_id)
form = EditCompensationStateModalForm(request.POST or None, instance=ema, state=state, request=request)
return form.process_request(
request,
msg_success=COMPENSATION_STATE_EDITED,
redirect_url=reverse("ema:detail", args=(id,)) + "#related_data"
)
@login_required
@conservation_office_group_required
@shared_access_required(Ema, "id")
@ -653,30 +579,6 @@ def create_share_view(request: HttpRequest, id: str):
)
@login_required
@conservation_office_group_required
@shared_access_required(Ema, "id")
def deadline_edit_view(request: HttpRequest, id: str, deadline_id: str):
""" Renders a form for editing deadlines from a compensation
Args:
request (HttpRequest): The incoming request
id (str): The compensation's id
deadline_id (str): The deadline's id
Returns:
"""
ema = get_object_or_404(Ema, id=id)
deadline = get_object_or_404(Deadline, id=deadline_id)
form = EditDeadlineModalForm(request.POST or None, instance=ema, deadline=deadline, request=request)
return form.process_request(
request,
msg_success=DEADLINE_EDITED,
redirect_url=reverse("ema:detail", args=(id,)) + "#related_data"
)
@login_required
@conservation_office_group_required
@shared_access_required(Ema, "id")

View File

@ -19,7 +19,7 @@ from django.utils.translation import gettext_lazy as _
from compensation.models import EcoAccount, EcoAccountDeduction
from intervention.inputs import TextToClipboardInput
from intervention.models import Intervention, InterventionDocument, RevocationDocument
from konova.forms import BaseModalForm, NewDocumentModalForm, RemoveModalForm
from konova.forms import BaseModalForm, NewDocumentForm, RemoveModalForm
from konova.utils.general import format_german_float
from konova.utils.user_checks import is_default_group_only
@ -170,6 +170,32 @@ class NewRevocationModalForm(BaseModalForm):
"enctype": "multipart/form-data", # important for file upload
}
def is_valid(self):
super_valid = super().is_valid()
_file = self.cleaned_data.get("file", None)
if isinstance(_file, FieldFile):
# FieldFile declares that no new file has been uploaded and we do not need to check on the file again
return super_valid
mime_type_valid = self.document_model.is_mime_type_valid(_file)
if not mime_type_valid:
self.add_error(
"file",
FILE_TYPE_UNSUPPORTED
)
file_size_valid = self.document_model.is_file_size_valid(_file)
if not file_size_valid:
self.add_error(
"file",
FILE_SIZE_TOO_LARGE
)
file_valid = mime_type_valid and file_size_valid
return super_valid and file_valid
def save(self):
revocation = self.instance.add_revocation(self)
self.instance.mark_as_edited(self.user, self.request, edit_comment=REVOCATION_ADDED)
@ -517,5 +543,5 @@ class RemoveEcoAccountDeductionModalForm(RemoveModalForm):
self.deduction.delete()
class NewInterventionDocumentModalForm(NewDocumentModalForm):
class NewInterventionDocumentForm(NewDocumentForm):
document_model = InterventionDocument

View File

@ -33,7 +33,7 @@
{% trans 'Title' %}
</th>
{% if is_default_member and has_access %}
<th class="w-10" scope="col">
<th scope="col">
<span class="float-right">
{% trans 'Action' %}
</span>

View File

@ -34,7 +34,7 @@
{% trans 'Created' %}
</th>
{% if is_default_member and has_access %}
<th class="w-10" scope="col">
<th scope="col">
<span class="float-right">
{% trans 'Action' %}
</span>

View File

@ -27,14 +27,11 @@
<th scope="col">
{% trans 'Title' %}
</th>
<th scope="col">
{% trans 'Created on' %}
</th>
<th scope="col">
<th class="w-50" scope="col">
{% trans 'Comment' %}
</th>
{% if is_default_member and has_access %}
<th class="w-10" scope="col">
<th scope="col">
<span class="float-right">
{% trans 'Action' %}
</span>
@ -46,26 +43,18 @@
{% for doc in obj.documents.all %}
<tr>
<td>
<a href="{% url 'intervention:get-doc' obj.id doc.id %}">
<a href="{% url 'intervention:get-doc' doc.id %}">
{{ doc.title }}
</a>
</td>
<td>
<div class="scroll-150">
{{ doc.date_of_creation }}
</div>
</td>
<td>
<div class="scroll-150">
{{ doc.comment }}
</div>
</td>
<td class="align-middle float-right">
<td>
{% if is_default_member and has_access %}
<button data-form-url="{% url 'intervention:edit-doc' obj.id doc.id %}" class="btn btn-default btn-modal" title="{% trans 'Edit document' %}">
{% fa5_icon 'edit' %}
</button>
<button data-form-url="{% url 'intervention:remove-doc' obj.id doc.id %}" class="btn btn-default btn-modal" title="{% trans 'Remove document' %}">
<button data-form-url="{% url 'intervention:remove-doc' doc.id %}" class="btn btn-default btn-modal float-right" title="{% trans 'Remove document' %}">
{% fa5_icon 'trash' %}
</button>
{% endif %}

View File

@ -34,7 +34,7 @@
{% trans 'Comment' %}
</th>
{% if is_default_member and has_access %}
<th class="w-10" scope="col">
<th scope="col">
<span class="float-right">
{% trans 'Action' %}
</span>

View File

@ -37,7 +37,7 @@
{% trans 'Comment' %}
</th>
{% if is_default_member and has_access %}
<th class="w-10" scope="col">
<th scope="col">
<span class="float-right">
{% trans 'Action' %}
</span>

View File

@ -40,14 +40,12 @@ class InterventionViewTestCase(BaseViewTestCase):
self.deduction.intervention = self.intervention
self.deduction.save()
self.deduction_new_url = reverse("intervention:new-deduction", args=(self.intervention.id,))
self.deduction_edit_url = reverse("intervention:edit-deduction", args=(self.intervention.id, self.deduction.id,))
self.deduction_remove_url = reverse("intervention:remove-deduction", args=(self.intervention.id, self.deduction.id))
self.revocation = Revocation.objects.create(
legal=self.intervention.legal
)
self.revocation_new_url = reverse("intervention:new-revocation", args=(self.intervention.id,))
self.revocation_edit_url = reverse("intervention:edit-revocation", args=(self.intervention.id, self.revocation.id))
self.revocation_remove_url = reverse("intervention:remove-revocation", args=(self.intervention.id, self.revocation.id))
def test_views_anonymous_user(self):
@ -78,10 +76,8 @@ class InterventionViewTestCase(BaseViewTestCase):
self.run_check_url: f"{login_redirect_base}{self.run_check_url}",
self.record_url: f"{login_redirect_base}{self.record_url}",
self.deduction_new_url: f"{login_redirect_base}{self.deduction_new_url}",
self.deduction_edit_url: f"{login_redirect_base}{self.deduction_edit_url}",
self.deduction_remove_url: f"{login_redirect_base}{self.deduction_remove_url}",
self.revocation_new_url: f"{login_redirect_base}{self.revocation_new_url}",
self.revocation_edit_url: f"{login_redirect_base}{self.revocation_edit_url}",
self.revocation_remove_url: f"{login_redirect_base}{self.revocation_remove_url}",
}
@ -119,10 +115,8 @@ class InterventionViewTestCase(BaseViewTestCase):
self.run_check_url,
self.record_url,
self.revocation_new_url,
self.revocation_edit_url,
self.revocation_remove_url,
self.deduction_new_url,
self.deduction_edit_url,
self.deduction_remove_url,
]
@ -157,10 +151,8 @@ class InterventionViewTestCase(BaseViewTestCase):
self.remove_url,
self.share_create_url,
self.revocation_new_url,
self.revocation_edit_url,
self.revocation_remove_url,
self.deduction_new_url,
self.deduction_edit_url,
self.deduction_remove_url,
]
fail_urls = [
@ -207,10 +199,8 @@ class InterventionViewTestCase(BaseViewTestCase):
self.share_create_url,
self.log_url,
self.revocation_new_url,
self.revocation_edit_url,
self.revocation_remove_url,
self.deduction_new_url,
self.deduction_edit_url,
self.deduction_remove_url,
]
success_urls_redirect = {
@ -253,10 +243,8 @@ class InterventionViewTestCase(BaseViewTestCase):
self.share_create_url,
self.record_url,
self.revocation_new_url,
self.revocation_edit_url,
self.revocation_remove_url,
self.deduction_new_url,
self.deduction_edit_url,
self.deduction_remove_url,
]
success_urls_redirect = {
@ -299,10 +287,8 @@ class InterventionViewTestCase(BaseViewTestCase):
self.record_url,
self.run_check_url,
self.revocation_new_url,
self.revocation_edit_url,
self.revocation_remove_url,
self.deduction_new_url,
self.deduction_edit_url,
self.deduction_remove_url,
]
success_urls_redirect = {
@ -345,10 +331,8 @@ class InterventionViewTestCase(BaseViewTestCase):
self.share_create_url,
self.run_check_url,
self.revocation_new_url,
self.revocation_edit_url,
self.revocation_remove_url,
self.deduction_new_url,
self.deduction_edit_url,
self.deduction_remove_url,
]
success_urls_redirect = {
@ -391,10 +375,8 @@ class InterventionViewTestCase(BaseViewTestCase):
self.share_create_url,
self.run_check_url,
self.revocation_new_url,
self.revocation_edit_url,
self.revocation_remove_url,
self.deduction_new_url,
self.deduction_edit_url,
self.deduction_remove_url,
]
# Define urls where a redirect to a specific location is the proper response

View File

@ -10,7 +10,7 @@ from django.urls import path
from intervention.views import index_view, new_view, detail_view, edit_view, remove_view, new_document_view, share_view, \
create_share_view, remove_revocation_view, new_revocation_view, check_view, log_view, new_deduction_view, \
record_view, remove_document_view, get_document_view, get_revocation_view, new_id_view, report_view, \
remove_deduction_view, remove_compensation_view, edit_deduction_view, edit_revocation_view, edit_document_view
remove_deduction_view, remove_compensation_view, edit_deduction_view, edit_revocation_view
app_name = "intervention"
urlpatterns = [
@ -32,9 +32,8 @@ urlpatterns = [
# Documents
path('<id>/document/new/', new_document_view, name='new-doc'),
path('<id>/document/<doc_id>', get_document_view, name='get-doc'),
path('<id>/document/<doc_id>/remove/', remove_document_view, name='remove-doc'),
path('<id>/document/<doc_id>/edit/', edit_document_view, name='edit-doc'),
path('document/<doc_id>', get_document_view, name='get-doc'),
path('document/<doc_id>/remove/', remove_document_view, name='remove-doc'),
# Deductions
path('<id>/deduction/new', new_deduction_view, name='new-deduction'),

View File

@ -6,19 +6,19 @@ from django.shortcuts import render
from intervention.forms.forms import NewInterventionForm, EditInterventionForm
from intervention.forms.modalForms import ShareModalForm, NewRevocationModalForm, \
CheckModalForm, NewDeductionModalForm, NewInterventionDocumentModalForm, RemoveEcoAccountDeductionModalForm, \
CheckModalForm, NewDeductionModalForm, NewInterventionDocumentForm, RemoveEcoAccountDeductionModalForm, \
RemoveRevocationModalForm, EditEcoAccountDeductionModalForm, EditRevocationModalForm
from intervention.models import Intervention, Revocation, InterventionDocument, RevocationDocument
from intervention.tables import InterventionTable
from konova.contexts import BaseContext
from konova.decorators import *
from konova.forms import SimpleGeomForm, RemoveModalForm, RecordModalForm, EditDocumentModalForm
from konova.forms import SimpleGeomForm, RemoveModalForm, RecordModalForm
from konova.sub_settings.context_settings import TAB_TITLE_IDENTIFIER
from konova.utils.documents import remove_document, get_document
from konova.utils.generators import generate_qr_code
from konova.utils.message_templates import INTERVENTION_INVALID, FORM_INVALID, IDENTIFIER_REPLACED, \
CHECKED_RECORDED_RESET, DEDUCTION_REMOVED, DEDUCTION_ADDED, REVOCATION_ADDED, REVOCATION_REMOVED, \
COMPENSATION_REMOVED_TEMPLATE, DOCUMENT_ADDED, DEDUCTION_EDITED, REVOCATION_EDITED, DOCUMENT_EDITED
COMPENSATION_REMOVED_TEMPLATE, DOCUMENT_ADDED, DEDUCTION_EDITED, REVOCATION_EDITED
from konova.utils.user_checks import in_group
@ -129,7 +129,7 @@ def new_document_view(request: HttpRequest, id: str):
"""
intervention = get_object_or_404(Intervention, id=id)
form = NewInterventionDocumentModalForm(request.POST or None, request.FILES or None, instance=intervention, request=request)
form = NewInterventionDocumentForm(request.POST or None, request.FILES or None, instance=intervention, request=request)
return form.process_request(
request,
msg_success=DOCUMENT_ADDED,
@ -161,44 +161,48 @@ def get_revocation_view(request: HttpRequest, doc_id: str):
return redirect("intervention:detail", id=doc.instance.id)
return get_document(doc)
@login_required
@default_group_required
@shared_access_required(Intervention, "id")
def get_document_view(request: HttpRequest, id: str, doc_id: str):
def get_document_view(request: HttpRequest, doc_id: str):
""" Returns the document as downloadable file
Wraps the generic document fetcher function from konova.utils.
Args:
request (HttpRequest): The incoming request
id (str): The intervention id
doc_id (str): The document id
Returns:
"""
intervention = get_object_or_404(Intervention, id=id)
doc = get_object_or_404(InterventionDocument, id=doc_id)
user = request.user
instance = doc.instance
# File download only possible if related instance is shared with user
if not instance.users.filter(id=user.id):
messages.info(
request,
DATA_UNSHARED
)
return redirect("intervention:detail", id=instance.id)
return get_document(doc)
@login_required
@default_group_required
@shared_access_required(Intervention, "id")
def remove_document_view(request: HttpRequest, id: str, doc_id: str):
def remove_document_view(request: HttpRequest, doc_id: str):
""" Removes the document from the database and file system
Wraps the generic functionality from konova.utils.
Args:
request (HttpRequest): The incoming request
id (str): The intervention id
doc_id (str): The document id
Returns:
"""
intervention = get_object_or_404(Intervention, id=id)
doc = get_object_or_404(InterventionDocument, id=doc_id)
return remove_document(
request,
@ -206,32 +210,6 @@ def remove_document_view(request: HttpRequest, id: str, doc_id: str):
)
@login_required
@default_group_required
@shared_access_required(Intervention, "id")
def edit_document_view(request: HttpRequest, id: str, doc_id: str):
""" Removes the document from the database and file system
Wraps the generic functionality from konova.utils.
Args:
request (HttpRequest): The incoming request
id (str): The intervention id
doc_id (str): The document id
Returns:
"""
intervention = get_object_or_404(Intervention, id=id)
doc = get_object_or_404(InterventionDocument, id=doc_id)
form = EditDocumentModalForm(request.POST or None, request.FILES or None, instance=intervention, document=doc, request=request)
return form.process_request(
request,
DOCUMENT_EDITED,
redirect_url=reverse("intervention:detail", args=(intervention.id,)) + "#related_data"
)
@login_required
@any_group_check
def detail_view(request: HttpRequest, id: str):

View File

@ -12,8 +12,6 @@ from bootstrap_modal_forms.forms import BSModalForm
from bootstrap_modal_forms.utils import is_ajax
from django import forms
from django.contrib import messages
from django.db.models.fields.files import FieldFile
from user.models import User
from django.contrib.gis.forms import OSMWidget, MultiPolygonField
from django.contrib.gis.geos import MultiPolygon
@ -23,10 +21,10 @@ from django.shortcuts import render
from django.utils.translation import gettext_lazy as _
from konova.contexts import BaseContext
from konova.models import BaseObject, Geometry, RecordableObjectMixin, AbstractDocument
from konova.models import BaseObject, Geometry, RecordableObjectMixin
from konova.settings import DEFAULT_SRID
from konova.tasks import celery_update_parcels
from konova.utils.message_templates import FORM_INVALID, FILE_TYPE_UNSUPPORTED, FILE_SIZE_TOO_LARGE, DOCUMENT_EDITED
from konova.utils.message_templates import FORM_INVALID, FILE_TYPE_UNSUPPORTED, FILE_SIZE_TOO_LARGE
from user.models import UserActionLogEntry
@ -350,7 +348,7 @@ class RemoveDeadlineModalForm(RemoveModalForm):
self.instance.remove_deadline(self)
class NewDocumentModalForm(BaseModalForm):
class NewDocumentForm(BaseModalForm):
""" Modal form for new documents
"""
@ -422,10 +420,6 @@ class NewDocumentModalForm(BaseModalForm):
_file = self.cleaned_data.get("file", None)
if _file is None or isinstance(_file, FieldFile):
# FieldFile declares that no new file has been uploaded and we do not need to check on the file again
return super_valid
mime_type_valid = self.document_model.is_mime_type_valid(_file)
if not mime_type_valid:
self.add_error(
@ -464,39 +458,6 @@ class NewDocumentModalForm(BaseModalForm):
return doc
class EditDocumentModalForm(NewDocumentModalForm):
document = None
document_model = AbstractDocument
def __init__(self, *args, **kwargs):
self.document = kwargs.pop("document", None)
super().__init__(*args, **kwargs)
form_data = {
"title": self.document.title,
"comment": self.document.comment,
"creation_date": str(self.document.date_of_creation),
"file": self.document.file,
}
self.load_initial_data(form_data)
def save(self):
with transaction.atomic():
document = self.document
file = self.cleaned_data.get("file", None)
document.title = self.cleaned_data.get("title", None)
document.comment = self.cleaned_data.get("comment", None)
document.date_of_creation = self.cleaned_data.get("creation_date", None)
if not isinstance(file, FieldFile):
document.replace_file(file)
document.save()
self.instance.mark_as_edited(self.user, self.request, edit_comment=DOCUMENT_EDITED)
return document
class RecordModalForm(BaseModalForm):
""" Modal form for recording data

View File

@ -50,5 +50,5 @@ def remove_document(request: HttpRequest, doc: AbstractDocument):
form = RemoveModalForm(request.POST or None, instance=doc, request=request)
return form.process_request(
request=request,
msg_success=DOCUMENT_REMOVED_TEMPLATE.format(title),
msg_success=DOCUMENT_REMOVED_TEMPLATE.format(title)
)

View File

@ -65,7 +65,6 @@ REVOCATION_REMOVED = _("Revocation removed")
# DOCUMENTS
DOCUMENT_REMOVED_TEMPLATE = _("Document '{}' deleted")
DOCUMENT_ADDED = _("Document added")
DOCUMENT_EDITED = _("Document edited")
# Edited
EDITED_GENERAL_DATA = _("Edited general data")

Binary file not shown.

View File

@ -7,8 +7,8 @@
#: compensation/forms/modalForms.py:46 compensation/forms/modalForms.py:62
#: compensation/forms/modalForms.py:332 compensation/forms/modalForms.py:425
#: intervention/forms/forms.py:54 intervention/forms/forms.py:156
#: intervention/forms/forms.py:168 intervention/forms/modalForms.py:127
#: intervention/forms/modalForms.py:140 intervention/forms/modalForms.py:153
#: intervention/forms/forms.py:168 intervention/forms/modalForms.py:124
#: intervention/forms/modalForms.py:137 intervention/forms/modalForms.py:150
#: konova/filters/mixins.py:53 konova/filters/mixins.py:54
#: konova/filters/mixins.py:81 konova/filters/mixins.py:82
#: konova/filters/mixins.py:94 konova/filters/mixins.py:95
@ -18,15 +18,15 @@
#: konova/filters/mixins.py:270 konova/filters/mixins.py:315
#: konova/filters/mixins.py:353 konova/filters/mixins.py:354
#: konova/filters/mixins.py:385 konova/filters/mixins.py:386
#: konova/forms.py:143 konova/forms.py:244 konova/forms.py:315
#: konova/forms.py:359 konova/forms.py:369 konova/forms.py:382
#: konova/forms.py:394 konova/forms.py:412 user/forms.py:42
#: konova/forms.py:141 konova/forms.py:242 konova/forms.py:313
#: konova/forms.py:357 konova/forms.py:367 konova/forms.py:380
#: konova/forms.py:392 konova/forms.py:410 user/forms.py:42
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-02-10 10:17+0100\n"
"POT-Creation-Date: 2022-02-09 12:52+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -63,7 +63,7 @@ msgstr "Verantwortliche Stelle"
#: analysis/forms.py:58 compensation/forms/forms.py:88
#: compensation/forms/forms.py:165 intervention/forms/forms.py:64
#: intervention/forms/forms.py:81 intervention/forms/forms.py:97
#: intervention/forms/forms.py:113 intervention/forms/modalForms.py:49
#: intervention/forms/forms.py:113 intervention/forms/modalForms.py:46
msgid "Click for selection"
msgstr "Auswählen..."
@ -75,7 +75,7 @@ msgstr "Bericht generieren"
msgid "Select a timespan and the desired conservation office"
msgstr "Wählen Sie die Zeitspanne und die gewünschte Eintragungsstelle"
#: analysis/forms.py:69 konova/forms.py:191
#: analysis/forms.py:69 konova/forms.py:189
msgid "Continue"
msgstr "Weiter"
@ -220,7 +220,7 @@ msgstr "Abbuchungen"
#: compensation/templates/compensation/detail/eco_account/includes/states-before.html:36
#: ema/templates/ema/detail/includes/states-after.html:36
#: ema/templates/ema/detail/includes/states-before.html:36
#: intervention/forms/modalForms.py:338
#: intervention/forms/modalForms.py:311
msgid "Surface"
msgstr "Fläche"
@ -283,8 +283,8 @@ msgid "Type"
msgstr "Typ"
#: analysis/templates/analysis/reports/includes/old_data/amount.html:24
#: compensation/tables.py:89 intervention/forms/modalForms.py:349
#: intervention/forms/modalForms.py:356 intervention/tables.py:88
#: compensation/tables.py:89 intervention/forms/modalForms.py:322
#: intervention/forms/modalForms.py:329 intervention/tables.py:88
#: intervention/templates/intervention/detail/view.html:19
#: konova/templates/konova/includes/quickstart/interventions.html:4
#: templates/navbars/navbar.html:22
@ -294,7 +294,7 @@ msgstr "Eingriff"
#: analysis/templates/analysis/reports/includes/old_data/amount.html:34
#: compensation/tables.py:266
#: compensation/templates/compensation/detail/eco_account/view.html:19
#: intervention/forms/modalForms.py:322 intervention/forms/modalForms.py:329
#: intervention/forms/modalForms.py:295 intervention/forms/modalForms.py:302
#: konova/templates/konova/includes/quickstart/ecoaccounts.html:4
#: templates/navbars/navbar.html:34
msgid "Eco-account"
@ -340,7 +340,7 @@ msgstr "Automatisch generiert"
#: intervention/templates/intervention/detail/includes/documents.html:28
#: intervention/templates/intervention/detail/view.html:31
#: intervention/templates/intervention/report/report.html:12
#: konova/forms.py:358
#: konova/forms.py:356
msgid "Title"
msgstr "Bezeichnung"
@ -363,11 +363,11 @@ msgstr "Kompensation XY; Flur ABC"
#: ema/templates/ema/detail/includes/actions.html:34
#: ema/templates/ema/detail/includes/deadlines.html:34
#: ema/templates/ema/detail/includes/documents.html:31
#: intervention/forms/forms.py:180 intervention/forms/modalForms.py:152
#: intervention/templates/intervention/detail/includes/documents.html:34
#: intervention/forms/forms.py:180 intervention/forms/modalForms.py:149
#: intervention/templates/intervention/detail/includes/documents.html:31
#: intervention/templates/intervention/detail/includes/payments.html:34
#: intervention/templates/intervention/detail/includes/revocation.html:38
#: konova/forms.py:393 konova/templates/konova/includes/comment_card.html:16
#: konova/forms.py:391 konova/templates/konova/includes/comment_card.html:16
msgid "Comment"
msgstr "Kommentar"
@ -483,7 +483,7 @@ msgid "Due on which date"
msgstr "Zahlung wird an diesem Datum erwartet"
#: compensation/forms/modalForms.py:63 compensation/forms/modalForms.py:333
#: intervention/forms/modalForms.py:154 konova/forms.py:395
#: intervention/forms/modalForms.py:151 konova/forms.py:393
msgid "Additional comment, maximum {} letters"
msgstr "Zusätzlicher Kommentar, maximal {} Zeichen"
@ -511,7 +511,7 @@ msgstr "Zusatzbezeichnung"
msgid "Select an additional biotope type"
msgstr "Zusatzbezeichnung wählen"
#: compensation/forms/modalForms.py:196 intervention/forms/modalForms.py:340
#: compensation/forms/modalForms.py:196 intervention/forms/modalForms.py:313
msgid "in m²"
msgstr ""
@ -523,7 +523,7 @@ msgstr "Neuer Zustand"
msgid "Insert data for the new state"
msgstr "Geben Sie die Daten des neuen Zustandes ein"
#: compensation/forms/modalForms.py:215 konova/forms.py:193
#: compensation/forms/modalForms.py:215 konova/forms.py:191
msgid "Object removed"
msgstr "Objekt entfernt"
@ -539,7 +539,7 @@ msgstr "Fristart wählen"
#: compensation/templates/compensation/detail/compensation/includes/deadlines.html:31
#: compensation/templates/compensation/detail/eco_account/includes/deadlines.html:31
#: ema/templates/ema/detail/includes/deadlines.html:31
#: intervention/forms/modalForms.py:126
#: intervention/forms/modalForms.py:123
msgid "Date"
msgstr "Datum"
@ -582,7 +582,7 @@ msgstr "Maßnahmentyp wählen"
#: 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/documents.html:36
#: intervention/templates/intervention/detail/includes/payments.html:39
#: intervention/templates/intervention/detail/includes/revocation.html:43
#: templates/log.html:10
@ -821,14 +821,14 @@ msgstr "Dokumente"
#: compensation/templates/compensation/detail/eco_account/includes/documents.html:14
#: ema/templates/ema/detail/includes/documents.html:14
#: intervention/templates/intervention/detail/includes/documents.html:14
#: konova/forms.py:411
#: konova/forms.py:409
msgid "Add new document"
msgstr "Neues Dokument hinzufügen"
#: compensation/templates/compensation/detail/compensation/includes/documents.html:57
#: compensation/templates/compensation/detail/eco_account/includes/documents.html:55
#: ema/templates/ema/detail/includes/documents.html:55
#: intervention/templates/intervention/detail/includes/documents.html:68
#: intervention/templates/intervention/detail/includes/documents.html:57
msgid "Remove document"
msgstr "Dokument löschen"
@ -943,14 +943,14 @@ msgstr "Zuletzt bearbeitet"
#: compensation/templates/compensation/detail/compensation/view.html:99
#: compensation/templates/compensation/detail/eco_account/view.html:82
#: ema/templates/ema/detail/view.html:76 intervention/forms/modalForms.py:56
#: ema/templates/ema/detail/view.html:76 intervention/forms/modalForms.py:53
#: intervention/templates/intervention/detail/view.html:116
msgid "Shared with"
msgstr "Freigegeben für"
#: compensation/templates/compensation/detail/eco_account/includes/controls.html:15
#: ema/templates/ema/detail/includes/controls.html:15
#: intervention/forms/modalForms.py:70
#: intervention/forms/modalForms.py:67
#: intervention/templates/intervention/detail/includes/controls.html:15
msgid "Share"
msgstr "Freigabe"
@ -992,11 +992,6 @@ msgid "Recorded on"
msgstr "Verzeichnet am"
#: compensation/templates/compensation/detail/eco_account/includes/deductions.html:65
#: intervention/templates/intervention/detail/includes/deductions.html:60
msgid "Edit Deduction"
msgstr "Abbuchung bearbeiten"
#: compensation/templates/compensation/detail/eco_account/includes/deductions.html:68
#: intervention/templates/intervention/detail/includes/deductions.html:63
msgid "Remove Deduction"
msgstr "Abbuchung entfernen"
@ -1085,22 +1080,22 @@ msgstr "Daten zu den verantwortlichen Stellen"
msgid "Compensations - Overview"
msgstr "Kompensationen - Übersicht"
#: compensation/views/compensation.py:149 konova/utils/message_templates.py:31
#: compensation/views/compensation.py:149 konova/utils/message_templates.py:27
msgid "Compensation {} edited"
msgstr "Kompensation {} bearbeitet"
#: compensation/views/compensation.py:159 compensation/views/eco_account.py:163
#: ema/views.py:230 intervention/views.py:337
#: ema/views.py:230 intervention/views.py:305
msgid "Edit {}"
msgstr "Bearbeite {}"
#: compensation/views/compensation.py:238 compensation/views/eco_account.py:347
#: ema/views.py:191 intervention/views.py:541
#: ema/views.py:191 intervention/views.py:483
msgid "Log"
msgstr "Log"
#: compensation/views/compensation.py:487 compensation/views/eco_account.py:620
#: ema/views.py:477 intervention/views.py:687
#: ema/views.py:477 intervention/views.py:629
msgid "Report {}"
msgstr "Bericht {}"
@ -1121,32 +1116,32 @@ msgid "Eco-account removed"
msgstr "Ökokonto entfernt"
#: compensation/views/eco_account.py:368 ema/views.py:272
#: intervention/views.py:640
#: intervention/views.py:582
msgid "{} unrecorded"
msgstr "{} entzeichnet"
#: compensation/views/eco_account.py:368 ema/views.py:272
#: intervention/views.py:640
#: intervention/views.py:582
msgid "{} recorded"
msgstr "{} verzeichnet"
#: compensation/views/eco_account.py:693 ema/views.py:543
#: intervention/views.py:438
#: intervention/views.py:380
msgid "{} has already been shared with you"
msgstr "{} wurde bereits für Sie freigegeben"
#: compensation/views/eco_account.py:698 ema/views.py:548
#: intervention/views.py:443
#: intervention/views.py:385
msgid "{} has been shared with you"
msgstr "{} ist nun für Sie freigegeben"
#: compensation/views/eco_account.py:705 ema/views.py:555
#: intervention/views.py:450
#: intervention/views.py:392
msgid "Share link invalid"
msgstr "Freigabelink ungültig"
#: compensation/views/eco_account.py:728 ema/views.py:578
#: intervention/views.py:473
#: intervention/views.py:415
msgid "Share settings updated"
msgstr "Freigabe Einstellungen aktualisiert"
@ -1259,19 +1254,19 @@ msgstr "Neuer Eingriff"
msgid "Edit intervention"
msgstr "Eingriff bearbeiten"
#: intervention/forms/modalForms.py:29
#: intervention/forms/modalForms.py:26
msgid "Share link"
msgstr "Freigabelink"
#: intervention/forms/modalForms.py:31
#: intervention/forms/modalForms.py:28
msgid "Send this link to users who you want to have writing access on the data"
msgstr "Andere Nutzer erhalten über diesen Link Zugriff auf die Daten"
#: intervention/forms/modalForms.py:41
#: intervention/forms/modalForms.py:38
msgid "Add user to share with"
msgstr "Nutzer direkt hinzufügen"
#: intervention/forms/modalForms.py:43
#: intervention/forms/modalForms.py:40
msgid ""
"Multiple selection possible - You can only select users which do not already "
"have access. Enter the full username."
@ -1279,46 +1274,46 @@ msgstr ""
"Mehrfachauswahl möglich - Sie können nur Nutzer wählen, für die der Eintrag "
"noch nicht freigegeben wurde. Geben Sie den ganzen Nutzernamen an."
#: intervention/forms/modalForms.py:59
#: intervention/forms/modalForms.py:56
msgid "Remove check to remove access for this user"
msgstr "Wählen Sie die Nutzer ab, die keinen Zugriff mehr haben sollen"
#: intervention/forms/modalForms.py:71
#: intervention/forms/modalForms.py:68
msgid "Share settings for {}"
msgstr "Freigabe Einstellungen für {}"
#: intervention/forms/modalForms.py:128
#: intervention/forms/modalForms.py:125
msgid "Date of revocation"
msgstr "Datum des Widerspruchs"
#: intervention/forms/modalForms.py:139
#: intervention/forms/modalForms.py:136
#: intervention/templates/intervention/detail/includes/revocation.html:35
msgid "Document"
msgstr "Dokument"
#: intervention/forms/modalForms.py:142
#: intervention/forms/modalForms.py:139
msgid "Must be smaller than 15 Mb"
msgstr "Muss kleiner als 15 Mb sein"
#: intervention/forms/modalForms.py:167
#: intervention/forms/modalForms.py:163
#: intervention/templates/intervention/detail/includes/revocation.html:18
msgid "Add revocation"
msgstr "Widerspruch hinzufügen"
#: intervention/forms/modalForms.py:224
#: intervention/forms/modalForms.py:197
msgid "Checked intervention data"
msgstr "Eingriffsdaten geprüft"
#: intervention/forms/modalForms.py:230
#: intervention/forms/modalForms.py:203
msgid "Checked compensations data and payments"
msgstr "Kompensationen und Zahlungen geprüft"
#: intervention/forms/modalForms.py:239
#: intervention/forms/modalForms.py:212
#: intervention/templates/intervention/detail/includes/controls.html:19
msgid "Run check"
msgstr "Prüfung vornehmen"
#: intervention/forms/modalForms.py:240 konova/forms.py:514
#: intervention/forms/modalForms.py:213 konova/forms.py:475
msgid ""
"I, {} {}, confirm that all necessary control steps have been performed by "
"myself."
@ -1326,23 +1321,23 @@ msgstr ""
"Ich, {} {}, bestätige, dass die notwendigen Kontrollschritte durchgeführt "
"wurden:"
#: intervention/forms/modalForms.py:324
#: intervention/forms/modalForms.py:297
msgid "Only recorded accounts can be selected for deductions"
msgstr "Nur verzeichnete Ökokonten können für Abbuchungen verwendet werden."
#: intervention/forms/modalForms.py:351
#: intervention/forms/modalForms.py:324
msgid "Only shared interventions can be selected"
msgstr "Nur freigegebene Eingriffe können gewählt werden"
#: intervention/forms/modalForms.py:364
#: intervention/forms/modalForms.py:337
msgid "New Deduction"
msgstr "Neue Abbuchung"
#: intervention/forms/modalForms.py:365
#: intervention/forms/modalForms.py:338
msgid "Enter the information for a new deduction from a chosen eco-account"
msgstr "Geben Sie die Informationen für eine neue Abbuchung ein."
#: intervention/forms/modalForms.py:408
#: intervention/forms/modalForms.py:381
msgid ""
"Eco-account {} is not recorded yet. You can only deduct from recorded "
"accounts."
@ -1350,7 +1345,7 @@ msgstr ""
"Ökokonto {} ist noch nicht verzeichnet. Abbuchungen können nur von "
"verzeichneten Ökokonten erfolgen."
#: intervention/forms/modalForms.py:418
#: intervention/forms/modalForms.py:391
msgid ""
"The account {} has not enough surface for a deduction of {} m². There are "
"only {} m² left"
@ -1378,14 +1373,9 @@ msgstr "Ökokonto gelöscht! Abbuchung ungültig!"
msgid "Eco-account not recorded! Deduction invalid!"
msgstr "Ökokonto nicht verzeichnet! Abbuchung ungültig!"
#: intervention/templates/intervention/detail/includes/documents.html:31
#: konova/forms.py:368
msgid "Created on"
msgstr "Erstellt"
#: intervention/templates/intervention/detail/includes/documents.html:65
msgid "Edit document"
msgstr "Dokument bearbeitet"
#: intervention/templates/intervention/detail/includes/deductions.html:60
msgid "Edit Deduction"
msgstr "Abbuchung bearbeiten"
#: intervention/templates/intervention/detail/includes/payments.html:8
#: intervention/templates/intervention/report/report.html:73
@ -1424,10 +1414,6 @@ msgid "Revocation"
msgstr "Widerspruch"
#: intervention/templates/intervention/detail/includes/revocation.html:69
msgid "Edit revocation"
msgstr "Widerspruch bearbeiten"
#: intervention/templates/intervention/detail/includes/revocation.html:72
msgid "Remove revocation"
msgstr "Widerspruch entfernen"
@ -1470,19 +1456,19 @@ msgstr "Eingriffe - Übersicht"
msgid "Intervention {} added"
msgstr "Eingriff {} hinzugefügt"
#: intervention/views.py:325
#: intervention/views.py:293
msgid "Intervention {} edited"
msgstr "Eingriff {} bearbeitet"
#: intervention/views.py:361
#: intervention/views.py:329
msgid "{} removed"
msgstr "{} entfernt"
#: intervention/views.py:494
#: intervention/views.py:436
msgid "Check performed"
msgstr "Prüfung durchgeführt"
#: intervention/views.py:645
#: intervention/views.py:587
msgid "There are errors on this intervention:"
msgstr "Es liegen Fehler in diesem Eingriff vor:"
@ -1566,69 +1552,81 @@ msgstr "Nach Zulassungsbehörde suchen"
msgid "Search for conservation office"
msgstr "Nch Eintragungsstelle suchen"
#: konova/forms.py:39 templates/form/collapsable/form.html:62
#: konova/forms.py:37 templates/form/collapsable/form.html:62
msgid "Save"
msgstr "Speichern"
#: konova/forms.py:71
#: konova/forms.py:69
msgid "Not editable"
msgstr "Nicht editierbar"
#: konova/forms.py:142 konova/forms.py:314
#: konova/forms.py:140 konova/forms.py:312
msgid "Confirm"
msgstr "Bestätige"
#: konova/forms.py:154 konova/forms.py:323
#: konova/forms.py:152 konova/forms.py:321
msgid "Remove"
msgstr "Löschen"
#: konova/forms.py:156
#: konova/forms.py:154
msgid "You are about to remove {} {}"
msgstr "Sie sind dabei {} {} zu löschen"
#: konova/forms.py:243 konova/utils/quality.py:44 konova/utils/quality.py:46
#: konova/forms.py:241 konova/utils/quality.py:44 konova/utils/quality.py:46
#: templates/form/collapsable/form.html:45
msgid "Geometry"
msgstr "Geometrie"
#: konova/forms.py:324
#: konova/forms.py:322
msgid "Are you sure?"
msgstr "Sind Sie sicher?"
#: konova/forms.py:370
#: konova/forms.py:366
msgid "Created on"
msgstr "Erstellt"
#: konova/forms.py:368
msgid "When has this file been created? Important for photos."
msgstr "Wann wurde diese Datei erstellt oder das Foto aufgenommen?"
#: konova/forms.py:381
#: konova/forms.py:379
#: venv/lib/python3.7/site-packages/django/db/models/fields/files.py:231
msgid "File"
msgstr "Datei"
#: konova/forms.py:383
#: konova/forms.py:381
msgid "Allowed formats: pdf, jpg, png. Max size 15 MB."
msgstr "Formate: pdf, jpg, png. Maximal 15 MB."
#: konova/forms.py:449
#: konova/forms.py:427
msgid "Unsupported file type"
msgstr "Dateiformat nicht unterstützt"
#: konova/forms.py:434
msgid "File too large"
msgstr "Datei zu groß"
#: konova/forms.py:443
msgid "Added document"
msgstr "Dokument hinzugefügt"
#: konova/forms.py:505
#: konova/forms.py:466
msgid "Confirm record"
msgstr "Verzeichnen bestätigen"
#: konova/forms.py:513
#: konova/forms.py:474
msgid "Record data"
msgstr "Daten verzeichnen"
#: konova/forms.py:520
#: konova/forms.py:481
msgid "Confirm unrecord"
msgstr "Entzeichnen bestätigen"
#: konova/forms.py:521
#: konova/forms.py:482
msgid "Unrecord data"
msgstr "Daten entzeichnen"
#: konova/forms.py:522
#: konova/forms.py:483
msgid "I, {} {}, confirm that this data must be unrecorded."
msgstr ""
"Ich, {} {}, bestätige, dass diese Daten wieder entzeichnet werden müssen."
@ -1802,14 +1800,6 @@ msgid "Status of Checked and Recorded reseted"
msgstr "'Geprüft'/'Verzeichnet' wurde zurückgesetzt"
#: konova/utils/message_templates.py:22
msgid "Unsupported file type"
msgstr "Dateiformat nicht unterstützt"
#: konova/utils/message_templates.py:23
msgid "File too large"
msgstr "Datei zu groß"
#: konova/utils/message_templates.py:26
msgid ""
"Action canceled. Eco account is recorded or deductions exist. Only "
"conservation office member can perform this action."
@ -1817,119 +1807,115 @@ msgstr ""
"Aktion abgebrochen. Ökokonto ist bereits verzeichnet oder Abbuchungen liegen "
"vor. Nur Eintragungsstellennutzer können diese Aktion jetzt durchführen."
#: konova/utils/message_templates.py:29
#: konova/utils/message_templates.py:25
msgid "Compensation {} added"
msgstr "Kompensation {} hinzugefügt"
#: konova/utils/message_templates.py:30
#: konova/utils/message_templates.py:26
msgid "Compensation {} removed"
msgstr "Kompensation {} entfernt"
#: konova/utils/message_templates.py:32
#: konova/utils/message_templates.py:28
msgid "Added compensation action"
msgstr "Maßnahme hinzugefügt"
#: konova/utils/message_templates.py:33
#: konova/utils/message_templates.py:29
msgid "Added compensation state"
msgstr "Zustand hinzugefügt"
#: konova/utils/message_templates.py:36
#: konova/utils/message_templates.py:32
msgid "State removed"
msgstr "Zustand gelöscht"
#: konova/utils/message_templates.py:37
#: konova/utils/message_templates.py:33
msgid "State edited"
msgstr "Zustand bearbeitet"
#: konova/utils/message_templates.py:38
#: konova/utils/message_templates.py:34
msgid "State added"
msgstr "Zustand hinzugefügt"
#: konova/utils/message_templates.py:41
#: konova/utils/message_templates.py:37
msgid "Action added"
msgstr "Maßnahme hinzugefügt"
#: konova/utils/message_templates.py:42
#: konova/utils/message_templates.py:38
msgid "Action edited"
msgstr "Maßnahme bearbeitet"
#: konova/utils/message_templates.py:43
#: konova/utils/message_templates.py:39
msgid "Action removed"
msgstr "Maßnahme entfernt"
#: konova/utils/message_templates.py:46
#: konova/utils/message_templates.py:42
msgid "Deduction added"
msgstr "Abbuchung hinzugefügt"
#: konova/utils/message_templates.py:47
#: konova/utils/message_templates.py:43
msgid "Deduction edited"
msgstr "Abbuchung bearbeitet"
#: konova/utils/message_templates.py:48
#: konova/utils/message_templates.py:44
msgid "Deduction removed"
msgstr "Abbuchung entfernt"
#: konova/utils/message_templates.py:51
#: konova/utils/message_templates.py:47
msgid "Deadline added"
msgstr "Frist/Termin hinzugefügt"
#: konova/utils/message_templates.py:52
#: konova/utils/message_templates.py:48
msgid "Deadline edited"
msgstr "Frist/Termin bearbeitet"
#: konova/utils/message_templates.py:53
#: konova/utils/message_templates.py:49
msgid "Deadline removed"
msgstr "Frist/Termin gelöscht"
#: konova/utils/message_templates.py:56
#: konova/utils/message_templates.py:52
msgid "Payment added"
msgstr "Zahlung hinzugefügt"
#: konova/utils/message_templates.py:57
#: konova/utils/message_templates.py:53
msgid "Payment edited"
msgstr "Zahlung bearbeitet"
#: konova/utils/message_templates.py:58
#: konova/utils/message_templates.py:54
msgid "Payment removed"
msgstr "Zahlung gelöscht"
#: konova/utils/message_templates.py:61
#: konova/utils/message_templates.py:57
msgid "Revocation added"
msgstr "Widerspruch hinzugefügt"
#: konova/utils/message_templates.py:62
#: konova/utils/message_templates.py:58
msgid "Revocation edited"
msgstr "Widerspruch bearbeitet"
#: konova/utils/message_templates.py:63
#: konova/utils/message_templates.py:59
msgid "Revocation removed"
msgstr "Widerspruch entfernt"
#: konova/utils/message_templates.py:66
#: konova/utils/message_templates.py:62
msgid "Document '{}' deleted"
msgstr "Dokument '{}' gelöscht"
#: konova/utils/message_templates.py:67
#: konova/utils/message_templates.py:63
msgid "Document added"
msgstr "Dokument hinzugefügt"
#: konova/utils/message_templates.py:68
msgid "Document edited"
msgstr "Dokument bearbeitet"
#: konova/utils/message_templates.py:71
#: konova/utils/message_templates.py:66
msgid "Edited general data"
msgstr "Allgemeine Daten bearbeitet"
#: konova/utils/message_templates.py:72
#: konova/utils/message_templates.py:67
msgid "Added deadline"
msgstr "Frist/Termin hinzugefügt"
#: konova/utils/message_templates.py:75
#: konova/utils/message_templates.py:70
msgid "Geometry conflict detected with {}"
msgstr "Geometriekonflikt mit folgenden Einträgen erkannt: {}"
#: konova/utils/message_templates.py:78
#: konova/utils/message_templates.py:73
msgid "This intervention has {} revocations"
msgstr "Dem Eingriff liegen {} Widersprüche vor"