diff --git a/frappe/public/js/frappe/change_log.html b/frappe/public/js/frappe/change_log.html index c05aadfe27..fce6539abc 100644 --- a/frappe/public/js/frappe/change_log.html +++ b/frappe/public/js/frappe/change_log.html @@ -6,11 +6,13 @@ {{ app_info.title }} {{ __("updated to {0}", [app_info.version]) }} +
{% for (var x=0, y=app_info.change_log.length; x < y; x++) { var version_info = app_info.change_log[x]; if(version_info) { %}

{{ frappe.markdown(version_info[1]) }}

{% } } %} +
{% } %} diff --git a/frappe/public/js/frappe/desk.js b/frappe/public/js/frappe/desk.js index 92194acdca..23d7bffec2 100644 --- a/frappe/public/js/frappe/desk.js +++ b/frappe/public/js/frappe/desk.js @@ -466,12 +466,27 @@ frappe.Application = Class.extend({ show_change_log: function() { var me = this; - var d = frappe.msgprint( - frappe.render_template("change_log", {"change_log": frappe.boot.change_log}), - __("Updated To New Version") - ); - d.keep_open = true; - d.custom_onhide = function() { + let change_log = frappe.boot.change_log; + + // frappe.boot.change_log = [{ + // "change_log": [ + // [, ], + // [, ], + // ], + // "description": "ERP made simple", + // "title": "ERPNext", + // "version": "12.2.0" + // }]; + + // Iterate over changelog + var change_log_dialog = frappe.msgprint({ + message: frappe.render_template("change_log", {"change_log": change_log}), + title: __("Updated To New Version 🎉"), + wide: true, + scroll: true + }); + change_log_dialog.keep_open = true; + change_log_dialog.custom_onhide = function() { frappe.call({ "method": "frappe.utils.change_log.update_last_known_versions" }); diff --git a/frappe/public/js/frappe/ui/messages.js b/frappe/public/js/frappe/ui/messages.js index 08711a8237..2265203ef9 100644 --- a/frappe/public/js/frappe/ui/messages.js +++ b/frappe/public/js/frappe/ui/messages.js @@ -207,6 +207,15 @@ frappe.msgprint = function(msg, title) { frappe.msg_dialog.wrapper.classList.add('msgprint-dialog'); } + if (data.scroll) { + // limit modal height and allow scrolling instead + frappe.msg_dialog.body.classList.add('msgprint-scroll'); + } else { + if (frappe.msg_dialog.body.classList.contains('msgprint-scroll')) { + frappe.msg_dialog.body.classList.remove('msgprint-scroll'); + } + } + if(msg_exists) { frappe.msg_dialog.msg_area.append("
"); diff --git a/frappe/public/less/common.less b/frappe/public/less/common.less index d6dc56cf6c..b0aca5cb47 100644 --- a/frappe/public/less/common.less +++ b/frappe/public/less/common.less @@ -157,6 +157,11 @@ a.badge-hover& { } } +.msgprint-scroll { + max-height: 36em; + overflow: scroll; +} + .msgprint { // margin: 15px 0px; // text-align: center; diff --git a/frappe/public/less/desk.less b/frappe/public/less/desk.less index 0a8062efa2..fa29d7d788 100644 --- a/frappe/public/less/desk.less +++ b/frappe/public/less/desk.less @@ -1137,3 +1137,9 @@ body.no-sidebar { .alt-pressed .alt-underline { text-decoration: underline; } + +.app-change-log-body { + h1 { + font-size: 20px; + } +}