* adds modal_generic.html template for generic usage
* adds M2M field log to BaseObject
* adds show log button to controls.html
* adds logging on adding related objects
* adds render log table using generic modal
* adds tooltip to missing values in detail views
* adds/updates translations
This commit is contained in:
mipel
2021-08-05 12:54:28 +02:00
parent f69d98460f
commit 5efa755188
18 changed files with 368 additions and 146 deletions

View File

@@ -370,3 +370,25 @@ def new_revocation_view(request: HttpRequest, id: str):
raise NotImplementedError
@login_required
def log_view(request: HttpRequest, id: str):
""" Renders a log view using modal
Args:
request (HttpRequest): The incoming request
id (str): The compensation's id
Returns:
"""
intervention = get_object_or_404(Intervention, id=id)
template = "modal/modal_generic.html"
body_template = "log.html"
context = {
"modal_body_template": body_template,
"log": intervention.log.all().order_by("-timestamp"),
"modal_title": _("Log"),
}
context = BaseContext(request, context).context
return render(request, template, context)