diff --git a/frappe/__init__.py b/frappe/__init__.py index e711de4c40..54ddd591e3 100644 --- a/frappe/__init__.py +++ b/frappe/__init__.py @@ -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 diff --git a/frappe/app.py b/frappe/app.py index dd5aa458f7..79cfdfe442 100644 --- a/frappe/app.py +++ b/frappe/app.py @@ -166,7 +166,7 @@ def handle_exception(e): frappe.respond_as_web_page("Server Error", traceback, http_status_code=http_status_code, - indicator_color='red') + indicator_color='red', width=640) return_as_message = True if e.__class__ == frappe.AuthenticationError: diff --git a/frappe/templates/includes/navbar/navbar_login.html b/frappe/templates/includes/navbar/navbar_login.html index 132b7e694f..8bc8444c99 100644 --- a/frappe/templates/includes/navbar/navbar_login.html +++ b/frappe/templates/includes/navbar/navbar_login.html @@ -20,6 +20,7 @@ {%- endif -%} {%- endfor -%} +
{% if not hide_login %} diff --git a/frappe/website/js/website.js b/frappe/website/js/website.js index 2ff96ef1f6..0d50c85b9c 100644 --- a/frappe/website/js/website.js +++ b/frappe/website/js/website.js @@ -322,6 +322,9 @@ $.extend(frappe, { }, is_user_logged_in: function() { return window.full_name ? true : false; + }, + add_switch_to_desk: function() { + $('.switch-to-desk').removeClass('hidden'); } }); @@ -372,10 +375,7 @@ $(document).ready(function() { // switch to app link if(getCookie("system_user")==="yes" && logged_in) { - $("#website-post-login .dropdown-menu").append('