diff --git a/frappe/public/js/frappe/ui/toolbar/about.js b/frappe/public/js/frappe/ui/toolbar/about.js index 9a52f45a74..242546f762 100644 --- a/frappe/public/js/frappe/ui/toolbar/about.js +++ b/frappe/public/js/frappe/ui/toolbar/about.js @@ -1,78 +1,156 @@ frappe.provide("frappe.ui.misc"); frappe.ui.misc.about = function () { - if (!frappe.ui.misc.about_dialog) { - var d = new frappe.ui.Dialog({ title: __("Frappe Framework") }); - - $(d.body).html( - repl( - `
${__("Open Source Applications for the Web")}
-- ${__("Website")}: - https://frappeframework.com
-- ${__("Source")}: - https://github.com/frappe
-- Frappe School: https://frappe.school
-- Linkedin: https://linkedin.com/company/frappe-tech
-- Twitter: https://twitter.com/frappetech
-- YouTube: https://www.youtube.com/@frappetech
-- - - ${__("Dependencies & Licenses")} - - -
-${__("© Frappe Technologies Pvt. Ltd. and contributors")}
-{0}: v{1} ({2})
{0}: v{1}
${__("Open Source Applications for the Web")}
+ ++ + ${__("Website")}: + https://frappe.io/ +
+ ++ + ${__("Source Code")}: + https://github.com/frappe +
+ ++ + ${__("Frappe Blog")}: + https://frappe.io/blog +
+ ++ + ${__("Frappe Forum")}: + https://discuss.frappe.io +
+ ++ + ${__("LinkedIn")}: + https://linkedin.com/company/frappe-tech +
+ ++ + X: + https://x.com/frappetech +
+ ++ + ${__("YouTube")}: + https://www.youtube.com/@frappetech +
+ ++ + ${__("Instagram")}: + https://www.instagram.com/frappetech +
+ ++ + + ${__("Dependencies & Licenses")} + + +
+ +${__("© Frappe Technologies Pvt. Ltd. and contributors")}
++ ${app.title}: ${get_version_text(app)} +
`; + $(text).appendTo($wrap); + } + + frappe.versions = versions; + + if (frappe.versions) { + $(dialog.body).find("#copy-apps-info").removeClass("hidden"); + } + }; + + const code_block = (snippet, lang = "") => "```" + lang + "\n" + snippet + "\n```"; + + // Listener for copying installed apps info + $(dialog.body).on("click", "#copy-apps-info", function () { + if (!frappe.versions) return; + + const versions = Object.entries(frappe.versions).reduce((acc, [key, app]) => { + acc[key] = app.branch_version || app.version; + return acc; + }, {}); + + frappe.utils.copy_to_clipboard(code_block(JSON.stringify(versions, null, "\t"), "json")); + }); + + // Listener for copy app version + $(dialog.body).on("click", ".app-version", function () { + const title = $(this).attr("title"); + if (title) { + frappe.utils.copy_to_clipboard(title); + } + }); + frappe.ui.misc.about_dialog.show(); };