diff --git a/frappe/templates/includes/login/login.js b/frappe/templates/includes/login/login.js index 3af48b4b53..8365947e6c 100644 --- a/frappe/templates/includes/login/login.js +++ b/frappe/templates/includes/login/login.js @@ -195,6 +195,7 @@ login.login_handlers = (function () { 200: function (data) { if (data.message == 'Logged In') { login.set_status('{{ _("Success") }}', 'green'); + document.body.innerHTML = `{% include "templates/includes/splash_screen.html" %}`; window.location.href = frappe.utils.sanitise_redirect(frappe.utils.get_url_arg("redirect-to")) || data.home_page; } else if (data.message == 'Password Reset') { window.location.href = frappe.utils.sanitise_redirect(data.redirect_to); diff --git a/frappe/templates/includes/splash_screen.html b/frappe/templates/includes/splash_screen.html new file mode 100644 index 0000000000..0cbd118dcd --- /dev/null +++ b/frappe/templates/includes/splash_screen.html @@ -0,0 +1,4 @@ +
+ +
\ No newline at end of file diff --git a/frappe/www/app.html b/frappe/www/app.html index a5beead3b6..204b7d841e 100644 --- a/frappe/www/app.html +++ b/frappe/www/app.html @@ -26,10 +26,7 @@ {% include "public/icons/timeless/icons.svg" %} -
- -
+ {% include "templates/includes/splash_screen.html" %}
@@ -45,7 +42,7 @@ if (!window.frappe) window.frappe = {}; - frappe.boot = {{ boot }}; + frappe.boot = JSON.parse({{ boot }}); frappe._messages = frappe.boot["__messages"]; frappe.csrf_token = "{{ csrf_token }}"; diff --git a/frappe/www/app.py b/frappe/www/app.py index 9a8c80d6b1..0447d00f89 100644 --- a/frappe/www/app.py +++ b/frappe/www/app.py @@ -2,6 +2,7 @@ # License: MIT. See LICENSE no_cache = 1 +import json import os import re @@ -32,13 +33,14 @@ def get_context(context): frappe.db.commit() - boot_json = frappe.as_json(boot) + boot_json = frappe.as_json(boot, indent=None, separators=(",", ":")) # remove script tags from boot boot_json = SCRIPT_TAG_PATTERN.sub("", boot_json) # TODO: Find better fix boot_json = CLOSING_SCRIPT_TAG_PATTERN.sub("", boot_json) + boot_json = json.dumps(boot_json) context.update( {