Initial commit

This commit is contained in:
2024-08-27 20:33:44 +02:00
commit 1f1832267d
14794 changed files with 1599592 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
from django.http import JsonResponse
from django.template.loader import render_to_string
def render_modal_workflow(
request, html_template, js_template=None, template_vars=None, json_data=None
):
""" "
Render a response consisting of an HTML chunk and a JS onload chunk
in the format required by the modal-workflow framework.
"""
if js_template:
raise TypeError(
"Passing a js_template argument to render_modal_workflow is no longer supported"
)
# construct response as JSON
response = {}
if html_template:
response["html"] = render_to_string(
html_template, template_vars or {}, request=request
)
if json_data:
response.update(json_data)
return JsonResponse(response)