#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

@@ -106,7 +106,7 @@ class Ema(AbstractCompensation, ShareableObjectMixin, RecordableObjectMixin):
"""
if not self.is_shared_with(request.user):
messages.info(request, DATA_UNSHARED_EXPLANATION)
self._set_geometry_conflict_message(request)
self.set_geometry_conflict_message(request)
return request

View File

@@ -77,7 +77,15 @@
</div>
</div>
<div class="col-sm-12 col-md-12 col-lg-6">
<div class="row">
{% include 'map/geom_form.html' %}
</div>
<div class="row">
{% include 'konova/includes/parcels.html' %}
</div>
<div class="row">
{% include 'konova/includes/comment_card.html' %}
</div>
</div>
</div>
<hr>

View File

@@ -125,6 +125,7 @@ def detail_view(request: HttpRequest, id: str):
ema = get_object_or_404(Ema, id=id, deleted=None)
geom_form = SimpleGeomForm(instance=ema)
parcels = ema.get_underlying_parcels()
_user = request.user
is_data_shared = ema.is_shared_with(_user)
@@ -143,6 +144,7 @@ def detail_view(request: HttpRequest, id: str):
context = {
"obj": ema,
"geom_form": geom_form,
"parcels": parcels,
"has_access": is_data_shared,
"before_states": before_states,
"after_states": after_states,