Intervention Detail View

* adds hint for empty map in case of missing geometry
* adds empty geometry workaround, so openlayers is rendered without digitalization tools
* adds translations
This commit is contained in:
mipel
2021-07-22 16:06:13 +02:00
parent a304f8d42e
commit eaa9c43afe
5 changed files with 44 additions and 31 deletions

View File

@@ -122,6 +122,9 @@
</div>
</div>
<div class="col-sm-12 col-md-12 col-lg-6">
{% if geom_form.area == 0 %}
<div class="alert alert-info">{% trans 'No geometry added, yet.' %}</div>
{% endif %}
{{geom_form.media}}
{{geom_form.geom}}
</div>

View File

@@ -88,9 +88,6 @@ def open_view(request: HttpRequest, id: str):
intervention = get_object_or_404(Intervention, id=id)
has_access = intervention.has_access(user=request.user)
if not has_access:
messages.info(request, _("Remember: This data has not been shared with you, yet. This means you can only read but can not edit or perform any actions like running a check or recording."))
geom_form = SimpleGeomForm(
instance=intervention
)
@@ -100,6 +97,10 @@ def open_view(request: HttpRequest, id: str):
"has_access": has_access,
"geom_form": geom_form,
}
if not has_access:
messages.info(request, _("Remember: This data has not been shared with you, yet. This means you can only read but can not edit or perform any actions like running a check or recording."))
context = BaseContext(request, context).context
return render(request, template, context)