Compare commits
No commits in common. "6fbdc3c1fb5ff340e4ed2f4fc58c5ea55b5edcbd" and "1b5cda648e8273dc36ab7ce47f46daed631a78e7" have entirely different histories.
6fbdc3c1fb
...
1b5cda648e
@ -18,10 +18,10 @@ from codelist.settings import CODELIST_BIOTOPES_ID, CODELIST_COMPENSATION_ACTION
|
|||||||
CODELIST_COMPENSATION_ACTION_DETAIL_ID
|
CODELIST_COMPENSATION_ACTION_DETAIL_ID
|
||||||
from compensation.models import CompensationDocument, EcoAccountDocument
|
from compensation.models import CompensationDocument, EcoAccountDocument
|
||||||
from konova.contexts import BaseContext
|
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.models import DeadlineType
|
||||||
from konova.utils.message_templates import FORM_INVALID, ADDED_COMPENSATION_STATE, ADDED_DEADLINE, \
|
from konova.utils.message_templates import FORM_INVALID, ADDED_COMPENSATION_STATE, ADDED_DEADLINE, \
|
||||||
ADDED_COMPENSATION_ACTION, PAYMENT_EDITED, COMPENSATION_STATE_EDITED, COMPENSATION_ACTION_EDITED, DEADLINE_EDITED
|
ADDED_COMPENSATION_ACTION, PAYMENT_EDITED
|
||||||
|
|
||||||
|
|
||||||
class NewPaymentForm(BaseModalForm):
|
class NewPaymentForm(BaseModalForm):
|
||||||
@ -261,29 +261,6 @@ class NewStateModalForm(BaseModalForm):
|
|||||||
raise NotImplementedError
|
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):
|
class RemoveCompensationStateModalForm(RemoveModalForm):
|
||||||
""" Removing modal form for CompensationState
|
""" Removing modal form for CompensationState
|
||||||
|
|
||||||
@ -373,29 +350,6 @@ class NewDeadlineModalForm(BaseModalForm):
|
|||||||
return deadline
|
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):
|
class NewActionModalForm(BaseModalForm):
|
||||||
""" Form handling action related input
|
""" Form handling action related input
|
||||||
|
|
||||||
@ -489,36 +443,9 @@ class NewActionModalForm(BaseModalForm):
|
|||||||
return action
|
return action
|
||||||
|
|
||||||
|
|
||||||
class EditCompensationActionModalForm(NewActionModalForm):
|
class NewCompensationDocumentForm(NewDocumentForm):
|
||||||
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):
|
|
||||||
document_model = CompensationDocument
|
document_model = CompensationDocument
|
||||||
|
|
||||||
|
|
||||||
class NewEcoAccountDocumentModalForm(NewDocumentModalForm):
|
class NewEcoAccountDocumentForm(NewDocumentForm):
|
||||||
document_model = EcoAccountDocument
|
document_model = EcoAccountDocument
|
@ -35,7 +35,7 @@
|
|||||||
{% trans 'Comment' %}
|
{% trans 'Comment' %}
|
||||||
</th>
|
</th>
|
||||||
{% if is_default_member and has_access %}
|
{% if is_default_member and has_access %}
|
||||||
<th class="w-10" scope="col">
|
<th scope="col">
|
||||||
<span class="float-right">
|
<span class="float-right">
|
||||||
{% trans 'Action' %}
|
{% trans 'Action' %}
|
||||||
</span>
|
</span>
|
||||||
@ -61,12 +61,9 @@
|
|||||||
{{ action.comment }}
|
{{ action.comment }}
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td class="align-middle float-right">
|
<td class="">
|
||||||
{% if is_default_member and has_access %}
|
{% 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' %}">
|
<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 'edit' %}
|
|
||||||
</button>
|
|
||||||
<button data-form-url="{% url 'compensation:action-remove' obj.id action.id %}" class="btn btn-default btn-modal" title="{% trans 'Remove action' %}">
|
|
||||||
{% fa5_icon 'trash' %}
|
{% fa5_icon 'trash' %}
|
||||||
</button>
|
</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
{% trans 'Comment' %}
|
{% trans 'Comment' %}
|
||||||
</th>
|
</th>
|
||||||
{% if is_default_member and has_access %}
|
{% if is_default_member and has_access %}
|
||||||
<th class="w-10" scope="col">
|
<th scope="col">
|
||||||
<span class="float-right">
|
<span class="float-right">
|
||||||
{% trans 'Action' %}
|
{% trans 'Action' %}
|
||||||
</span>
|
</span>
|
||||||
@ -54,12 +54,9 @@
|
|||||||
{{ deadline.comment }}
|
{{ deadline.comment }}
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td class="align-middle float-right">
|
<td>
|
||||||
{% if is_default_member and has_access %}
|
{% 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' %}">
|
<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 'edit' %}
|
|
||||||
</button>
|
|
||||||
<button data-form-url="{% url 'compensation:deadline-remove' obj.id deadline.id %}" class="btn btn-default btn-modal" title="{% trans 'Remove deadline' %}">
|
|
||||||
{% fa5_icon 'trash' %}
|
{% fa5_icon 'trash' %}
|
||||||
</button>
|
</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -27,14 +27,11 @@
|
|||||||
<th scope="col">
|
<th scope="col">
|
||||||
{% trans 'Title' %}
|
{% trans 'Title' %}
|
||||||
</th>
|
</th>
|
||||||
<th scope="col">
|
|
||||||
{% trans 'Created on' %}
|
|
||||||
</th>
|
|
||||||
<th scope="col">
|
<th scope="col">
|
||||||
{% trans 'Comment' %}
|
{% trans 'Comment' %}
|
||||||
</th>
|
</th>
|
||||||
{% if is_default_member and has_access %}
|
{% if is_default_member and has_access %}
|
||||||
<th class="w-10" scope="col">
|
<th scope="col">
|
||||||
<span class="float-right">
|
<span class="float-right">
|
||||||
{% trans 'Action' %}
|
{% trans 'Action' %}
|
||||||
</span>
|
</span>
|
||||||
@ -46,24 +43,18 @@
|
|||||||
{% for doc in obj.documents.all %}
|
{% for doc in obj.documents.all %}
|
||||||
<tr>
|
<tr>
|
||||||
<td class="align-middle">
|
<td class="align-middle">
|
||||||
<a href="{% url 'compensation:get-doc' obj.id doc.id %}">
|
<a href="{% url 'compensation:get-doc' doc.id %}">
|
||||||
{{ doc.title }}
|
{{ doc.title }}
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td class="align-middle">
|
|
||||||
{{ doc.date_of_creation }}
|
|
||||||
</td>
|
|
||||||
<td class="align-middle">
|
<td class="align-middle">
|
||||||
<div class="scroll-150">
|
<div class="scroll-150">
|
||||||
{{ doc.comment }}
|
{{ doc.comment }}
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td class="align-middle float-right">
|
<td class="align-middle">
|
||||||
{% if is_default_member and has_access %}
|
{% 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' %}">
|
<button data-form-url="{% url 'compensation:remove-doc' doc.id %}" class="btn btn-default btn-modal float-right" title="{% trans 'Remove 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' %}">
|
|
||||||
{% fa5_icon 'trash' %}
|
{% fa5_icon 'trash' %}
|
||||||
</button>
|
</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
{% trans 'Surface' %}
|
{% trans 'Surface' %}
|
||||||
</th>
|
</th>
|
||||||
{% if is_default_member and has_access %}
|
{% if is_default_member and has_access %}
|
||||||
<th class="w-10" scope="col">
|
<th scope="col">
|
||||||
<span class="float-right">
|
<span class="float-right">
|
||||||
{% trans 'Action' %}
|
{% trans 'Action' %}
|
||||||
</span>
|
</span>
|
||||||
@ -57,12 +57,9 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td>{{ state.surface|floatformat:2 }} m²</td>
|
<td>{{ state.surface|floatformat:2 }} m²</td>
|
||||||
<td class="align-middle float-right">
|
<td>
|
||||||
{% if is_default_member and has_access %}
|
{% 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' %}">
|
<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 'edit' %}
|
|
||||||
</button>
|
|
||||||
<button data-form-url="{% url 'compensation:state-remove' obj.id state.id %}" class="btn btn-default btn-modal" title="{% trans 'Remove state' %}">
|
|
||||||
{% fa5_icon 'trash' %}
|
{% fa5_icon 'trash' %}
|
||||||
</button>
|
</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
{% trans 'Surface' %}
|
{% trans 'Surface' %}
|
||||||
</th>
|
</th>
|
||||||
{% if is_default_member and has_access %}
|
{% if is_default_member and has_access %}
|
||||||
<th class="w-10" scope="col">
|
<th scope="col">
|
||||||
<span class="float-right">
|
<span class="float-right">
|
||||||
{% trans 'Action' %}
|
{% trans 'Action' %}
|
||||||
</span>
|
</span>
|
||||||
@ -57,12 +57,9 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td>{{ state.surface|floatformat:2 }} m²</td>
|
<td>{{ state.surface|floatformat:2 }} m²</td>
|
||||||
<td class="align-middle float-right">
|
<td>
|
||||||
{% if is_default_member and has_access %}
|
{% 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' %}">
|
<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 'edit' %}
|
|
||||||
</button>
|
|
||||||
<button data-form-url="{% url 'compensation:state-remove' obj.id state.id %}" class="btn btn-default btn-modal" title="{% trans 'Remove state' %}">
|
|
||||||
{% fa5_icon 'trash' %}
|
{% fa5_icon 'trash' %}
|
||||||
</button>
|
</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
{% trans 'Comment' %}
|
{% trans 'Comment' %}
|
||||||
</th>
|
</th>
|
||||||
{% if is_default_member and has_access %}
|
{% if is_default_member and has_access %}
|
||||||
<th class="w-10" scope="col">
|
<th scope="col">
|
||||||
<span class="float-right">
|
<span class="float-right">
|
||||||
{% trans 'Action' %}
|
{% trans 'Action' %}
|
||||||
</span>
|
</span>
|
||||||
@ -60,12 +60,9 @@
|
|||||||
{{ action.comment }}
|
{{ action.comment }}
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td class="align-middle float-right">
|
<td class="">
|
||||||
{% if is_default_member and has_access %}
|
{% 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' %}">
|
<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 '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' %}">
|
|
||||||
{% fa5_icon 'trash' %}
|
{% fa5_icon 'trash' %}
|
||||||
</button>
|
</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
<th scope="col">
|
<th scope="col">
|
||||||
{% trans 'Comment' %}
|
{% trans 'Comment' %}
|
||||||
</th>
|
</th>
|
||||||
<th class="w-10" scope="col">
|
<th scope="col">
|
||||||
<span class="float-right">
|
<span class="float-right">
|
||||||
{% trans 'Action' %}
|
{% trans 'Action' %}
|
||||||
</span>
|
</span>
|
||||||
@ -52,12 +52,9 @@
|
|||||||
{{ deadline.comment }}
|
{{ deadline.comment }}
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td class="align-middle float-right">
|
<td class="align-middle">
|
||||||
{% if is_default_member and has_access %}
|
{% 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' %}">
|
<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 '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' %}">
|
|
||||||
{% fa5_icon 'trash' %}
|
{% fa5_icon 'trash' %}
|
||||||
</button>
|
</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
<th scope="col">
|
<th scope="col">
|
||||||
{% trans 'Created' %}
|
{% trans 'Created' %}
|
||||||
</th>
|
</th>
|
||||||
<th class="w-10" scope="col">
|
<th scope="col">
|
||||||
<span class="float-right">
|
<span class="float-right">
|
||||||
{% trans 'Action' %}
|
{% trans 'Action' %}
|
||||||
</span>
|
</span>
|
||||||
|
@ -27,13 +27,10 @@
|
|||||||
<th scope="col">
|
<th scope="col">
|
||||||
{% trans 'Title' %}
|
{% trans 'Title' %}
|
||||||
</th>
|
</th>
|
||||||
<th scope="col">
|
|
||||||
{% trans 'Created on' %}
|
|
||||||
</th>
|
|
||||||
<th scope="col">
|
<th scope="col">
|
||||||
{% trans 'Comment' %}
|
{% trans 'Comment' %}
|
||||||
</th>
|
</th>
|
||||||
<th class="w-10" scope="col">
|
<th scope="col">
|
||||||
<span class="float-right">
|
<span class="float-right">
|
||||||
{% trans 'Action' %}
|
{% trans 'Action' %}
|
||||||
</span>
|
</span>
|
||||||
@ -44,24 +41,18 @@
|
|||||||
{% for doc in obj.documents.all %}
|
{% for doc in obj.documents.all %}
|
||||||
<tr>
|
<tr>
|
||||||
<td class="align-middle">
|
<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 }}
|
{{ doc.title }}
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td class="align-middle">
|
|
||||||
{{ doc.date_of_creation }}
|
|
||||||
</td>
|
|
||||||
<td class="align-middle">
|
<td class="align-middle">
|
||||||
<div class="scroll-150">
|
<div class="scroll-150">
|
||||||
{{ doc.comment }}
|
{{ doc.comment }}
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td class="align-middle float-right">
|
<td class="align-middle">
|
||||||
{% if is_default_member and has_access %}
|
{% 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' %}">
|
<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 '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' %}">
|
|
||||||
{% fa5_icon 'trash' %}
|
{% fa5_icon 'trash' %}
|
||||||
</button>
|
</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
{% trans 'Surface' %}
|
{% trans 'Surface' %}
|
||||||
</th>
|
</th>
|
||||||
{% if is_default_member and has_access %}
|
{% if is_default_member and has_access %}
|
||||||
<th class="w-10" scope="col">
|
<th scope="col">
|
||||||
<span class="float-right">
|
<span class="float-right">
|
||||||
{% trans 'Action' %}
|
{% trans 'Action' %}
|
||||||
</span>
|
</span>
|
||||||
@ -57,12 +57,9 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td>{{ state.surface|floatformat:2 }} m²</td>
|
<td>{{ state.surface|floatformat:2 }} m²</td>
|
||||||
<td class="align-middle float-right">
|
<td>
|
||||||
{% if is_default_member and has_access %}
|
{% 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' %}">
|
<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 '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' %}">
|
|
||||||
{% fa5_icon 'trash' %}
|
{% fa5_icon 'trash' %}
|
||||||
</button>
|
</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
{% trans 'Surface' %}
|
{% trans 'Surface' %}
|
||||||
</th>
|
</th>
|
||||||
{% if is_default_member and has_access %}
|
{% if is_default_member and has_access %}
|
||||||
<th class="w-10" scope="col">
|
<th scope="col">
|
||||||
<span class="float-right">
|
<span class="float-right">
|
||||||
{% trans 'Action' %}
|
{% trans 'Action' %}
|
||||||
</span>
|
</span>
|
||||||
@ -57,12 +57,9 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td>{{ state.surface|floatformat:2 }} m²</td>
|
<td>{{ state.surface|floatformat:2 }} m²</td>
|
||||||
<td class="align-middle float-right">
|
<td>
|
||||||
{% if is_default_member and has_access %}
|
{% 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' %}">
|
<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 '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' %}">
|
|
||||||
{% fa5_icon 'trash' %}
|
{% fa5_icon 'trash' %}
|
||||||
</button>
|
</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -8,7 +8,6 @@ Created on: 07.02.22
|
|||||||
from django.test.client import Client
|
from django.test.client import Client
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
|
|
||||||
from konova.models import Deadline, DeadlineType
|
|
||||||
from konova.settings import DEFAULT_GROUP
|
from konova.settings import DEFAULT_GROUP
|
||||||
from konova.tests.test_views import BaseViewTestCase
|
from konova.tests.test_views import BaseViewTestCase
|
||||||
|
|
||||||
@ -32,13 +31,6 @@ class CompensationViewTestCase(BaseViewTestCase):
|
|||||||
action = self.create_dummy_action()
|
action = self.create_dummy_action()
|
||||||
self.compensation.actions.set([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
|
# Prepare urls
|
||||||
self.index_url = reverse("compensation:index", args=())
|
self.index_url = reverse("compensation:index", args=())
|
||||||
self.new_url = reverse("compensation:new", args=(self.intervention.id,))
|
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.state_new_url = reverse("compensation:new-state", args=(self.compensation.id,))
|
||||||
self.action_new_url = reverse("compensation:new-action", 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_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.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,))
|
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.state_new_url,
|
||||||
self.action_new_url,
|
self.action_new_url,
|
||||||
self.deadline_new_url,
|
self.deadline_new_url,
|
||||||
self.deadline_edit_url,
|
|
||||||
self.deadline_remove_url,
|
|
||||||
self.state_remove_url,
|
self.state_remove_url,
|
||||||
self.action_remove_url,
|
self.action_remove_url,
|
||||||
self.new_doc_url,
|
self.new_doc_url,
|
||||||
@ -121,8 +109,6 @@ class CompensationViewTestCase(BaseViewTestCase):
|
|||||||
self.state_new_url,
|
self.state_new_url,
|
||||||
self.action_new_url,
|
self.action_new_url,
|
||||||
self.deadline_new_url,
|
self.deadline_new_url,
|
||||||
self.deadline_edit_url,
|
|
||||||
self.deadline_remove_url,
|
|
||||||
self.state_remove_url,
|
self.state_remove_url,
|
||||||
self.action_remove_url,
|
self.action_remove_url,
|
||||||
self.new_doc_url,
|
self.new_doc_url,
|
||||||
@ -161,8 +147,6 @@ class CompensationViewTestCase(BaseViewTestCase):
|
|||||||
self.state_new_url,
|
self.state_new_url,
|
||||||
self.action_new_url,
|
self.action_new_url,
|
||||||
self.deadline_new_url,
|
self.deadline_new_url,
|
||||||
self.deadline_edit_url,
|
|
||||||
self.deadline_remove_url,
|
|
||||||
self.state_remove_url,
|
self.state_remove_url,
|
||||||
self.action_remove_url,
|
self.action_remove_url,
|
||||||
self.new_doc_url,
|
self.new_doc_url,
|
||||||
@ -197,8 +181,6 @@ class CompensationViewTestCase(BaseViewTestCase):
|
|||||||
self.state_new_url,
|
self.state_new_url,
|
||||||
self.action_new_url,
|
self.action_new_url,
|
||||||
self.deadline_new_url,
|
self.deadline_new_url,
|
||||||
self.deadline_edit_url,
|
|
||||||
self.deadline_remove_url,
|
|
||||||
self.state_remove_url,
|
self.state_remove_url,
|
||||||
self.action_remove_url,
|
self.action_remove_url,
|
||||||
self.new_doc_url,
|
self.new_doc_url,
|
||||||
@ -235,8 +217,6 @@ class CompensationViewTestCase(BaseViewTestCase):
|
|||||||
self.state_new_url,
|
self.state_new_url,
|
||||||
self.action_new_url,
|
self.action_new_url,
|
||||||
self.deadline_new_url,
|
self.deadline_new_url,
|
||||||
self.deadline_edit_url,
|
|
||||||
self.deadline_remove_url,
|
|
||||||
self.state_remove_url,
|
self.state_remove_url,
|
||||||
self.action_remove_url,
|
self.action_remove_url,
|
||||||
self.new_doc_url,
|
self.new_doc_url,
|
||||||
|
@ -9,7 +9,6 @@ from django.urls import reverse
|
|||||||
from django.test import Client
|
from django.test import Client
|
||||||
|
|
||||||
from compensation.tests.compensation.test_views import CompensationViewTestCase
|
from compensation.tests.compensation.test_views import CompensationViewTestCase
|
||||||
from konova.models import DeadlineType, Deadline
|
|
||||||
from konova.settings import DEFAULT_GROUP
|
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.edit_url = reverse("compensation:acc:edit", args=(self.eco_account.id,))
|
||||||
self.remove_url = reverse("compensation:acc:remove", 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.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_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_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_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.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):
|
def test_logged_in_no_groups_shared(self):
|
||||||
""" Check correct status code for all requests
|
""" Check correct status code for all requests
|
||||||
@ -94,14 +78,10 @@ class EcoAccountViewTestCase(CompensationViewTestCase):
|
|||||||
self.edit_url,
|
self.edit_url,
|
||||||
self.remove_url,
|
self.remove_url,
|
||||||
self.state_new_url,
|
self.state_new_url,
|
||||||
self.state_edit_url,
|
|
||||||
self.state_remove_url,
|
|
||||||
self.action_new_url,
|
self.action_new_url,
|
||||||
self.action_edit_url,
|
|
||||||
self.action_remove_url,
|
|
||||||
self.deadline_new_url,
|
self.deadline_new_url,
|
||||||
self.deadline_edit_url,
|
self.state_remove_url,
|
||||||
self.deadline_remove_url,
|
self.action_remove_url,
|
||||||
self.new_doc_url,
|
self.new_doc_url,
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -135,14 +115,10 @@ class EcoAccountViewTestCase(CompensationViewTestCase):
|
|||||||
self.edit_url,
|
self.edit_url,
|
||||||
self.remove_url,
|
self.remove_url,
|
||||||
self.state_new_url,
|
self.state_new_url,
|
||||||
self.state_edit_url,
|
|
||||||
self.state_remove_url,
|
|
||||||
self.action_new_url,
|
self.action_new_url,
|
||||||
self.action_edit_url,
|
|
||||||
self.action_remove_url,
|
|
||||||
self.deadline_new_url,
|
self.deadline_new_url,
|
||||||
self.deadline_edit_url,
|
self.state_remove_url,
|
||||||
self.deadline_remove_url,
|
self.action_remove_url,
|
||||||
self.new_doc_url,
|
self.new_doc_url,
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -173,15 +149,11 @@ class EcoAccountViewTestCase(CompensationViewTestCase):
|
|||||||
self.new_id_url,
|
self.new_id_url,
|
||||||
self.edit_url,
|
self.edit_url,
|
||||||
self.state_new_url,
|
self.state_new_url,
|
||||||
self.state_edit_url,
|
|
||||||
self.state_remove_url,
|
|
||||||
self.action_new_url,
|
self.action_new_url,
|
||||||
self.action_edit_url,
|
self.deadline_new_url,
|
||||||
|
self.state_remove_url,
|
||||||
self.action_remove_url,
|
self.action_remove_url,
|
||||||
self.new_doc_url,
|
self.new_doc_url,
|
||||||
self.deadline_new_url,
|
|
||||||
self.deadline_edit_url,
|
|
||||||
self.deadline_remove_url,
|
|
||||||
self.log_url,
|
self.log_url,
|
||||||
self.remove_url,
|
self.remove_url,
|
||||||
]
|
]
|
||||||
@ -212,17 +184,13 @@ class EcoAccountViewTestCase(CompensationViewTestCase):
|
|||||||
fail_urls = [
|
fail_urls = [
|
||||||
self.edit_url,
|
self.edit_url,
|
||||||
self.state_new_url,
|
self.state_new_url,
|
||||||
self.state_edit_url,
|
|
||||||
self.state_remove_url,
|
|
||||||
self.action_new_url,
|
self.action_new_url,
|
||||||
self.action_edit_url,
|
self.deadline_new_url,
|
||||||
|
self.state_remove_url,
|
||||||
self.action_remove_url,
|
self.action_remove_url,
|
||||||
self.new_doc_url,
|
self.new_doc_url,
|
||||||
self.log_url,
|
self.log_url,
|
||||||
self.remove_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_fail(client, fail_urls)
|
||||||
self.assert_url_success(client, success_urls)
|
self.assert_url_success(client, success_urls)
|
||||||
|
@ -18,24 +18,17 @@ urlpatterns = [
|
|||||||
path('<id>/log', log_view, name='log'),
|
path('<id>/log', log_view, name='log'),
|
||||||
path('<id>/edit', edit_view, name='edit'),
|
path('<id>/edit', edit_view, name='edit'),
|
||||||
path('<id>/remove', remove_view, name='remove'),
|
path('<id>/remove', remove_view, name='remove'),
|
||||||
|
|
||||||
path('<id>/state/new', state_new_view, name='new-state'),
|
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/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>/action/<action_id>/remove', action_remove_view, name='action-remove'),
|
||||||
|
|
||||||
path('<id>/deadline/new', deadline_new_view, name="new-deadline"),
|
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/<deadline_id>/remove', deadline_remove_view, name='deadline-remove'),
|
||||||
path('<id>/report', report_view, name='report'),
|
path('<id>/report', report_view, name='report'),
|
||||||
|
|
||||||
# Documents
|
# Documents
|
||||||
path('<id>/document/new/', new_document_view, name='new-doc'),
|
path('<id>/document/new/', new_document_view, name='new-doc'),
|
||||||
path('<id>/document/<doc_id>', get_document_view, name='get-doc'),
|
path('document/<doc_id>', get_document_view, name='get-doc'),
|
||||||
path('<id>/document/<doc_id>/remove/', remove_document_view, name='remove-doc'),
|
path('document/<doc_id>/remove/', remove_document_view, name='remove-doc'),
|
||||||
path('<id>/document/<doc_id>/edit/', edit_document_view, name='edit-doc'),
|
|
||||||
|
|
||||||
]
|
]
|
@ -19,27 +19,19 @@ urlpatterns = [
|
|||||||
path('<id>/report', report_view, name='report'),
|
path('<id>/report', report_view, name='report'),
|
||||||
path('<id>/edit', edit_view, name='edit'),
|
path('<id>/edit', edit_view, name='edit'),
|
||||||
path('<id>/remove', remove_view, name='remove'),
|
path('<id>/remove', remove_view, name='remove'),
|
||||||
|
|
||||||
path('<id>/state/new', state_new_view, name='new-state'),
|
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/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>/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/<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/<token>', share_view, name='share'),
|
||||||
path('<id>/share', create_share_view, name='share-create'),
|
path('<id>/share', create_share_view, name='share-create'),
|
||||||
|
|
||||||
# Documents
|
# Documents
|
||||||
path('<id>/document/new/', new_document_view, name='new-doc'),
|
path('<id>/document/new/', new_document_view, name='new-doc'),
|
||||||
path('<id>/document/<doc_id>', get_document_view, name='get-doc'),
|
path('document/<doc_id>', get_document_view, name='get-doc'),
|
||||||
path('<id>/document/<doc_id>/edit', edit_document_view, name='edit-doc'),
|
path('document/<doc_id>/remove/', remove_document_view, name='remove-doc'),
|
||||||
path('<id>/document/<doc_id>/remove/', remove_document_view, name='remove-doc'),
|
|
||||||
|
|
||||||
# Eco-account deductions
|
# Eco-account deductions
|
||||||
path('<id>/deduction/<deduction_id>/remove', deduction_remove_view, name='remove-deduction'),
|
path('<id>/deduction/<deduction_id>/remove', deduction_remove_view, name='remove-deduction'),
|
||||||
|
@ -6,14 +6,13 @@ from django.utils.translation import gettext_lazy as _
|
|||||||
|
|
||||||
from compensation.forms.forms import NewCompensationForm, EditCompensationForm
|
from compensation.forms.forms import NewCompensationForm, EditCompensationForm
|
||||||
from compensation.forms.modalForms import NewStateModalForm, NewDeadlineModalForm, NewActionModalForm, \
|
from compensation.forms.modalForms import NewStateModalForm, NewDeadlineModalForm, NewActionModalForm, \
|
||||||
NewCompensationDocumentModalForm, RemoveCompensationActionModalForm, RemoveCompensationStateModalForm, \
|
NewCompensationDocumentForm, RemoveCompensationActionModalForm, RemoveCompensationStateModalForm
|
||||||
EditCompensationStateModalForm, EditCompensationActionModalForm, EditDeadlineModalForm
|
|
||||||
from compensation.models import Compensation, CompensationState, CompensationAction, CompensationDocument
|
from compensation.models import Compensation, CompensationState, CompensationAction, CompensationDocument
|
||||||
from compensation.tables import CompensationTable
|
from compensation.tables import CompensationTable
|
||||||
from intervention.models import Intervention
|
from intervention.models import Intervention
|
||||||
from konova.contexts import BaseContext
|
from konova.contexts import BaseContext
|
||||||
from konova.decorators import *
|
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.models import Deadline
|
||||||
from konova.sub_settings.context_settings import TAB_TITLE_IDENTIFIER
|
from konova.sub_settings.context_settings import TAB_TITLE_IDENTIFIER
|
||||||
from konova.utils.documents import get_document, remove_document
|
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, \
|
from konova.utils.message_templates import FORM_INVALID, IDENTIFIER_REPLACED, DATA_UNSHARED_EXPLANATION, \
|
||||||
CHECKED_RECORDED_RESET, COMPENSATION_ADDED_TEMPLATE, COMPENSATION_REMOVED_TEMPLATE, DOCUMENT_ADDED, \
|
CHECKED_RECORDED_RESET, COMPENSATION_ADDED_TEMPLATE, COMPENSATION_REMOVED_TEMPLATE, DOCUMENT_ADDED, \
|
||||||
COMPENSATION_STATE_REMOVED, COMPENSATION_STATE_ADDED, COMPENSATION_ACTION_REMOVED, COMPENSATION_ACTION_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_ADDED, DEADLINE_REMOVED
|
||||||
DEADLINE_EDITED
|
|
||||||
from konova.utils.user_checks import in_group
|
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)
|
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(
|
return form.process_request(
|
||||||
request,
|
request,
|
||||||
msg_success=DOCUMENT_ADDED,
|
msg_success=DOCUMENT_ADDED,
|
||||||
@ -288,42 +286,45 @@ def new_document_view(request: HttpRequest, id: str):
|
|||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
@default_group_required
|
@default_group_required
|
||||||
@shared_access_required(Compensation, "id")
|
def get_document_view(request: HttpRequest, doc_id: str):
|
||||||
def get_document_view(request: HttpRequest, id: str, doc_id: str):
|
|
||||||
""" Returns the document as downloadable file
|
""" Returns the document as downloadable file
|
||||||
|
|
||||||
Wraps the generic document fetcher function from konova.utils.
|
Wraps the generic document fetcher function from konova.utils.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
request (HttpRequest): The incoming request
|
request (HttpRequest): The incoming request
|
||||||
id (str): The compensation id
|
|
||||||
doc_id (str): The document id
|
doc_id (str): The document id
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
|
|
||||||
"""
|
"""
|
||||||
comp = get_object_or_404(Compensation, id=id)
|
|
||||||
doc = get_object_or_404(CompensationDocument, id=doc_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)
|
return get_document(doc)
|
||||||
|
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
@default_group_required
|
@default_group_required
|
||||||
@shared_access_required(Compensation, "id")
|
def remove_document_view(request: HttpRequest, doc_id: str):
|
||||||
def remove_document_view(request: HttpRequest, id: str, doc_id: str):
|
|
||||||
""" Removes the document from the database and file system
|
""" Removes the document from the database and file system
|
||||||
|
|
||||||
Wraps the generic functionality from konova.utils.
|
Wraps the generic functionality from konova.utils.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
request (HttpRequest): The incoming request
|
request (HttpRequest): The incoming request
|
||||||
id (str): The compensation id
|
|
||||||
doc_id (str): The document id
|
doc_id (str): The document id
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
|
|
||||||
"""
|
"""
|
||||||
comp = get_object_or_404(Compensation, id=id)
|
|
||||||
doc = get_object_or_404(CompensationDocument, id=doc_id)
|
doc = get_object_or_404(CompensationDocument, id=doc_id)
|
||||||
return remove_document(
|
return remove_document(
|
||||||
request,
|
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
|
@login_required
|
||||||
@default_group_required
|
@default_group_required
|
||||||
@shared_access_required(Compensation, "id")
|
@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
|
@login_required
|
||||||
@default_group_required
|
@default_group_required
|
||||||
@shared_access_required(Compensation, "id")
|
@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
|
@login_required
|
||||||
@default_group_required
|
@default_group_required
|
||||||
@shared_access_required(Compensation, "id")
|
@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
|
@login_required
|
||||||
@default_group_required
|
@default_group_required
|
||||||
@shared_access_required(Compensation, "id")
|
@shared_access_required(Compensation, "id")
|
||||||
|
@ -16,8 +16,7 @@ from django.shortcuts import render, get_object_or_404, redirect
|
|||||||
|
|
||||||
from compensation.forms.forms import NewEcoAccountForm, EditEcoAccountForm
|
from compensation.forms.forms import NewEcoAccountForm, EditEcoAccountForm
|
||||||
from compensation.forms.modalForms import NewStateModalForm, NewActionModalForm, NewDeadlineModalForm, \
|
from compensation.forms.modalForms import NewStateModalForm, NewActionModalForm, NewDeadlineModalForm, \
|
||||||
NewEcoAccountDocumentModalForm, RemoveCompensationActionModalForm, RemoveCompensationStateModalForm, \
|
NewEcoAccountDocumentForm, RemoveCompensationActionModalForm, RemoveCompensationStateModalForm
|
||||||
EditCompensationStateModalForm, EditCompensationActionModalForm, EditDeadlineModalForm
|
|
||||||
from compensation.models import EcoAccount, EcoAccountDocument, CompensationState, CompensationAction
|
from compensation.models import EcoAccount, EcoAccountDocument, CompensationState, CompensationAction
|
||||||
from compensation.tables import EcoAccountTable
|
from compensation.tables import EcoAccountTable
|
||||||
from intervention.forms.modalForms import NewDeductionModalForm, ShareModalForm, RemoveEcoAccountDeductionModalForm, \
|
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.contexts import BaseContext
|
||||||
from konova.decorators import any_group_check, default_group_required, conservation_office_group_required, \
|
from konova.decorators import any_group_check, default_group_required, conservation_office_group_required, \
|
||||||
shared_access_required
|
shared_access_required
|
||||||
from konova.forms import RemoveModalForm, SimpleGeomForm, NewDocumentModalForm, RecordModalForm, \
|
from konova.forms import RemoveModalForm, SimpleGeomForm, NewDocumentForm, RecordModalForm, RemoveDeadlineModalForm
|
||||||
RemoveDeadlineModalForm, EditDocumentModalForm
|
|
||||||
from konova.models import Deadline
|
from konova.models import Deadline
|
||||||
from konova.settings import DEFAULT_GROUP, ZB_GROUP, ETS_GROUP
|
from konova.settings import DEFAULT_GROUP, ZB_GROUP, ETS_GROUP
|
||||||
from konova.sub_settings.context_settings import TAB_TITLE_IDENTIFIER
|
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, \
|
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, \
|
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, \
|
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
|
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
|
@login_required
|
||||||
@default_group_required
|
@default_group_required
|
||||||
@shared_access_required(EcoAccount, "id")
|
@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
|
@login_required
|
||||||
@default_group_required
|
@default_group_required
|
||||||
@shared_access_required(EcoAccount, "id")
|
@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)
|
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(
|
return form.process_request(
|
||||||
request,
|
request,
|
||||||
msg_success=DOCUMENT_ADDED,
|
msg_success=DOCUMENT_ADDED,
|
||||||
@ -608,68 +534,46 @@ def new_document_view(request: HttpRequest, id: str):
|
|||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
@default_group_required
|
@default_group_required
|
||||||
@shared_access_required(EcoAccount, "id")
|
def get_document_view(request: HttpRequest, doc_id: str):
|
||||||
def get_document_view(request: HttpRequest, id:str, doc_id: str):
|
|
||||||
""" Returns the document as downloadable file
|
""" Returns the document as downloadable file
|
||||||
|
|
||||||
Wraps the generic document fetcher function from konova.utils.
|
Wraps the generic document fetcher function from konova.utils.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
request (HttpRequest): The incoming request
|
request (HttpRequest): The incoming request
|
||||||
id (str): The account id
|
|
||||||
doc_id (str): The document id
|
doc_id (str): The document id
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
|
|
||||||
"""
|
"""
|
||||||
acc = get_object_or_404(EcoAccount, id=id)
|
|
||||||
doc = get_object_or_404(EcoAccountDocument, id=doc_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)
|
return get_document(doc)
|
||||||
|
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
@default_group_required
|
@default_group_required
|
||||||
@shared_access_required(EcoAccount, "id")
|
@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
|
""" Removes the document from the database and file system
|
||||||
|
|
||||||
Wraps the generic functionality from konova.utils.
|
Wraps the generic functionality from konova.utils.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
request (HttpRequest): The incoming request
|
request (HttpRequest): The incoming request
|
||||||
id (str): The account id
|
|
||||||
doc_id (str): The document id
|
doc_id (str): The document id
|
||||||
|
|
||||||
Returns:
|
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)
|
doc = get_object_or_404(EcoAccountDocument, id=doc_id)
|
||||||
return remove_document(
|
return remove_document(
|
||||||
request,
|
request,
|
||||||
|
@ -15,7 +15,7 @@ from django.utils.translation import gettext_lazy as _
|
|||||||
from compensation.forms.forms import AbstractCompensationForm, CompensationResponsibleFormMixin
|
from compensation.forms.forms import AbstractCompensationForm, CompensationResponsibleFormMixin
|
||||||
from ema.models import Ema, EmaDocument
|
from ema.models import Ema, EmaDocument
|
||||||
from intervention.models import Responsibility
|
from intervention.models import Responsibility
|
||||||
from konova.forms import SimpleGeomForm, NewDocumentModalForm
|
from konova.forms import SimpleGeomForm, NewDocumentForm
|
||||||
from user.models import UserActionLogEntry
|
from user.models import UserActionLogEntry
|
||||||
|
|
||||||
|
|
||||||
@ -150,5 +150,5 @@ class EditEmaForm(NewEmaForm):
|
|||||||
return self.instance
|
return self.instance
|
||||||
|
|
||||||
|
|
||||||
class NewEmaDocumentModalForm(NewDocumentModalForm):
|
class NewEmaDocumentForm(NewDocumentForm):
|
||||||
document_model = EmaDocument
|
document_model = EmaDocument
|
@ -33,7 +33,7 @@
|
|||||||
<th scope="col">
|
<th scope="col">
|
||||||
{% trans 'Comment' %}
|
{% trans 'Comment' %}
|
||||||
</th>
|
</th>
|
||||||
<th class="w-10" scope="col">
|
<th scope="col">
|
||||||
<span class="float-right">
|
<span class="float-right">
|
||||||
{% trans 'Action' %}
|
{% trans 'Action' %}
|
||||||
</span>
|
</span>
|
||||||
@ -58,12 +58,9 @@
|
|||||||
{{ action.comment }}
|
{{ action.comment }}
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td class="align-middle float-right">
|
<td class="">
|
||||||
{% if is_default_member and has_access %}
|
{% 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' %}">
|
<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 'edit' %}
|
|
||||||
</button>
|
|
||||||
<button data-form-url="{% url 'ema:action-remove' obj.id action.id %}" class="btn btn-default btn-modal" title="{% trans 'Remove action' %}">
|
|
||||||
{% fa5_icon 'trash' %}
|
{% fa5_icon 'trash' %}
|
||||||
</button>
|
</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
<th scope="col">
|
<th scope="col">
|
||||||
{% trans 'Comment' %}
|
{% trans 'Comment' %}
|
||||||
</th>
|
</th>
|
||||||
<th class="w-10" scope="col">
|
<th scope="col">
|
||||||
<span class="float-right">
|
<span class="float-right">
|
||||||
{% trans 'Action' %}
|
{% trans 'Action' %}
|
||||||
</span>
|
</span>
|
||||||
@ -52,12 +52,9 @@
|
|||||||
{{ deadline.comment }}
|
{{ deadline.comment }}
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td class="align-middle float-right">
|
<td class="align-middle">
|
||||||
{% if is_default_member and has_access %}
|
{% 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' %}">
|
<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 'edit' %}
|
|
||||||
</button>
|
|
||||||
<button data-form-url="{% url 'ema:deadline-remove' obj.id deadline.id %}" class="btn btn-default btn-modal" title="{% trans 'Remove deadline' %}">
|
|
||||||
{% fa5_icon 'trash' %}
|
{% fa5_icon 'trash' %}
|
||||||
</button>
|
</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -27,13 +27,10 @@
|
|||||||
<th scope="col">
|
<th scope="col">
|
||||||
{% trans 'Title' %}
|
{% trans 'Title' %}
|
||||||
</th>
|
</th>
|
||||||
<th scope="col">
|
|
||||||
{% trans 'Created on' %}
|
|
||||||
</th>
|
|
||||||
<th scope="col">
|
<th scope="col">
|
||||||
{% trans 'Comment' %}
|
{% trans 'Comment' %}
|
||||||
</th>
|
</th>
|
||||||
<th class="w-10" scope="col">
|
<th scope="col">
|
||||||
<span class="float-right">
|
<span class="float-right">
|
||||||
{% trans 'Action' %}
|
{% trans 'Action' %}
|
||||||
</span>
|
</span>
|
||||||
@ -44,24 +41,18 @@
|
|||||||
{% for doc in obj.documents.all %}
|
{% for doc in obj.documents.all %}
|
||||||
<tr>
|
<tr>
|
||||||
<td class="align-middle">
|
<td class="align-middle">
|
||||||
<a href="{% url 'ema:get-doc' obj.id doc.id %}">
|
<a href="{% url 'ema:get-doc' doc.id %}">
|
||||||
{{ doc.title }}
|
{{ doc.title }}
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td class="align-middle">
|
|
||||||
{{ doc.date_of_creation }}
|
|
||||||
</td>
|
|
||||||
<td class="align-middle">
|
<td class="align-middle">
|
||||||
<div class="scroll-150">
|
<div class="scroll-150">
|
||||||
{{ doc.comment }}
|
{{ doc.comment }}
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td class="align-middle float-right">
|
<td class="align-middle">
|
||||||
{% if is_default_member and has_access %}
|
{% 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' %}">
|
<button data-form-url="{% url 'ema:remove-doc' doc.id %}" class="btn btn-default btn-modal float-right" title="{% trans 'Remove 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' %}">
|
|
||||||
{% fa5_icon 'trash' %}
|
{% fa5_icon 'trash' %}
|
||||||
</button>
|
</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
<th scope="col">
|
<th scope="col">
|
||||||
{% trans 'Surface' %}
|
{% trans 'Surface' %}
|
||||||
</th>
|
</th>
|
||||||
<th class="w-10" scope="col">
|
<th scope="col">
|
||||||
<span class="float-right">
|
<span class="float-right">
|
||||||
{% trans 'Action' %}
|
{% trans 'Action' %}
|
||||||
</span>
|
</span>
|
||||||
@ -55,12 +55,9 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td>{{ state.surface|floatformat:2 }} m²</td>
|
<td>{{ state.surface|floatformat:2 }} m²</td>
|
||||||
<td class="align-middle float-right">
|
<td>
|
||||||
{% if is_default_member and has_access %}
|
{% 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' %}">
|
<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 'edit' %}
|
|
||||||
</button>
|
|
||||||
<button data-form-url="{% url 'ema:state-remove' obj.id state.id %}" class="btn btn-default btn-modal" title="{% trans 'Remove state' %}">
|
|
||||||
{% fa5_icon 'trash' %}
|
{% fa5_icon 'trash' %}
|
||||||
</button>
|
</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
<th scope="col">
|
<th scope="col">
|
||||||
{% trans 'Surface' %}
|
{% trans 'Surface' %}
|
||||||
</th>
|
</th>
|
||||||
<th class="w-10" scope="col">
|
<th scope="col">
|
||||||
<span class="float-right">
|
<span class="float-right">
|
||||||
{% trans 'Action' %}
|
{% trans 'Action' %}
|
||||||
</span>
|
</span>
|
||||||
@ -55,12 +55,9 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td>{{ state.surface|floatformat:2 }} m²</td>
|
<td>{{ state.surface|floatformat:2 }} m²</td>
|
||||||
<td class="align-middle float-right">
|
<td>
|
||||||
{% if is_default_member and has_access %}
|
{% 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' %}">
|
<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 'edit' %}
|
|
||||||
</button>
|
|
||||||
<button data-form-url="{% url 'ema:state-remove' obj.id state.id %}" class="btn btn-default btn-modal" title="{% trans 'Remove state' %}">
|
|
||||||
{% fa5_icon 'trash' %}
|
{% fa5_icon 'trash' %}
|
||||||
</button>
|
</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -13,7 +13,7 @@ from django.test.client import Client
|
|||||||
from compensation.tests.compensation.test_views import CompensationViewTestCase
|
from compensation.tests.compensation.test_views import CompensationViewTestCase
|
||||||
from ema.models import Ema
|
from ema.models import Ema
|
||||||
from intervention.models import Responsibility
|
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 konova.settings import DEFAULT_GROUP, ETS_GROUP
|
||||||
from user.models import UserActionLogEntry
|
from user.models import UserActionLogEntry
|
||||||
|
|
||||||
@ -54,25 +54,11 @@ class EmaViewTestCase(CompensationViewTestCase):
|
|||||||
self.record_url = reverse("ema:record", args=(self.ema.id,))
|
self.record_url = reverse("ema:record", args=(self.ema.id,))
|
||||||
self.report_url = reverse("ema:report", 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.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_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_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_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.state_remove_url = reverse("ema:state-remove", args=(self.ema.id, state.id,))
|
||||||
self.deadline_remove_url = reverse("ema:deadline-remove", args=(self.ema.id, self.deadline.id))
|
self.action_remove_url = reverse("ema:action-remove", args=(self.ema.id, action.id,))
|
||||||
|
|
||||||
def create_dummy_data(self):
|
def create_dummy_data(self):
|
||||||
# Create dummy data
|
# Create dummy data
|
||||||
@ -122,14 +108,10 @@ class EmaViewTestCase(CompensationViewTestCase):
|
|||||||
self.new_id_url,
|
self.new_id_url,
|
||||||
self.edit_url,
|
self.edit_url,
|
||||||
self.state_new_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.action_new_url,
|
||||||
|
self.deadline_new_url,
|
||||||
|
self.state_remove_url,
|
||||||
|
self.action_remove_url,
|
||||||
self.new_doc_url,
|
self.new_doc_url,
|
||||||
self.log_url,
|
self.log_url,
|
||||||
self.remove_url,
|
self.remove_url,
|
||||||
@ -172,14 +154,10 @@ class EmaViewTestCase(CompensationViewTestCase):
|
|||||||
self.new_id_url,
|
self.new_id_url,
|
||||||
self.edit_url,
|
self.edit_url,
|
||||||
self.state_new_url,
|
self.state_new_url,
|
||||||
self.state_edit_url,
|
|
||||||
self.state_remove_url,
|
|
||||||
self.action_new_url,
|
self.action_new_url,
|
||||||
self.action_edit_url,
|
|
||||||
self.action_remove_url,
|
|
||||||
self.deadline_new_url,
|
self.deadline_new_url,
|
||||||
self.deadline_edit_url,
|
self.state_remove_url,
|
||||||
self.deadline_remove_url,
|
self.action_remove_url,
|
||||||
self.new_doc_url,
|
self.new_doc_url,
|
||||||
self.log_url,
|
self.log_url,
|
||||||
self.remove_url,
|
self.remove_url,
|
||||||
@ -213,13 +191,9 @@ class EmaViewTestCase(CompensationViewTestCase):
|
|||||||
self.new_id_url,
|
self.new_id_url,
|
||||||
self.edit_url,
|
self.edit_url,
|
||||||
self.state_new_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_new_url,
|
||||||
self.action_edit_url,
|
self.deadline_new_url,
|
||||||
|
self.state_remove_url,
|
||||||
self.action_remove_url,
|
self.action_remove_url,
|
||||||
self.new_doc_url,
|
self.new_doc_url,
|
||||||
self.log_url,
|
self.log_url,
|
||||||
@ -255,13 +229,9 @@ class EmaViewTestCase(CompensationViewTestCase):
|
|||||||
fail_urls = [
|
fail_urls = [
|
||||||
self.edit_url,
|
self.edit_url,
|
||||||
self.state_new_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_new_url,
|
||||||
self.action_edit_url,
|
self.deadline_new_url,
|
||||||
|
self.state_remove_url,
|
||||||
self.action_remove_url,
|
self.action_remove_url,
|
||||||
self.new_doc_url,
|
self.new_doc_url,
|
||||||
self.log_url,
|
self.log_url,
|
||||||
|
16
ema/urls.py
16
ema/urls.py
@ -19,26 +19,18 @@ urlpatterns = [
|
|||||||
path('<id>/remove', remove_view, name='remove'),
|
path('<id>/remove', remove_view, name='remove'),
|
||||||
path('<id>/record', record_view, name='record'),
|
path('<id>/record', record_view, name='record'),
|
||||||
path('<id>/report', report_view, name='report'),
|
path('<id>/report', report_view, name='report'),
|
||||||
|
|
||||||
path('<id>/state/new', state_new_view, name='new-state'),
|
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/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>/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/<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/<token>', share_view, name='share'),
|
||||||
path('<id>/share', create_share_view, name='share-create'),
|
path('<id>/share', create_share_view, name='share-create'),
|
||||||
|
|
||||||
# Documents
|
# Documents
|
||||||
path('<id>/document/new/', document_new_view, name='new-doc'),
|
path('<id>/document/new/', document_new_view, name='new-doc'),
|
||||||
path('<id>/document/<doc_id>', get_document_view, name='get-doc'),
|
path('document/<doc_id>', get_document_view, name='get-doc'),
|
||||||
path('<id>/document/<doc_id>/edit/', edit_document_view, name='edit-doc'),
|
path('document/<doc_id>/remove/', remove_document_view, name='remove-doc'),
|
||||||
path('<id>/document/<doc_id>/remove/', remove_document_view, name='remove-doc'),
|
|
||||||
|
|
||||||
]
|
]
|
130
ema/views.py
130
ema/views.py
@ -7,17 +7,15 @@ from django.urls import reverse
|
|||||||
from django.utils.translation import gettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
from compensation.forms.modalForms import NewStateModalForm, NewActionModalForm, NewDeadlineModalForm, \
|
from compensation.forms.modalForms import NewStateModalForm, NewActionModalForm, NewDeadlineModalForm, \
|
||||||
RemoveCompensationActionModalForm, RemoveCompensationStateModalForm, EditCompensationStateModalForm, \
|
RemoveCompensationActionModalForm, RemoveCompensationStateModalForm
|
||||||
EditCompensationActionModalForm, EditDeadlineModalForm
|
|
||||||
from compensation.models import CompensationAction, CompensationState
|
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 ema.tables import EmaTable
|
||||||
from intervention.forms.modalForms import ShareModalForm
|
from intervention.forms.modalForms import ShareModalForm
|
||||||
from konova.contexts import BaseContext
|
from konova.contexts import BaseContext
|
||||||
from konova.decorators import conservation_office_group_required, shared_access_required
|
from konova.decorators import conservation_office_group_required, shared_access_required
|
||||||
from ema.models import Ema, EmaDocument
|
from ema.models import Ema, EmaDocument
|
||||||
from konova.forms import RemoveModalForm, SimpleGeomForm, RecordModalForm, RemoveDeadlineModalForm, \
|
from konova.forms import RemoveModalForm, SimpleGeomForm, RecordModalForm, RemoveDeadlineModalForm
|
||||||
EditDocumentModalForm
|
|
||||||
from konova.models import Deadline
|
from konova.models import Deadline
|
||||||
from konova.settings import DEFAULT_GROUP, ZB_GROUP, ETS_GROUP
|
from konova.settings import DEFAULT_GROUP, ZB_GROUP, ETS_GROUP
|
||||||
from konova.sub_settings.context_settings import TAB_TITLE_IDENTIFIER
|
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.generators import generate_qr_code
|
||||||
from konova.utils.message_templates import IDENTIFIER_REPLACED, FORM_INVALID, DATA_UNSHARED, DATA_UNSHARED_EXPLANATION, \
|
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, \
|
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_ADDED, DEADLINE_ADDED, DEADLINE_REMOVED
|
||||||
COMPENSATION_ACTION_EDITED, DEADLINE_EDITED
|
|
||||||
from konova.utils.user_checks import in_group
|
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
|
@login_required
|
||||||
@conservation_office_group_required
|
@conservation_office_group_required
|
||||||
@shared_access_required(Ema, "id")
|
@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)
|
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(
|
return form.process_request(
|
||||||
request,
|
request,
|
||||||
msg_success=DOCUMENT_ADDED,
|
msg_success=DOCUMENT_ADDED,
|
||||||
@ -393,68 +366,45 @@ def document_new_view(request: HttpRequest, id: str):
|
|||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
@conservation_office_group_required
|
@conservation_office_group_required
|
||||||
@shared_access_required(Ema, "id")
|
def get_document_view(request: HttpRequest, doc_id: str):
|
||||||
def get_document_view(request: HttpRequest, id: str, doc_id: str):
|
|
||||||
""" Returns the document as downloadable file
|
""" Returns the document as downloadable file
|
||||||
|
|
||||||
Wraps the generic document fetcher function from konova.utils.
|
Wraps the generic document fetcher function from konova.utils.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
request (HttpRequest): The incoming request
|
request (HttpRequest): The incoming request
|
||||||
id (str): The EMA id
|
|
||||||
doc_id (str): The document id
|
doc_id (str): The document id
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
|
|
||||||
"""
|
"""
|
||||||
ema = get_object_or_404(Ema, id=id)
|
|
||||||
doc = get_object_or_404(EmaDocument, id=doc_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)
|
return get_document(doc)
|
||||||
|
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
@conservation_office_group_required
|
@conservation_office_group_required
|
||||||
@shared_access_required(Ema, "id")
|
def remove_document_view(request: HttpRequest, doc_id: str):
|
||||||
def edit_document_view(request: HttpRequest, id: str, doc_id: str):
|
|
||||||
""" Removes the document from the database and file system
|
""" Removes the document from the database and file system
|
||||||
|
|
||||||
Wraps the generic functionality from konova.utils.
|
Wraps the generic functionality from konova.utils.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
request (HttpRequest): The incoming request
|
request (HttpRequest): The incoming request
|
||||||
id (str): The EMA id
|
|
||||||
doc_id (str): The document id
|
doc_id (str): The document id
|
||||||
|
|
||||||
Returns:
|
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)
|
doc = get_object_or_404(EmaDocument, id=doc_id)
|
||||||
return remove_document(
|
return remove_document(
|
||||||
request,
|
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
|
@login_required
|
||||||
@conservation_office_group_required
|
@conservation_office_group_required
|
||||||
@shared_access_required(Ema, "id")
|
@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
|
@login_required
|
||||||
@conservation_office_group_required
|
@conservation_office_group_required
|
||||||
@shared_access_required(Ema, "id")
|
@shared_access_required(Ema, "id")
|
||||||
|
@ -19,7 +19,7 @@ from django.utils.translation import gettext_lazy as _
|
|||||||
from compensation.models import EcoAccount, EcoAccountDeduction
|
from compensation.models import EcoAccount, EcoAccountDeduction
|
||||||
from intervention.inputs import TextToClipboardInput
|
from intervention.inputs import TextToClipboardInput
|
||||||
from intervention.models import Intervention, InterventionDocument, RevocationDocument
|
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.general import format_german_float
|
||||||
from konova.utils.user_checks import is_default_group_only
|
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
|
"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):
|
def save(self):
|
||||||
revocation = self.instance.add_revocation(self)
|
revocation = self.instance.add_revocation(self)
|
||||||
self.instance.mark_as_edited(self.user, self.request, edit_comment=REVOCATION_ADDED)
|
self.instance.mark_as_edited(self.user, self.request, edit_comment=REVOCATION_ADDED)
|
||||||
@ -517,5 +543,5 @@ class RemoveEcoAccountDeductionModalForm(RemoveModalForm):
|
|||||||
self.deduction.delete()
|
self.deduction.delete()
|
||||||
|
|
||||||
|
|
||||||
class NewInterventionDocumentModalForm(NewDocumentModalForm):
|
class NewInterventionDocumentForm(NewDocumentForm):
|
||||||
document_model = InterventionDocument
|
document_model = InterventionDocument
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
{% trans 'Title' %}
|
{% trans 'Title' %}
|
||||||
</th>
|
</th>
|
||||||
{% if is_default_member and has_access %}
|
{% if is_default_member and has_access %}
|
||||||
<th class="w-10" scope="col">
|
<th scope="col">
|
||||||
<span class="float-right">
|
<span class="float-right">
|
||||||
{% trans 'Action' %}
|
{% trans 'Action' %}
|
||||||
</span>
|
</span>
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
{% trans 'Created' %}
|
{% trans 'Created' %}
|
||||||
</th>
|
</th>
|
||||||
{% if is_default_member and has_access %}
|
{% if is_default_member and has_access %}
|
||||||
<th class="w-10" scope="col">
|
<th scope="col">
|
||||||
<span class="float-right">
|
<span class="float-right">
|
||||||
{% trans 'Action' %}
|
{% trans 'Action' %}
|
||||||
</span>
|
</span>
|
||||||
|
@ -27,14 +27,11 @@
|
|||||||
<th scope="col">
|
<th scope="col">
|
||||||
{% trans 'Title' %}
|
{% trans 'Title' %}
|
||||||
</th>
|
</th>
|
||||||
<th scope="col">
|
<th class="w-50" scope="col">
|
||||||
{% trans 'Created on' %}
|
|
||||||
</th>
|
|
||||||
<th scope="col">
|
|
||||||
{% trans 'Comment' %}
|
{% trans 'Comment' %}
|
||||||
</th>
|
</th>
|
||||||
{% if is_default_member and has_access %}
|
{% if is_default_member and has_access %}
|
||||||
<th class="w-10" scope="col">
|
<th scope="col">
|
||||||
<span class="float-right">
|
<span class="float-right">
|
||||||
{% trans 'Action' %}
|
{% trans 'Action' %}
|
||||||
</span>
|
</span>
|
||||||
@ -46,26 +43,18 @@
|
|||||||
{% for doc in obj.documents.all %}
|
{% for doc in obj.documents.all %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<a href="{% url 'intervention:get-doc' obj.id doc.id %}">
|
<a href="{% url 'intervention:get-doc' doc.id %}">
|
||||||
{{ doc.title }}
|
{{ doc.title }}
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
|
||||||
<div class="scroll-150">
|
|
||||||
{{ doc.date_of_creation }}
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
<td>
|
<td>
|
||||||
<div class="scroll-150">
|
<div class="scroll-150">
|
||||||
{{ doc.comment }}
|
{{ doc.comment }}
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td class="align-middle float-right">
|
<td>
|
||||||
{% if is_default_member and has_access %}
|
{% 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' %}">
|
<button data-form-url="{% url 'intervention:remove-doc' doc.id %}" class="btn btn-default btn-modal float-right" title="{% trans 'Remove 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' %}">
|
|
||||||
{% fa5_icon 'trash' %}
|
{% fa5_icon 'trash' %}
|
||||||
</button>
|
</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
{% trans 'Comment' %}
|
{% trans 'Comment' %}
|
||||||
</th>
|
</th>
|
||||||
{% if is_default_member and has_access %}
|
{% if is_default_member and has_access %}
|
||||||
<th class="w-10" scope="col">
|
<th scope="col">
|
||||||
<span class="float-right">
|
<span class="float-right">
|
||||||
{% trans 'Action' %}
|
{% trans 'Action' %}
|
||||||
</span>
|
</span>
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
{% trans 'Comment' %}
|
{% trans 'Comment' %}
|
||||||
</th>
|
</th>
|
||||||
{% if is_default_member and has_access %}
|
{% if is_default_member and has_access %}
|
||||||
<th class="w-10" scope="col">
|
<th scope="col">
|
||||||
<span class="float-right">
|
<span class="float-right">
|
||||||
{% trans 'Action' %}
|
{% trans 'Action' %}
|
||||||
</span>
|
</span>
|
||||||
|
@ -40,14 +40,12 @@ class InterventionViewTestCase(BaseViewTestCase):
|
|||||||
self.deduction.intervention = self.intervention
|
self.deduction.intervention = self.intervention
|
||||||
self.deduction.save()
|
self.deduction.save()
|
||||||
self.deduction_new_url = reverse("intervention:new-deduction", args=(self.intervention.id,))
|
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.deduction_remove_url = reverse("intervention:remove-deduction", args=(self.intervention.id, self.deduction.id))
|
||||||
|
|
||||||
self.revocation = Revocation.objects.create(
|
self.revocation = Revocation.objects.create(
|
||||||
legal=self.intervention.legal
|
legal=self.intervention.legal
|
||||||
)
|
)
|
||||||
self.revocation_new_url = reverse("intervention:new-revocation", args=(self.intervention.id,))
|
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))
|
self.revocation_remove_url = reverse("intervention:remove-revocation", args=(self.intervention.id, self.revocation.id))
|
||||||
|
|
||||||
def test_views_anonymous_user(self):
|
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.run_check_url: f"{login_redirect_base}{self.run_check_url}",
|
||||||
self.record_url: f"{login_redirect_base}{self.record_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_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.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_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}",
|
self.revocation_remove_url: f"{login_redirect_base}{self.revocation_remove_url}",
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -119,10 +115,8 @@ class InterventionViewTestCase(BaseViewTestCase):
|
|||||||
self.run_check_url,
|
self.run_check_url,
|
||||||
self.record_url,
|
self.record_url,
|
||||||
self.revocation_new_url,
|
self.revocation_new_url,
|
||||||
self.revocation_edit_url,
|
|
||||||
self.revocation_remove_url,
|
self.revocation_remove_url,
|
||||||
self.deduction_new_url,
|
self.deduction_new_url,
|
||||||
self.deduction_edit_url,
|
|
||||||
self.deduction_remove_url,
|
self.deduction_remove_url,
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -157,10 +151,8 @@ class InterventionViewTestCase(BaseViewTestCase):
|
|||||||
self.remove_url,
|
self.remove_url,
|
||||||
self.share_create_url,
|
self.share_create_url,
|
||||||
self.revocation_new_url,
|
self.revocation_new_url,
|
||||||
self.revocation_edit_url,
|
|
||||||
self.revocation_remove_url,
|
self.revocation_remove_url,
|
||||||
self.deduction_new_url,
|
self.deduction_new_url,
|
||||||
self.deduction_edit_url,
|
|
||||||
self.deduction_remove_url,
|
self.deduction_remove_url,
|
||||||
]
|
]
|
||||||
fail_urls = [
|
fail_urls = [
|
||||||
@ -207,10 +199,8 @@ class InterventionViewTestCase(BaseViewTestCase):
|
|||||||
self.share_create_url,
|
self.share_create_url,
|
||||||
self.log_url,
|
self.log_url,
|
||||||
self.revocation_new_url,
|
self.revocation_new_url,
|
||||||
self.revocation_edit_url,
|
|
||||||
self.revocation_remove_url,
|
self.revocation_remove_url,
|
||||||
self.deduction_new_url,
|
self.deduction_new_url,
|
||||||
self.deduction_edit_url,
|
|
||||||
self.deduction_remove_url,
|
self.deduction_remove_url,
|
||||||
]
|
]
|
||||||
success_urls_redirect = {
|
success_urls_redirect = {
|
||||||
@ -253,10 +243,8 @@ class InterventionViewTestCase(BaseViewTestCase):
|
|||||||
self.share_create_url,
|
self.share_create_url,
|
||||||
self.record_url,
|
self.record_url,
|
||||||
self.revocation_new_url,
|
self.revocation_new_url,
|
||||||
self.revocation_edit_url,
|
|
||||||
self.revocation_remove_url,
|
self.revocation_remove_url,
|
||||||
self.deduction_new_url,
|
self.deduction_new_url,
|
||||||
self.deduction_edit_url,
|
|
||||||
self.deduction_remove_url,
|
self.deduction_remove_url,
|
||||||
]
|
]
|
||||||
success_urls_redirect = {
|
success_urls_redirect = {
|
||||||
@ -299,10 +287,8 @@ class InterventionViewTestCase(BaseViewTestCase):
|
|||||||
self.record_url,
|
self.record_url,
|
||||||
self.run_check_url,
|
self.run_check_url,
|
||||||
self.revocation_new_url,
|
self.revocation_new_url,
|
||||||
self.revocation_edit_url,
|
|
||||||
self.revocation_remove_url,
|
self.revocation_remove_url,
|
||||||
self.deduction_new_url,
|
self.deduction_new_url,
|
||||||
self.deduction_edit_url,
|
|
||||||
self.deduction_remove_url,
|
self.deduction_remove_url,
|
||||||
]
|
]
|
||||||
success_urls_redirect = {
|
success_urls_redirect = {
|
||||||
@ -345,10 +331,8 @@ class InterventionViewTestCase(BaseViewTestCase):
|
|||||||
self.share_create_url,
|
self.share_create_url,
|
||||||
self.run_check_url,
|
self.run_check_url,
|
||||||
self.revocation_new_url,
|
self.revocation_new_url,
|
||||||
self.revocation_edit_url,
|
|
||||||
self.revocation_remove_url,
|
self.revocation_remove_url,
|
||||||
self.deduction_new_url,
|
self.deduction_new_url,
|
||||||
self.deduction_edit_url,
|
|
||||||
self.deduction_remove_url,
|
self.deduction_remove_url,
|
||||||
]
|
]
|
||||||
success_urls_redirect = {
|
success_urls_redirect = {
|
||||||
@ -391,10 +375,8 @@ class InterventionViewTestCase(BaseViewTestCase):
|
|||||||
self.share_create_url,
|
self.share_create_url,
|
||||||
self.run_check_url,
|
self.run_check_url,
|
||||||
self.revocation_new_url,
|
self.revocation_new_url,
|
||||||
self.revocation_edit_url,
|
|
||||||
self.revocation_remove_url,
|
self.revocation_remove_url,
|
||||||
self.deduction_new_url,
|
self.deduction_new_url,
|
||||||
self.deduction_edit_url,
|
|
||||||
self.deduction_remove_url,
|
self.deduction_remove_url,
|
||||||
]
|
]
|
||||||
# Define urls where a redirect to a specific location is the proper response
|
# Define urls where a redirect to a specific location is the proper response
|
||||||
|
@ -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, \
|
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, \
|
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, \
|
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"
|
app_name = "intervention"
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
@ -32,9 +32,8 @@ urlpatterns = [
|
|||||||
|
|
||||||
# Documents
|
# Documents
|
||||||
path('<id>/document/new/', new_document_view, name='new-doc'),
|
path('<id>/document/new/', new_document_view, name='new-doc'),
|
||||||
path('<id>/document/<doc_id>', get_document_view, name='get-doc'),
|
path('document/<doc_id>', get_document_view, name='get-doc'),
|
||||||
path('<id>/document/<doc_id>/remove/', remove_document_view, name='remove-doc'),
|
path('document/<doc_id>/remove/', remove_document_view, name='remove-doc'),
|
||||||
path('<id>/document/<doc_id>/edit/', edit_document_view, name='edit-doc'),
|
|
||||||
|
|
||||||
# Deductions
|
# Deductions
|
||||||
path('<id>/deduction/new', new_deduction_view, name='new-deduction'),
|
path('<id>/deduction/new', new_deduction_view, name='new-deduction'),
|
||||||
|
@ -6,19 +6,19 @@ from django.shortcuts import render
|
|||||||
|
|
||||||
from intervention.forms.forms import NewInterventionForm, EditInterventionForm
|
from intervention.forms.forms import NewInterventionForm, EditInterventionForm
|
||||||
from intervention.forms.modalForms import ShareModalForm, NewRevocationModalForm, \
|
from intervention.forms.modalForms import ShareModalForm, NewRevocationModalForm, \
|
||||||
CheckModalForm, NewDeductionModalForm, NewInterventionDocumentModalForm, RemoveEcoAccountDeductionModalForm, \
|
CheckModalForm, NewDeductionModalForm, NewInterventionDocumentForm, RemoveEcoAccountDeductionModalForm, \
|
||||||
RemoveRevocationModalForm, EditEcoAccountDeductionModalForm, EditRevocationModalForm
|
RemoveRevocationModalForm, EditEcoAccountDeductionModalForm, EditRevocationModalForm
|
||||||
from intervention.models import Intervention, Revocation, InterventionDocument, RevocationDocument
|
from intervention.models import Intervention, Revocation, InterventionDocument, RevocationDocument
|
||||||
from intervention.tables import InterventionTable
|
from intervention.tables import InterventionTable
|
||||||
from konova.contexts import BaseContext
|
from konova.contexts import BaseContext
|
||||||
from konova.decorators import *
|
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.sub_settings.context_settings import TAB_TITLE_IDENTIFIER
|
||||||
from konova.utils.documents import remove_document, get_document
|
from konova.utils.documents import remove_document, get_document
|
||||||
from konova.utils.generators import generate_qr_code
|
from konova.utils.generators import generate_qr_code
|
||||||
from konova.utils.message_templates import INTERVENTION_INVALID, FORM_INVALID, IDENTIFIER_REPLACED, \
|
from konova.utils.message_templates import INTERVENTION_INVALID, FORM_INVALID, IDENTIFIER_REPLACED, \
|
||||||
CHECKED_RECORDED_RESET, DEDUCTION_REMOVED, DEDUCTION_ADDED, REVOCATION_ADDED, REVOCATION_REMOVED, \
|
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
|
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)
|
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(
|
return form.process_request(
|
||||||
request,
|
request,
|
||||||
msg_success=DOCUMENT_ADDED,
|
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 redirect("intervention:detail", id=doc.instance.id)
|
||||||
return get_document(doc)
|
return get_document(doc)
|
||||||
|
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
@default_group_required
|
@default_group_required
|
||||||
@shared_access_required(Intervention, "id")
|
def get_document_view(request: HttpRequest, doc_id: str):
|
||||||
def get_document_view(request: HttpRequest, id: str, doc_id: str):
|
|
||||||
""" Returns the document as downloadable file
|
""" Returns the document as downloadable file
|
||||||
|
|
||||||
Wraps the generic document fetcher function from konova.utils.
|
Wraps the generic document fetcher function from konova.utils.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
request (HttpRequest): The incoming request
|
request (HttpRequest): The incoming request
|
||||||
id (str): The intervention id
|
|
||||||
doc_id (str): The document id
|
doc_id (str): The document id
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
|
|
||||||
"""
|
"""
|
||||||
intervention = get_object_or_404(Intervention, id=id)
|
|
||||||
doc = get_object_or_404(InterventionDocument, id=doc_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)
|
return get_document(doc)
|
||||||
|
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
@default_group_required
|
@default_group_required
|
||||||
@shared_access_required(Intervention, "id")
|
def remove_document_view(request: HttpRequest, doc_id: str):
|
||||||
def remove_document_view(request: HttpRequest, id: str, doc_id: str):
|
|
||||||
""" Removes the document from the database and file system
|
""" Removes the document from the database and file system
|
||||||
|
|
||||||
Wraps the generic functionality from konova.utils.
|
Wraps the generic functionality from konova.utils.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
request (HttpRequest): The incoming request
|
request (HttpRequest): The incoming request
|
||||||
id (str): The intervention id
|
|
||||||
doc_id (str): The document id
|
doc_id (str): The document id
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
|
|
||||||
"""
|
"""
|
||||||
intervention = get_object_or_404(Intervention, id=id)
|
|
||||||
doc = get_object_or_404(InterventionDocument, id=doc_id)
|
doc = get_object_or_404(InterventionDocument, id=doc_id)
|
||||||
return remove_document(
|
return remove_document(
|
||||||
request,
|
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
|
@login_required
|
||||||
@any_group_check
|
@any_group_check
|
||||||
def detail_view(request: HttpRequest, id: str):
|
def detail_view(request: HttpRequest, id: str):
|
||||||
|
@ -12,8 +12,6 @@ from bootstrap_modal_forms.forms import BSModalForm
|
|||||||
from bootstrap_modal_forms.utils import is_ajax
|
from bootstrap_modal_forms.utils import is_ajax
|
||||||
from django import forms
|
from django import forms
|
||||||
from django.contrib import messages
|
from django.contrib import messages
|
||||||
from django.db.models.fields.files import FieldFile
|
|
||||||
|
|
||||||
from user.models import User
|
from user.models import User
|
||||||
from django.contrib.gis.forms import OSMWidget, MultiPolygonField
|
from django.contrib.gis.forms import OSMWidget, MultiPolygonField
|
||||||
from django.contrib.gis.geos import MultiPolygon
|
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 django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
from konova.contexts import BaseContext
|
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.settings import DEFAULT_SRID
|
||||||
from konova.tasks import celery_update_parcels
|
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
|
from user.models import UserActionLogEntry
|
||||||
|
|
||||||
|
|
||||||
@ -350,7 +348,7 @@ class RemoveDeadlineModalForm(RemoveModalForm):
|
|||||||
self.instance.remove_deadline(self)
|
self.instance.remove_deadline(self)
|
||||||
|
|
||||||
|
|
||||||
class NewDocumentModalForm(BaseModalForm):
|
class NewDocumentForm(BaseModalForm):
|
||||||
""" Modal form for new documents
|
""" Modal form for new documents
|
||||||
|
|
||||||
"""
|
"""
|
||||||
@ -422,10 +420,6 @@ class NewDocumentModalForm(BaseModalForm):
|
|||||||
|
|
||||||
_file = self.cleaned_data.get("file", None)
|
_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)
|
mime_type_valid = self.document_model.is_mime_type_valid(_file)
|
||||||
if not mime_type_valid:
|
if not mime_type_valid:
|
||||||
self.add_error(
|
self.add_error(
|
||||||
@ -464,39 +458,6 @@ class NewDocumentModalForm(BaseModalForm):
|
|||||||
return doc
|
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):
|
class RecordModalForm(BaseModalForm):
|
||||||
""" Modal form for recording data
|
""" Modal form for recording data
|
||||||
|
|
||||||
|
@ -50,5 +50,5 @@ def remove_document(request: HttpRequest, doc: AbstractDocument):
|
|||||||
form = RemoveModalForm(request.POST or None, instance=doc, request=request)
|
form = RemoveModalForm(request.POST or None, instance=doc, request=request)
|
||||||
return form.process_request(
|
return form.process_request(
|
||||||
request=request,
|
request=request,
|
||||||
msg_success=DOCUMENT_REMOVED_TEMPLATE.format(title),
|
msg_success=DOCUMENT_REMOVED_TEMPLATE.format(title)
|
||||||
)
|
)
|
@ -65,7 +65,6 @@ REVOCATION_REMOVED = _("Revocation removed")
|
|||||||
# DOCUMENTS
|
# DOCUMENTS
|
||||||
DOCUMENT_REMOVED_TEMPLATE = _("Document '{}' deleted")
|
DOCUMENT_REMOVED_TEMPLATE = _("Document '{}' deleted")
|
||||||
DOCUMENT_ADDED = _("Document added")
|
DOCUMENT_ADDED = _("Document added")
|
||||||
DOCUMENT_EDITED = _("Document edited")
|
|
||||||
|
|
||||||
# Edited
|
# Edited
|
||||||
EDITED_GENERAL_DATA = _("Edited general data")
|
EDITED_GENERAL_DATA = _("Edited general data")
|
||||||
|
Binary file not shown.
@ -7,8 +7,8 @@
|
|||||||
#: compensation/forms/modalForms.py:46 compensation/forms/modalForms.py:62
|
#: compensation/forms/modalForms.py:46 compensation/forms/modalForms.py:62
|
||||||
#: compensation/forms/modalForms.py:332 compensation/forms/modalForms.py:425
|
#: compensation/forms/modalForms.py:332 compensation/forms/modalForms.py:425
|
||||||
#: intervention/forms/forms.py:54 intervention/forms/forms.py:156
|
#: intervention/forms/forms.py:54 intervention/forms/forms.py:156
|
||||||
#: intervention/forms/forms.py:168 intervention/forms/modalForms.py:127
|
#: intervention/forms/forms.py:168 intervention/forms/modalForms.py:124
|
||||||
#: intervention/forms/modalForms.py:140 intervention/forms/modalForms.py:153
|
#: intervention/forms/modalForms.py:137 intervention/forms/modalForms.py:150
|
||||||
#: konova/filters/mixins.py:53 konova/filters/mixins.py:54
|
#: konova/filters/mixins.py:53 konova/filters/mixins.py:54
|
||||||
#: konova/filters/mixins.py:81 konova/filters/mixins.py:82
|
#: konova/filters/mixins.py:81 konova/filters/mixins.py:82
|
||||||
#: konova/filters/mixins.py:94 konova/filters/mixins.py:95
|
#: 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:270 konova/filters/mixins.py:315
|
||||||
#: konova/filters/mixins.py:353 konova/filters/mixins.py:354
|
#: konova/filters/mixins.py:353 konova/filters/mixins.py:354
|
||||||
#: konova/filters/mixins.py:385 konova/filters/mixins.py:386
|
#: 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:141 konova/forms.py:242 konova/forms.py:313
|
||||||
#: konova/forms.py:359 konova/forms.py:369 konova/forms.py:382
|
#: konova/forms.py:357 konova/forms.py:367 konova/forms.py:380
|
||||||
#: konova/forms.py:394 konova/forms.py:412 user/forms.py:42
|
#: konova/forms.py:392 konova/forms.py:410 user/forms.py:42
|
||||||
#, fuzzy
|
#, fuzzy
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: PACKAGE VERSION\n"
|
"Project-Id-Version: PACKAGE VERSION\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2022-02-10 10:17+0100\n"
|
"POT-Creation-Date: 2022-02-09 12:52+0100\n"
|
||||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
@ -63,7 +63,7 @@ msgstr "Verantwortliche Stelle"
|
|||||||
#: analysis/forms.py:58 compensation/forms/forms.py:88
|
#: analysis/forms.py:58 compensation/forms/forms.py:88
|
||||||
#: compensation/forms/forms.py:165 intervention/forms/forms.py:64
|
#: compensation/forms/forms.py:165 intervention/forms/forms.py:64
|
||||||
#: intervention/forms/forms.py:81 intervention/forms/forms.py:97
|
#: 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"
|
msgid "Click for selection"
|
||||||
msgstr "Auswählen..."
|
msgstr "Auswählen..."
|
||||||
|
|
||||||
@ -75,7 +75,7 @@ msgstr "Bericht generieren"
|
|||||||
msgid "Select a timespan and the desired conservation office"
|
msgid "Select a timespan and the desired conservation office"
|
||||||
msgstr "Wählen Sie die Zeitspanne und die gewünschte Eintragungsstelle"
|
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"
|
msgid "Continue"
|
||||||
msgstr "Weiter"
|
msgstr "Weiter"
|
||||||
|
|
||||||
@ -220,7 +220,7 @@ msgstr "Abbuchungen"
|
|||||||
#: compensation/templates/compensation/detail/eco_account/includes/states-before.html:36
|
#: 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-after.html:36
|
||||||
#: ema/templates/ema/detail/includes/states-before.html:36
|
#: ema/templates/ema/detail/includes/states-before.html:36
|
||||||
#: intervention/forms/modalForms.py:338
|
#: intervention/forms/modalForms.py:311
|
||||||
msgid "Surface"
|
msgid "Surface"
|
||||||
msgstr "Fläche"
|
msgstr "Fläche"
|
||||||
|
|
||||||
@ -283,8 +283,8 @@ msgid "Type"
|
|||||||
msgstr "Typ"
|
msgstr "Typ"
|
||||||
|
|
||||||
#: analysis/templates/analysis/reports/includes/old_data/amount.html:24
|
#: analysis/templates/analysis/reports/includes/old_data/amount.html:24
|
||||||
#: compensation/tables.py:89 intervention/forms/modalForms.py:349
|
#: compensation/tables.py:89 intervention/forms/modalForms.py:322
|
||||||
#: intervention/forms/modalForms.py:356 intervention/tables.py:88
|
#: intervention/forms/modalForms.py:329 intervention/tables.py:88
|
||||||
#: intervention/templates/intervention/detail/view.html:19
|
#: intervention/templates/intervention/detail/view.html:19
|
||||||
#: konova/templates/konova/includes/quickstart/interventions.html:4
|
#: konova/templates/konova/includes/quickstart/interventions.html:4
|
||||||
#: templates/navbars/navbar.html:22
|
#: templates/navbars/navbar.html:22
|
||||||
@ -294,7 +294,7 @@ msgstr "Eingriff"
|
|||||||
#: analysis/templates/analysis/reports/includes/old_data/amount.html:34
|
#: analysis/templates/analysis/reports/includes/old_data/amount.html:34
|
||||||
#: compensation/tables.py:266
|
#: compensation/tables.py:266
|
||||||
#: compensation/templates/compensation/detail/eco_account/view.html:19
|
#: compensation/templates/compensation/detail/eco_account/view.html: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
|
#: konova/templates/konova/includes/quickstart/ecoaccounts.html:4
|
||||||
#: templates/navbars/navbar.html:34
|
#: templates/navbars/navbar.html:34
|
||||||
msgid "Eco-account"
|
msgid "Eco-account"
|
||||||
@ -340,7 +340,7 @@ msgstr "Automatisch generiert"
|
|||||||
#: intervention/templates/intervention/detail/includes/documents.html:28
|
#: intervention/templates/intervention/detail/includes/documents.html:28
|
||||||
#: intervention/templates/intervention/detail/view.html:31
|
#: intervention/templates/intervention/detail/view.html:31
|
||||||
#: intervention/templates/intervention/report/report.html:12
|
#: intervention/templates/intervention/report/report.html:12
|
||||||
#: konova/forms.py:358
|
#: konova/forms.py:356
|
||||||
msgid "Title"
|
msgid "Title"
|
||||||
msgstr "Bezeichnung"
|
msgstr "Bezeichnung"
|
||||||
|
|
||||||
@ -363,11 +363,11 @@ msgstr "Kompensation XY; Flur ABC"
|
|||||||
#: ema/templates/ema/detail/includes/actions.html:34
|
#: ema/templates/ema/detail/includes/actions.html:34
|
||||||
#: ema/templates/ema/detail/includes/deadlines.html:34
|
#: ema/templates/ema/detail/includes/deadlines.html:34
|
||||||
#: ema/templates/ema/detail/includes/documents.html:31
|
#: ema/templates/ema/detail/includes/documents.html:31
|
||||||
#: intervention/forms/forms.py:180 intervention/forms/modalForms.py:152
|
#: intervention/forms/forms.py:180 intervention/forms/modalForms.py:149
|
||||||
#: intervention/templates/intervention/detail/includes/documents.html:34
|
#: intervention/templates/intervention/detail/includes/documents.html:31
|
||||||
#: intervention/templates/intervention/detail/includes/payments.html:34
|
#: intervention/templates/intervention/detail/includes/payments.html:34
|
||||||
#: intervention/templates/intervention/detail/includes/revocation.html:38
|
#: 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"
|
msgid "Comment"
|
||||||
msgstr "Kommentar"
|
msgstr "Kommentar"
|
||||||
|
|
||||||
@ -483,7 +483,7 @@ msgid "Due on which date"
|
|||||||
msgstr "Zahlung wird an diesem Datum erwartet"
|
msgstr "Zahlung wird an diesem Datum erwartet"
|
||||||
|
|
||||||
#: compensation/forms/modalForms.py:63 compensation/forms/modalForms.py:333
|
#: 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"
|
msgid "Additional comment, maximum {} letters"
|
||||||
msgstr "Zusätzlicher Kommentar, maximal {} Zeichen"
|
msgstr "Zusätzlicher Kommentar, maximal {} Zeichen"
|
||||||
|
|
||||||
@ -511,7 +511,7 @@ msgstr "Zusatzbezeichnung"
|
|||||||
msgid "Select an additional biotope type"
|
msgid "Select an additional biotope type"
|
||||||
msgstr "Zusatzbezeichnung wählen"
|
msgstr "Zusatzbezeichnung wählen"
|
||||||
|
|
||||||
#: compensation/forms/modalForms.py:196 intervention/forms/modalForms.py:340
|
#: compensation/forms/modalForms.py:196 intervention/forms/modalForms.py:313
|
||||||
msgid "in m²"
|
msgid "in m²"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
@ -523,7 +523,7 @@ msgstr "Neuer Zustand"
|
|||||||
msgid "Insert data for the new state"
|
msgid "Insert data for the new state"
|
||||||
msgstr "Geben Sie die Daten des neuen Zustandes ein"
|
msgstr "Geben Sie die Daten des neuen Zustandes ein"
|
||||||
|
|
||||||
#: compensation/forms/modalForms.py:215 konova/forms.py:193
|
#: compensation/forms/modalForms.py:215 konova/forms.py:191
|
||||||
msgid "Object removed"
|
msgid "Object removed"
|
||||||
msgstr "Objekt entfernt"
|
msgstr "Objekt entfernt"
|
||||||
|
|
||||||
@ -539,7 +539,7 @@ msgstr "Fristart wählen"
|
|||||||
#: compensation/templates/compensation/detail/compensation/includes/deadlines.html:31
|
#: compensation/templates/compensation/detail/compensation/includes/deadlines.html:31
|
||||||
#: compensation/templates/compensation/detail/eco_account/includes/deadlines.html:31
|
#: compensation/templates/compensation/detail/eco_account/includes/deadlines.html:31
|
||||||
#: ema/templates/ema/detail/includes/deadlines.html:31
|
#: ema/templates/ema/detail/includes/deadlines.html:31
|
||||||
#: intervention/forms/modalForms.py:126
|
#: intervention/forms/modalForms.py:123
|
||||||
msgid "Date"
|
msgid "Date"
|
||||||
msgstr "Datum"
|
msgstr "Datum"
|
||||||
|
|
||||||
@ -582,7 +582,7 @@ msgstr "Maßnahmentyp wählen"
|
|||||||
#: ema/templates/ema/detail/includes/states-before.html:40
|
#: ema/templates/ema/detail/includes/states-before.html:40
|
||||||
#: intervention/templates/intervention/detail/includes/compensations.html:38
|
#: intervention/templates/intervention/detail/includes/compensations.html:38
|
||||||
#: intervention/templates/intervention/detail/includes/deductions.html:39
|
#: 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/payments.html:39
|
||||||
#: intervention/templates/intervention/detail/includes/revocation.html:43
|
#: intervention/templates/intervention/detail/includes/revocation.html:43
|
||||||
#: templates/log.html:10
|
#: templates/log.html:10
|
||||||
@ -821,14 +821,14 @@ msgstr "Dokumente"
|
|||||||
#: compensation/templates/compensation/detail/eco_account/includes/documents.html:14
|
#: compensation/templates/compensation/detail/eco_account/includes/documents.html:14
|
||||||
#: ema/templates/ema/detail/includes/documents.html:14
|
#: ema/templates/ema/detail/includes/documents.html:14
|
||||||
#: intervention/templates/intervention/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"
|
msgid "Add new document"
|
||||||
msgstr "Neues Dokument hinzufügen"
|
msgstr "Neues Dokument hinzufügen"
|
||||||
|
|
||||||
#: compensation/templates/compensation/detail/compensation/includes/documents.html:57
|
#: compensation/templates/compensation/detail/compensation/includes/documents.html:57
|
||||||
#: compensation/templates/compensation/detail/eco_account/includes/documents.html:55
|
#: compensation/templates/compensation/detail/eco_account/includes/documents.html:55
|
||||||
#: ema/templates/ema/detail/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"
|
msgid "Remove document"
|
||||||
msgstr "Dokument löschen"
|
msgstr "Dokument löschen"
|
||||||
|
|
||||||
@ -943,14 +943,14 @@ msgstr "Zuletzt bearbeitet"
|
|||||||
|
|
||||||
#: compensation/templates/compensation/detail/compensation/view.html:99
|
#: compensation/templates/compensation/detail/compensation/view.html:99
|
||||||
#: compensation/templates/compensation/detail/eco_account/view.html:82
|
#: 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
|
#: intervention/templates/intervention/detail/view.html:116
|
||||||
msgid "Shared with"
|
msgid "Shared with"
|
||||||
msgstr "Freigegeben für"
|
msgstr "Freigegeben für"
|
||||||
|
|
||||||
#: compensation/templates/compensation/detail/eco_account/includes/controls.html:15
|
#: compensation/templates/compensation/detail/eco_account/includes/controls.html:15
|
||||||
#: ema/templates/ema/detail/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
|
#: intervention/templates/intervention/detail/includes/controls.html:15
|
||||||
msgid "Share"
|
msgid "Share"
|
||||||
msgstr "Freigabe"
|
msgstr "Freigabe"
|
||||||
@ -992,11 +992,6 @@ msgid "Recorded on"
|
|||||||
msgstr "Verzeichnet am"
|
msgstr "Verzeichnet am"
|
||||||
|
|
||||||
#: compensation/templates/compensation/detail/eco_account/includes/deductions.html:65
|
#: 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
|
#: intervention/templates/intervention/detail/includes/deductions.html:63
|
||||||
msgid "Remove Deduction"
|
msgid "Remove Deduction"
|
||||||
msgstr "Abbuchung entfernen"
|
msgstr "Abbuchung entfernen"
|
||||||
@ -1085,22 +1080,22 @@ msgstr "Daten zu den verantwortlichen Stellen"
|
|||||||
msgid "Compensations - Overview"
|
msgid "Compensations - Overview"
|
||||||
msgstr "Kompensationen - Übersicht"
|
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"
|
msgid "Compensation {} edited"
|
||||||
msgstr "Kompensation {} bearbeitet"
|
msgstr "Kompensation {} bearbeitet"
|
||||||
|
|
||||||
#: compensation/views/compensation.py:159 compensation/views/eco_account.py:163
|
#: 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 {}"
|
msgid "Edit {}"
|
||||||
msgstr "Bearbeite {}"
|
msgstr "Bearbeite {}"
|
||||||
|
|
||||||
#: compensation/views/compensation.py:238 compensation/views/eco_account.py:347
|
#: 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"
|
msgid "Log"
|
||||||
msgstr "Log"
|
msgstr "Log"
|
||||||
|
|
||||||
#: compensation/views/compensation.py:487 compensation/views/eco_account.py:620
|
#: 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 {}"
|
msgid "Report {}"
|
||||||
msgstr "Bericht {}"
|
msgstr "Bericht {}"
|
||||||
|
|
||||||
@ -1121,32 +1116,32 @@ msgid "Eco-account removed"
|
|||||||
msgstr "Ökokonto entfernt"
|
msgstr "Ökokonto entfernt"
|
||||||
|
|
||||||
#: compensation/views/eco_account.py:368 ema/views.py:272
|
#: compensation/views/eco_account.py:368 ema/views.py:272
|
||||||
#: intervention/views.py:640
|
#: intervention/views.py:582
|
||||||
msgid "{} unrecorded"
|
msgid "{} unrecorded"
|
||||||
msgstr "{} entzeichnet"
|
msgstr "{} entzeichnet"
|
||||||
|
|
||||||
#: compensation/views/eco_account.py:368 ema/views.py:272
|
#: compensation/views/eco_account.py:368 ema/views.py:272
|
||||||
#: intervention/views.py:640
|
#: intervention/views.py:582
|
||||||
msgid "{} recorded"
|
msgid "{} recorded"
|
||||||
msgstr "{} verzeichnet"
|
msgstr "{} verzeichnet"
|
||||||
|
|
||||||
#: compensation/views/eco_account.py:693 ema/views.py:543
|
#: 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"
|
msgid "{} has already been shared with you"
|
||||||
msgstr "{} wurde bereits für Sie freigegeben"
|
msgstr "{} wurde bereits für Sie freigegeben"
|
||||||
|
|
||||||
#: compensation/views/eco_account.py:698 ema/views.py:548
|
#: compensation/views/eco_account.py:698 ema/views.py:548
|
||||||
#: intervention/views.py:443
|
#: intervention/views.py:385
|
||||||
msgid "{} has been shared with you"
|
msgid "{} has been shared with you"
|
||||||
msgstr "{} ist nun für Sie freigegeben"
|
msgstr "{} ist nun für Sie freigegeben"
|
||||||
|
|
||||||
#: compensation/views/eco_account.py:705 ema/views.py:555
|
#: compensation/views/eco_account.py:705 ema/views.py:555
|
||||||
#: intervention/views.py:450
|
#: intervention/views.py:392
|
||||||
msgid "Share link invalid"
|
msgid "Share link invalid"
|
||||||
msgstr "Freigabelink ungültig"
|
msgstr "Freigabelink ungültig"
|
||||||
|
|
||||||
#: compensation/views/eco_account.py:728 ema/views.py:578
|
#: compensation/views/eco_account.py:728 ema/views.py:578
|
||||||
#: intervention/views.py:473
|
#: intervention/views.py:415
|
||||||
msgid "Share settings updated"
|
msgid "Share settings updated"
|
||||||
msgstr "Freigabe Einstellungen aktualisiert"
|
msgstr "Freigabe Einstellungen aktualisiert"
|
||||||
|
|
||||||
@ -1259,19 +1254,19 @@ msgstr "Neuer Eingriff"
|
|||||||
msgid "Edit intervention"
|
msgid "Edit intervention"
|
||||||
msgstr "Eingriff bearbeiten"
|
msgstr "Eingriff bearbeiten"
|
||||||
|
|
||||||
#: intervention/forms/modalForms.py:29
|
#: intervention/forms/modalForms.py:26
|
||||||
msgid "Share link"
|
msgid "Share link"
|
||||||
msgstr "Freigabelink"
|
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"
|
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"
|
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"
|
msgid "Add user to share with"
|
||||||
msgstr "Nutzer direkt hinzufügen"
|
msgstr "Nutzer direkt hinzufügen"
|
||||||
|
|
||||||
#: intervention/forms/modalForms.py:43
|
#: intervention/forms/modalForms.py:40
|
||||||
msgid ""
|
msgid ""
|
||||||
"Multiple selection possible - You can only select users which do not already "
|
"Multiple selection possible - You can only select users which do not already "
|
||||||
"have access. Enter the full username."
|
"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 "
|
"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."
|
"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"
|
msgid "Remove check to remove access for this user"
|
||||||
msgstr "Wählen Sie die Nutzer ab, die keinen Zugriff mehr haben sollen"
|
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 {}"
|
msgid "Share settings for {}"
|
||||||
msgstr "Freigabe Einstellungen für {}"
|
msgstr "Freigabe Einstellungen für {}"
|
||||||
|
|
||||||
#: intervention/forms/modalForms.py:128
|
#: intervention/forms/modalForms.py:125
|
||||||
msgid "Date of revocation"
|
msgid "Date of revocation"
|
||||||
msgstr "Datum des Widerspruchs"
|
msgstr "Datum des Widerspruchs"
|
||||||
|
|
||||||
#: intervention/forms/modalForms.py:139
|
#: intervention/forms/modalForms.py:136
|
||||||
#: intervention/templates/intervention/detail/includes/revocation.html:35
|
#: intervention/templates/intervention/detail/includes/revocation.html:35
|
||||||
msgid "Document"
|
msgid "Document"
|
||||||
msgstr "Dokument"
|
msgstr "Dokument"
|
||||||
|
|
||||||
#: intervention/forms/modalForms.py:142
|
#: intervention/forms/modalForms.py:139
|
||||||
msgid "Must be smaller than 15 Mb"
|
msgid "Must be smaller than 15 Mb"
|
||||||
msgstr "Muss kleiner als 15 Mb sein"
|
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
|
#: intervention/templates/intervention/detail/includes/revocation.html:18
|
||||||
msgid "Add revocation"
|
msgid "Add revocation"
|
||||||
msgstr "Widerspruch hinzufügen"
|
msgstr "Widerspruch hinzufügen"
|
||||||
|
|
||||||
#: intervention/forms/modalForms.py:224
|
#: intervention/forms/modalForms.py:197
|
||||||
msgid "Checked intervention data"
|
msgid "Checked intervention data"
|
||||||
msgstr "Eingriffsdaten geprüft"
|
msgstr "Eingriffsdaten geprüft"
|
||||||
|
|
||||||
#: intervention/forms/modalForms.py:230
|
#: intervention/forms/modalForms.py:203
|
||||||
msgid "Checked compensations data and payments"
|
msgid "Checked compensations data and payments"
|
||||||
msgstr "Kompensationen und Zahlungen geprüft"
|
msgstr "Kompensationen und Zahlungen geprüft"
|
||||||
|
|
||||||
#: intervention/forms/modalForms.py:239
|
#: intervention/forms/modalForms.py:212
|
||||||
#: intervention/templates/intervention/detail/includes/controls.html:19
|
#: intervention/templates/intervention/detail/includes/controls.html:19
|
||||||
msgid "Run check"
|
msgid "Run check"
|
||||||
msgstr "Prüfung vornehmen"
|
msgstr "Prüfung vornehmen"
|
||||||
|
|
||||||
#: intervention/forms/modalForms.py:240 konova/forms.py:514
|
#: intervention/forms/modalForms.py:213 konova/forms.py:475
|
||||||
msgid ""
|
msgid ""
|
||||||
"I, {} {}, confirm that all necessary control steps have been performed by "
|
"I, {} {}, confirm that all necessary control steps have been performed by "
|
||||||
"myself."
|
"myself."
|
||||||
@ -1326,23 +1321,23 @@ msgstr ""
|
|||||||
"Ich, {} {}, bestätige, dass die notwendigen Kontrollschritte durchgeführt "
|
"Ich, {} {}, bestätige, dass die notwendigen Kontrollschritte durchgeführt "
|
||||||
"wurden:"
|
"wurden:"
|
||||||
|
|
||||||
#: intervention/forms/modalForms.py:324
|
#: intervention/forms/modalForms.py:297
|
||||||
msgid "Only recorded accounts can be selected for deductions"
|
msgid "Only recorded accounts can be selected for deductions"
|
||||||
msgstr "Nur verzeichnete Ökokonten können für Abbuchungen verwendet werden."
|
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"
|
msgid "Only shared interventions can be selected"
|
||||||
msgstr "Nur freigegebene Eingriffe können gewählt werden"
|
msgstr "Nur freigegebene Eingriffe können gewählt werden"
|
||||||
|
|
||||||
#: intervention/forms/modalForms.py:364
|
#: intervention/forms/modalForms.py:337
|
||||||
msgid "New Deduction"
|
msgid "New Deduction"
|
||||||
msgstr "Neue Abbuchung"
|
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"
|
msgid "Enter the information for a new deduction from a chosen eco-account"
|
||||||
msgstr "Geben Sie die Informationen für eine neue Abbuchung ein."
|
msgstr "Geben Sie die Informationen für eine neue Abbuchung ein."
|
||||||
|
|
||||||
#: intervention/forms/modalForms.py:408
|
#: intervention/forms/modalForms.py:381
|
||||||
msgid ""
|
msgid ""
|
||||||
"Eco-account {} is not recorded yet. You can only deduct from recorded "
|
"Eco-account {} is not recorded yet. You can only deduct from recorded "
|
||||||
"accounts."
|
"accounts."
|
||||||
@ -1350,7 +1345,7 @@ msgstr ""
|
|||||||
"Ökokonto {} ist noch nicht verzeichnet. Abbuchungen können nur von "
|
"Ökokonto {} ist noch nicht verzeichnet. Abbuchungen können nur von "
|
||||||
"verzeichneten Ökokonten erfolgen."
|
"verzeichneten Ökokonten erfolgen."
|
||||||
|
|
||||||
#: intervention/forms/modalForms.py:418
|
#: intervention/forms/modalForms.py:391
|
||||||
msgid ""
|
msgid ""
|
||||||
"The account {} has not enough surface for a deduction of {} m². There are "
|
"The account {} has not enough surface for a deduction of {} m². There are "
|
||||||
"only {} m² left"
|
"only {} m² left"
|
||||||
@ -1378,14 +1373,9 @@ msgstr "Ökokonto gelöscht! Abbuchung ungültig!"
|
|||||||
msgid "Eco-account not recorded! Deduction invalid!"
|
msgid "Eco-account not recorded! Deduction invalid!"
|
||||||
msgstr "Ökokonto nicht verzeichnet! Abbuchung ungültig!"
|
msgstr "Ökokonto nicht verzeichnet! Abbuchung ungültig!"
|
||||||
|
|
||||||
#: intervention/templates/intervention/detail/includes/documents.html:31
|
#: intervention/templates/intervention/detail/includes/deductions.html:60
|
||||||
#: konova/forms.py:368
|
msgid "Edit Deduction"
|
||||||
msgid "Created on"
|
msgstr "Abbuchung bearbeiten"
|
||||||
msgstr "Erstellt"
|
|
||||||
|
|
||||||
#: intervention/templates/intervention/detail/includes/documents.html:65
|
|
||||||
msgid "Edit document"
|
|
||||||
msgstr "Dokument bearbeitet"
|
|
||||||
|
|
||||||
#: intervention/templates/intervention/detail/includes/payments.html:8
|
#: intervention/templates/intervention/detail/includes/payments.html:8
|
||||||
#: intervention/templates/intervention/report/report.html:73
|
#: intervention/templates/intervention/report/report.html:73
|
||||||
@ -1424,10 +1414,6 @@ msgid "Revocation"
|
|||||||
msgstr "Widerspruch"
|
msgstr "Widerspruch"
|
||||||
|
|
||||||
#: intervention/templates/intervention/detail/includes/revocation.html:69
|
#: 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"
|
msgid "Remove revocation"
|
||||||
msgstr "Widerspruch entfernen"
|
msgstr "Widerspruch entfernen"
|
||||||
|
|
||||||
@ -1470,19 +1456,19 @@ msgstr "Eingriffe - Übersicht"
|
|||||||
msgid "Intervention {} added"
|
msgid "Intervention {} added"
|
||||||
msgstr "Eingriff {} hinzugefügt"
|
msgstr "Eingriff {} hinzugefügt"
|
||||||
|
|
||||||
#: intervention/views.py:325
|
#: intervention/views.py:293
|
||||||
msgid "Intervention {} edited"
|
msgid "Intervention {} edited"
|
||||||
msgstr "Eingriff {} bearbeitet"
|
msgstr "Eingriff {} bearbeitet"
|
||||||
|
|
||||||
#: intervention/views.py:361
|
#: intervention/views.py:329
|
||||||
msgid "{} removed"
|
msgid "{} removed"
|
||||||
msgstr "{} entfernt"
|
msgstr "{} entfernt"
|
||||||
|
|
||||||
#: intervention/views.py:494
|
#: intervention/views.py:436
|
||||||
msgid "Check performed"
|
msgid "Check performed"
|
||||||
msgstr "Prüfung durchgeführt"
|
msgstr "Prüfung durchgeführt"
|
||||||
|
|
||||||
#: intervention/views.py:645
|
#: intervention/views.py:587
|
||||||
msgid "There are errors on this intervention:"
|
msgid "There are errors on this intervention:"
|
||||||
msgstr "Es liegen Fehler in diesem Eingriff vor:"
|
msgstr "Es liegen Fehler in diesem Eingriff vor:"
|
||||||
|
|
||||||
@ -1566,69 +1552,81 @@ msgstr "Nach Zulassungsbehörde suchen"
|
|||||||
msgid "Search for conservation office"
|
msgid "Search for conservation office"
|
||||||
msgstr "Nch Eintragungsstelle suchen"
|
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"
|
msgid "Save"
|
||||||
msgstr "Speichern"
|
msgstr "Speichern"
|
||||||
|
|
||||||
#: konova/forms.py:71
|
#: konova/forms.py:69
|
||||||
msgid "Not editable"
|
msgid "Not editable"
|
||||||
msgstr "Nicht editierbar"
|
msgstr "Nicht editierbar"
|
||||||
|
|
||||||
#: konova/forms.py:142 konova/forms.py:314
|
#: konova/forms.py:140 konova/forms.py:312
|
||||||
msgid "Confirm"
|
msgid "Confirm"
|
||||||
msgstr "Bestätige"
|
msgstr "Bestätige"
|
||||||
|
|
||||||
#: konova/forms.py:154 konova/forms.py:323
|
#: konova/forms.py:152 konova/forms.py:321
|
||||||
msgid "Remove"
|
msgid "Remove"
|
||||||
msgstr "Löschen"
|
msgstr "Löschen"
|
||||||
|
|
||||||
#: konova/forms.py:156
|
#: konova/forms.py:154
|
||||||
msgid "You are about to remove {} {}"
|
msgid "You are about to remove {} {}"
|
||||||
msgstr "Sie sind dabei {} {} zu löschen"
|
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
|
#: templates/form/collapsable/form.html:45
|
||||||
msgid "Geometry"
|
msgid "Geometry"
|
||||||
msgstr "Geometrie"
|
msgstr "Geometrie"
|
||||||
|
|
||||||
#: konova/forms.py:324
|
#: konova/forms.py:322
|
||||||
msgid "Are you sure?"
|
msgid "Are you sure?"
|
||||||
msgstr "Sind Sie sicher?"
|
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."
|
msgid "When has this file been created? Important for photos."
|
||||||
msgstr "Wann wurde diese Datei erstellt oder das Foto aufgenommen?"
|
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
|
#: venv/lib/python3.7/site-packages/django/db/models/fields/files.py:231
|
||||||
msgid "File"
|
msgid "File"
|
||||||
msgstr "Datei"
|
msgstr "Datei"
|
||||||
|
|
||||||
#: konova/forms.py:383
|
#: konova/forms.py:381
|
||||||
msgid "Allowed formats: pdf, jpg, png. Max size 15 MB."
|
msgid "Allowed formats: pdf, jpg, png. Max size 15 MB."
|
||||||
msgstr "Formate: pdf, jpg, png. Maximal 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"
|
msgid "Added document"
|
||||||
msgstr "Dokument hinzugefügt"
|
msgstr "Dokument hinzugefügt"
|
||||||
|
|
||||||
#: konova/forms.py:505
|
#: konova/forms.py:466
|
||||||
msgid "Confirm record"
|
msgid "Confirm record"
|
||||||
msgstr "Verzeichnen bestätigen"
|
msgstr "Verzeichnen bestätigen"
|
||||||
|
|
||||||
#: konova/forms.py:513
|
#: konova/forms.py:474
|
||||||
msgid "Record data"
|
msgid "Record data"
|
||||||
msgstr "Daten verzeichnen"
|
msgstr "Daten verzeichnen"
|
||||||
|
|
||||||
#: konova/forms.py:520
|
#: konova/forms.py:481
|
||||||
msgid "Confirm unrecord"
|
msgid "Confirm unrecord"
|
||||||
msgstr "Entzeichnen bestätigen"
|
msgstr "Entzeichnen bestätigen"
|
||||||
|
|
||||||
#: konova/forms.py:521
|
#: konova/forms.py:482
|
||||||
msgid "Unrecord data"
|
msgid "Unrecord data"
|
||||||
msgstr "Daten entzeichnen"
|
msgstr "Daten entzeichnen"
|
||||||
|
|
||||||
#: konova/forms.py:522
|
#: konova/forms.py:483
|
||||||
msgid "I, {} {}, confirm that this data must be unrecorded."
|
msgid "I, {} {}, confirm that this data must be unrecorded."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Ich, {} {}, bestätige, dass diese Daten wieder entzeichnet werden müssen."
|
"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"
|
msgstr "'Geprüft'/'Verzeichnet' wurde zurückgesetzt"
|
||||||
|
|
||||||
#: konova/utils/message_templates.py:22
|
#: 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 ""
|
msgid ""
|
||||||
"Action canceled. Eco account is recorded or deductions exist. Only "
|
"Action canceled. Eco account is recorded or deductions exist. Only "
|
||||||
"conservation office member can perform this action."
|
"conservation office member can perform this action."
|
||||||
@ -1817,119 +1807,115 @@ msgstr ""
|
|||||||
"Aktion abgebrochen. Ökokonto ist bereits verzeichnet oder Abbuchungen liegen "
|
"Aktion abgebrochen. Ökokonto ist bereits verzeichnet oder Abbuchungen liegen "
|
||||||
"vor. Nur Eintragungsstellennutzer können diese Aktion jetzt durchführen."
|
"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"
|
msgid "Compensation {} added"
|
||||||
msgstr "Kompensation {} hinzugefügt"
|
msgstr "Kompensation {} hinzugefügt"
|
||||||
|
|
||||||
#: konova/utils/message_templates.py:30
|
#: konova/utils/message_templates.py:26
|
||||||
msgid "Compensation {} removed"
|
msgid "Compensation {} removed"
|
||||||
msgstr "Kompensation {} entfernt"
|
msgstr "Kompensation {} entfernt"
|
||||||
|
|
||||||
#: konova/utils/message_templates.py:32
|
#: konova/utils/message_templates.py:28
|
||||||
msgid "Added compensation action"
|
msgid "Added compensation action"
|
||||||
msgstr "Maßnahme hinzugefügt"
|
msgstr "Maßnahme hinzugefügt"
|
||||||
|
|
||||||
#: konova/utils/message_templates.py:33
|
#: konova/utils/message_templates.py:29
|
||||||
msgid "Added compensation state"
|
msgid "Added compensation state"
|
||||||
msgstr "Zustand hinzugefügt"
|
msgstr "Zustand hinzugefügt"
|
||||||
|
|
||||||
#: konova/utils/message_templates.py:36
|
#: konova/utils/message_templates.py:32
|
||||||
msgid "State removed"
|
msgid "State removed"
|
||||||
msgstr "Zustand gelöscht"
|
msgstr "Zustand gelöscht"
|
||||||
|
|
||||||
#: konova/utils/message_templates.py:37
|
#: konova/utils/message_templates.py:33
|
||||||
msgid "State edited"
|
msgid "State edited"
|
||||||
msgstr "Zustand bearbeitet"
|
msgstr "Zustand bearbeitet"
|
||||||
|
|
||||||
#: konova/utils/message_templates.py:38
|
#: konova/utils/message_templates.py:34
|
||||||
msgid "State added"
|
msgid "State added"
|
||||||
msgstr "Zustand hinzugefügt"
|
msgstr "Zustand hinzugefügt"
|
||||||
|
|
||||||
#: konova/utils/message_templates.py:41
|
#: konova/utils/message_templates.py:37
|
||||||
msgid "Action added"
|
msgid "Action added"
|
||||||
msgstr "Maßnahme hinzugefügt"
|
msgstr "Maßnahme hinzugefügt"
|
||||||
|
|
||||||
#: konova/utils/message_templates.py:42
|
#: konova/utils/message_templates.py:38
|
||||||
msgid "Action edited"
|
msgid "Action edited"
|
||||||
msgstr "Maßnahme bearbeitet"
|
msgstr "Maßnahme bearbeitet"
|
||||||
|
|
||||||
#: konova/utils/message_templates.py:43
|
#: konova/utils/message_templates.py:39
|
||||||
msgid "Action removed"
|
msgid "Action removed"
|
||||||
msgstr "Maßnahme entfernt"
|
msgstr "Maßnahme entfernt"
|
||||||
|
|
||||||
#: konova/utils/message_templates.py:46
|
#: konova/utils/message_templates.py:42
|
||||||
msgid "Deduction added"
|
msgid "Deduction added"
|
||||||
msgstr "Abbuchung hinzugefügt"
|
msgstr "Abbuchung hinzugefügt"
|
||||||
|
|
||||||
#: konova/utils/message_templates.py:47
|
#: konova/utils/message_templates.py:43
|
||||||
msgid "Deduction edited"
|
msgid "Deduction edited"
|
||||||
msgstr "Abbuchung bearbeitet"
|
msgstr "Abbuchung bearbeitet"
|
||||||
|
|
||||||
#: konova/utils/message_templates.py:48
|
#: konova/utils/message_templates.py:44
|
||||||
msgid "Deduction removed"
|
msgid "Deduction removed"
|
||||||
msgstr "Abbuchung entfernt"
|
msgstr "Abbuchung entfernt"
|
||||||
|
|
||||||
#: konova/utils/message_templates.py:51
|
#: konova/utils/message_templates.py:47
|
||||||
msgid "Deadline added"
|
msgid "Deadline added"
|
||||||
msgstr "Frist/Termin hinzugefügt"
|
msgstr "Frist/Termin hinzugefügt"
|
||||||
|
|
||||||
#: konova/utils/message_templates.py:52
|
#: konova/utils/message_templates.py:48
|
||||||
msgid "Deadline edited"
|
msgid "Deadline edited"
|
||||||
msgstr "Frist/Termin bearbeitet"
|
msgstr "Frist/Termin bearbeitet"
|
||||||
|
|
||||||
#: konova/utils/message_templates.py:53
|
#: konova/utils/message_templates.py:49
|
||||||
msgid "Deadline removed"
|
msgid "Deadline removed"
|
||||||
msgstr "Frist/Termin gelöscht"
|
msgstr "Frist/Termin gelöscht"
|
||||||
|
|
||||||
#: konova/utils/message_templates.py:56
|
#: konova/utils/message_templates.py:52
|
||||||
msgid "Payment added"
|
msgid "Payment added"
|
||||||
msgstr "Zahlung hinzugefügt"
|
msgstr "Zahlung hinzugefügt"
|
||||||
|
|
||||||
#: konova/utils/message_templates.py:57
|
#: konova/utils/message_templates.py:53
|
||||||
msgid "Payment edited"
|
msgid "Payment edited"
|
||||||
msgstr "Zahlung bearbeitet"
|
msgstr "Zahlung bearbeitet"
|
||||||
|
|
||||||
#: konova/utils/message_templates.py:58
|
#: konova/utils/message_templates.py:54
|
||||||
msgid "Payment removed"
|
msgid "Payment removed"
|
||||||
msgstr "Zahlung gelöscht"
|
msgstr "Zahlung gelöscht"
|
||||||
|
|
||||||
#: konova/utils/message_templates.py:61
|
#: konova/utils/message_templates.py:57
|
||||||
msgid "Revocation added"
|
msgid "Revocation added"
|
||||||
msgstr "Widerspruch hinzugefügt"
|
msgstr "Widerspruch hinzugefügt"
|
||||||
|
|
||||||
#: konova/utils/message_templates.py:62
|
#: konova/utils/message_templates.py:58
|
||||||
msgid "Revocation edited"
|
msgid "Revocation edited"
|
||||||
msgstr "Widerspruch bearbeitet"
|
msgstr "Widerspruch bearbeitet"
|
||||||
|
|
||||||
#: konova/utils/message_templates.py:63
|
#: konova/utils/message_templates.py:59
|
||||||
msgid "Revocation removed"
|
msgid "Revocation removed"
|
||||||
msgstr "Widerspruch entfernt"
|
msgstr "Widerspruch entfernt"
|
||||||
|
|
||||||
#: konova/utils/message_templates.py:66
|
#: konova/utils/message_templates.py:62
|
||||||
msgid "Document '{}' deleted"
|
msgid "Document '{}' deleted"
|
||||||
msgstr "Dokument '{}' gelöscht"
|
msgstr "Dokument '{}' gelöscht"
|
||||||
|
|
||||||
#: konova/utils/message_templates.py:67
|
#: konova/utils/message_templates.py:63
|
||||||
msgid "Document added"
|
msgid "Document added"
|
||||||
msgstr "Dokument hinzugefügt"
|
msgstr "Dokument hinzugefügt"
|
||||||
|
|
||||||
#: konova/utils/message_templates.py:68
|
#: konova/utils/message_templates.py:66
|
||||||
msgid "Document edited"
|
|
||||||
msgstr "Dokument bearbeitet"
|
|
||||||
|
|
||||||
#: konova/utils/message_templates.py:71
|
|
||||||
msgid "Edited general data"
|
msgid "Edited general data"
|
||||||
msgstr "Allgemeine Daten bearbeitet"
|
msgstr "Allgemeine Daten bearbeitet"
|
||||||
|
|
||||||
#: konova/utils/message_templates.py:72
|
#: konova/utils/message_templates.py:67
|
||||||
msgid "Added deadline"
|
msgid "Added deadline"
|
||||||
msgstr "Frist/Termin hinzugefügt"
|
msgstr "Frist/Termin hinzugefügt"
|
||||||
|
|
||||||
#: konova/utils/message_templates.py:75
|
#: konova/utils/message_templates.py:70
|
||||||
msgid "Geometry conflict detected with {}"
|
msgid "Geometry conflict detected with {}"
|
||||||
msgstr "Geometriekonflikt mit folgenden Einträgen erkannt: {}"
|
msgstr "Geometriekonflikt mit folgenden Einträgen erkannt: {}"
|
||||||
|
|
||||||
#: konova/utils/message_templates.py:78
|
#: konova/utils/message_templates.py:73
|
||||||
msgid "This intervention has {} revocations"
|
msgid "This intervention has {} revocations"
|
||||||
msgstr "Dem Eingriff liegen {} Widersprüche vor"
|
msgstr "Dem Eingriff liegen {} Widersprüche vor"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user