- {{obj.before_states.count}}
+ {{before_states.count}}
{% trans 'States before' %}
diff --git a/compensation/templates/compensation/report/compensation/report.html b/compensation/templates/compensation/report/compensation/report.html
index fad5573f..de8ddd15 100644
--- a/compensation/templates/compensation/report/compensation/report.html
+++ b/compensation/templates/compensation/report/compensation/report.html
@@ -23,10 +23,14 @@
{% trans 'Funded by' %} |
- {% for funding in obj.fundings.all %}
+ {% with obj.fundings.all as fundings %}
+ {% for funding in fundings %}
{{funding.short_name}}
+ {% empty %}
+ {% trans 'None' %}
{% endfor %}
+ {% endwith %}
|
diff --git a/compensation/views/compensation_views.py b/compensation/views/compensation_views.py
index 3ab84c27..994e9647 100644
--- a/compensation/views/compensation_views.py
+++ b/compensation/views/compensation_views.py
@@ -163,8 +163,9 @@ def detail_view(request: HttpRequest, id: str):
is_data_shared = comp.intervention.is_shared_with(_user)
# Order states according to surface
- before_states = comp.before_states.all().order_by("-surface")
- after_states = comp.after_states.all().order_by("-surface")
+ before_states = comp.before_states.all().prefetch_related("biotope_type").order_by("-surface")
+ after_states = comp.after_states.all().prefetch_related("biotope_type").order_by("-surface")
+ actions = comp.actions.all().prefetch_related("action_type")
# Precalculate logical errors between before- and after-states
# Sum() returns None in case of no states, so we catch that and replace it with 0 for easier handling
@@ -176,6 +177,7 @@ def detail_view(request: HttpRequest, id: str):
"obj": comp,
"geom_form": geom_form,
"has_access": is_data_shared,
+ "actions": actions,
"before_states": before_states,
"after_states": after_states,
"sum_before_states": sum_before_states,
@@ -416,8 +418,10 @@ def report_view(request:HttpRequest, id: str):
7
)
# Order states by surface
- before_states = comp.before_states.all().order_by("-surface")
- after_states = comp.after_states.all().order_by("-surface")
+ before_states = comp.before_states.all().order_by("-surface").prefetch_related("biotope_type")
+ after_states = comp.after_states.all().order_by("-surface").prefetch_related("biotope_type")
+ actions = comp.actions.all().prefetch_related("action_type")
+
context = {
"obj": comp,
"qrcode": qrcode_img,
@@ -426,6 +430,7 @@ def report_view(request:HttpRequest, id: str):
"before_states": before_states,
"after_states": after_states,
"geom_form": geom_form,
+ "actions": actions,
}
context = BaseContext(request, context).context
return render(request, template, context)
diff --git a/intervention/templates/intervention/detail/includes/compensations.html b/intervention/templates/intervention/detail/includes/compensations.html
index c54c974f..79fcaa09 100644
--- a/intervention/templates/intervention/detail/includes/compensations.html
+++ b/intervention/templates/intervention/detail/includes/compensations.html
@@ -32,9 +32,11 @@
{% trans 'Title' %}
|
-
- {% trans 'Action' %}
- |
+ {% if is_default_member and has_access %}
+
+ {% trans 'Action' %}
+ |
+ {% endif %}
diff --git a/intervention/templates/intervention/detail/includes/deductions.html b/intervention/templates/intervention/detail/includes/deductions.html
index be509998..cb2f8179 100644
--- a/intervention/templates/intervention/detail/includes/deductions.html
+++ b/intervention/templates/intervention/detail/includes/deductions.html
@@ -33,9 +33,11 @@
{% trans 'Created' %}
|
-
- {% trans 'Action' %}
- |
+ {% if is_default_member and has_access %}
+
+ {% trans 'Action' %}
+ |
+ {% endif %}
diff --git a/intervention/templates/intervention/detail/includes/documents.html b/intervention/templates/intervention/detail/includes/documents.html
index 1365edae..cc0c9a17 100644
--- a/intervention/templates/intervention/detail/includes/documents.html
+++ b/intervention/templates/intervention/detail/includes/documents.html
@@ -30,9 +30,11 @@
{% trans 'Comment' %}
|
-
- {% trans 'Action' %}
- |
+ {% if is_default_member and has_access %}
+
+ {% trans 'Action' %}
+ |
+ {% endif %}
diff --git a/intervention/templates/intervention/detail/includes/payments.html b/intervention/templates/intervention/detail/includes/payments.html
index b6b61d96..c3ab7568 100644
--- a/intervention/templates/intervention/detail/includes/payments.html
+++ b/intervention/templates/intervention/detail/includes/payments.html
@@ -33,9 +33,11 @@
{% trans 'Comment' %}
|
-
- {% trans 'Action' %}
- |
+ {% if is_default_member and has_access %}
+
+ {% trans 'Action' %}
+ |
+ {% endif %}
diff --git a/intervention/templates/intervention/detail/includes/revocation.html b/intervention/templates/intervention/detail/includes/revocation.html
index 6699f016..c9d821ff 100644
--- a/intervention/templates/intervention/detail/includes/revocation.html
+++ b/intervention/templates/intervention/detail/includes/revocation.html
@@ -36,9 +36,11 @@
{% trans 'Comment' %}
|
-
- {% trans 'Action' %}
- |
+ {% if is_default_member and has_access %}
+
+ {% trans 'Action' %}
+ |
+ {% endif %}