Intervention template adjustments

* renames intervention variable to obj to match other template style
* renames open routes to detail routes
This commit is contained in:
2021-10-13 09:26:46 +02:00
parent 337d7b39e7
commit efe26ae6f5
24 changed files with 87 additions and 87 deletions

View File

@@ -99,7 +99,7 @@ class EditEmaForm(NewEmaForm):
self.form_title = _("Edit EMA")
self.action_url = reverse("ema:edit", args=(self.instance.id,))
self.cancel_redirect = reverse("ema:open", args=(self.instance.id,))
self.cancel_redirect = reverse("ema:detail", args=(self.instance.id,))
self.fields["identifier"].widget.attrs["url"] = reverse_lazy("ema:new-id")
self.fields["title"].widget.attrs["placeholder"] = _("Compensation XY; Location ABC")

View File

@@ -80,7 +80,7 @@ class EmaTable(BaseTable):
html = ""
html += self.render_link(
tooltip=_("Open {}").format(_("EMA")),
href=reverse("ema:open", args=(record.id,)),
href=reverse("ema:detail", args=(record.id,)),
txt=value,
new_tab=False,
)

View File

@@ -13,7 +13,7 @@ urlpatterns = [
path("", index_view, name="index"),
path("new/", new_view, name="new"),
path("new/id", new_id_view, name="new-id"),
path("<id>", open_view, name="open"),
path("<id>", detail_view, name="detail"),
path('<id>/log', log_view, name='log'),
path('<id>/edit', edit_view, name='edit'),
path('<id>/remove', remove_view, name='remove'),

View File

@@ -75,7 +75,7 @@ def new_view(request: HttpRequest):
)
)
messages.success(request, _("EMA {} added").format(ema.identifier))
return redirect("ema:open", id=ema.id)
return redirect("ema:detail", id=ema.id)
else:
messages.error(request, FORM_INVALID)
else:
@@ -108,7 +108,7 @@ def new_id_view(request: HttpRequest):
@login_required
def open_view(request: HttpRequest, id: str):
def detail_view(request: HttpRequest, id: str):
""" Renders the detail view of an EMA
Args:
@@ -199,7 +199,7 @@ def edit_view(request: HttpRequest, id: str):
# The data form takes the geom form for processing, as well as the performing user
ema = data_form.save(request.user, geom_form)
messages.success(request, _("EMA {} edited").format(ema.identifier))
return redirect("ema:open", id=ema.id)
return redirect("ema:detail", id=ema.id)
else:
messages.error(request, FORM_INVALID)
else: