def render_modal_workflow(request, html_template, js_template, template_vars=None):
 response_keyvars = []
 if html_template:
  html = render_to_string(html_template, (template_vars or {}), request=request)
  response_keyvars.append((u"'html': %s" % json.dumps(html)))
 if js_template:
  js = render_to_string(js_template, (template_vars or {}), request=request)
  response_keyvars.append((u"'onload': %s" % js))
 response_text = (u'{%s}' % u','.join(response_keyvars))
 return HttpResponse(response_text, content_type=u'text/javascript')

def render_modal_workflow ( request , html_template , js_template , template_vars = None ) : response_keyvars = [ ] if html_template : html = render_to_string ( html_template , ( template_vars or { } ) , request = request ) response_keyvars . append ( ( u"'html': %s" % json . dumps ( html ) ) ) if js_template : js = render_to_string ( js_template , ( template_vars or { } ) , request = request ) response_keyvars . append ( ( u"'onload': %s" % js ) ) response_text = ( u'{%s}' % u',' . join ( response_keyvars ) ) return HttpResponse ( response_text , content_type = u'text/javascript' )
render a response consisting of an html chunk and a js onload chunk in the format required by the modal-workflow framework .