#49 Frontend rendering

* adds rendering for detail view
* adds new includable html snippet for parcel rendering
* refactors generic includables in konova/ app into konova/templates/includes/...
* fixes bug where parcels have been reused from the database due to wrong model structure
* adds get_underlying_parcels() for Geometry model
* adds get_underlying_parcels() for GeoReferencedMixin models
* fixes bug where missing geometry would lead to an error during geometry conflict check
* removes unused wfs attribute from AbstractWFSFetcher
* adds/updates translations
This commit is contained in:
2022-01-05 14:13:26 +01:00
parent b43beffc6b
commit 49859d17d2
20 changed files with 183 additions and 75 deletions

View File

@@ -278,7 +278,7 @@ class Intervention(BaseObject, ShareableObjectMixin, RecordableObjectMixin, Chec
"""
if not self.is_shared_with(request.user):
messages.info(request, DATA_UNSHARED_EXPLANATION)
request = self._set_geometry_conflict_message(request)
request = self.set_geometry_conflict_message(request)
return request

View File

@@ -127,7 +127,10 @@
{% include 'map/geom_form.html' %}
</div>
<div class="row">
{% include 'konova/comment_card.html' %}
{% include 'konova/includes/parcels.html' %}
</div>
<div class="row">
{% include 'konova/includes/comment_card.html' %}
</div>
</div>
</div>

View File

@@ -236,6 +236,8 @@ def detail_view(request: HttpRequest, id: str):
instance=intervention,
)
parcels = intervention.get_underlying_parcels()
# Inform user about revocation
if intervention.legal.revocations.exists():
messages.error(
@@ -249,6 +251,7 @@ def detail_view(request: HttpRequest, id: str):
"compensations": compensations,
"has_access": is_data_shared,
"geom_form": geom_form,
"parcels": parcels,
"is_default_member": in_group(_user, DEFAULT_GROUP),
"is_zb_member": in_group(_user, ZB_GROUP),
"is_ets_member": in_group(_user, ETS_GROUP),