|
|
@@ -1022,7 +1022,8 @@ def compare(val1, condition, val2): |
|
|
|
return frappe.utils.compare(val1, condition, val2) |
|
|
|
|
|
|
|
def respond_as_web_page(title, html, success=None, http_status_code=None, |
|
|
|
context=None, indicator_color=None, primary_action='/', primary_label = None, fullpage=False): |
|
|
|
context=None, indicator_color=None, primary_action='/', primary_label = None, fullpage=False, |
|
|
|
width=None): |
|
|
|
"""Send response as a web page with a message rather than JSON. Used to show permission errors etc. |
|
|
|
|
|
|
|
:param title: Page title and heading. |
|
|
@@ -1033,7 +1034,9 @@ def respond_as_web_page(title, html, success=None, http_status_code=None, |
|
|
|
:param indicator_color: color of indicator in title |
|
|
|
:param primary_action: route on primary button (default is `/`) |
|
|
|
:param primary_label: label on primary button (defaut is "Home") |
|
|
|
:param fullpage: hide header / footer""" |
|
|
|
:param fullpage: hide header / footer |
|
|
|
:param width: Width of message in pixels |
|
|
|
""" |
|
|
|
local.message_title = title |
|
|
|
local.message = html |
|
|
|
local.response['type'] = 'page' |
|
|
@@ -1057,6 +1060,8 @@ def respond_as_web_page(title, html, success=None, http_status_code=None, |
|
|
|
context['primary_action'] = primary_action |
|
|
|
context['error_code'] = http_status_code |
|
|
|
context['fullpage'] = fullpage |
|
|
|
if width: |
|
|
|
context['card_width'] = width |
|
|
|
|
|
|
|
local.response['context'] = context |
|
|
|
|
|
|
|