From d19973a357bdb942caf523cdfadefc4510bbe3dc Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Fri, 9 Oct 2020 11:27:18 +0530 Subject: [PATCH 01/55] fix: Support for multi-site list-apps summary --- frappe/commands/site.py | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/frappe/commands/site.py b/frappe/commands/site.py index 1f4642658f..d4fcaba3b5 100755 --- a/frappe/commands/site.py +++ b/frappe/commands/site.py @@ -226,11 +226,26 @@ def install_app(context, apps): @pass_context def list_apps(context): "List apps in site" - site = get_site(context) - frappe.init(site=site) - frappe.connect() - print("\n".join(frappe.get_installed_apps())) - frappe.destroy() + import click + titled = False + + if len(context.sites) > 1: + titled = True + + for site in context.sites: + frappe.init(site=site) + frappe.connect() + apps = sorted(frappe.get_installed_apps()) + + if titled: + summary = "{}{}".format(click.style(site + ": ", fg="green"), ", ".join(apps)) + else: + summary = "\n".join(apps) + + if apps and summary.strip(): + print(summary) + + frappe.destroy() @click.command('add-system-manager') @click.argument('email') From 5c5703b8f68c2a76e000f4712a5e60fa501fba57 Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Fri, 9 Oct 2020 11:31:18 +0530 Subject: [PATCH 02/55] feat: Show apps excluding frappe using --only-apps --- frappe/commands/site.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frappe/commands/site.py b/frappe/commands/site.py index d4fcaba3b5..189d6eedd4 100755 --- a/frappe/commands/site.py +++ b/frappe/commands/site.py @@ -223,8 +223,9 @@ def install_app(context, apps): @click.command('list-apps') +@click.option('--only-apps', is_flag=True) @pass_context -def list_apps(context): +def list_apps(context, only_apps): "List apps in site" import click titled = False @@ -237,6 +238,9 @@ def list_apps(context): frappe.connect() apps = sorted(frappe.get_installed_apps()) + if only_apps: + apps.remove("frappe") + if titled: summary = "{}{}".format(click.style(site + ": ", fg="green"), ", ".join(apps)) else: From b0bb781125fd649fbeb7ba39ef69e530f72873c2 Mon Sep 17 00:00:00 2001 From: Sagar Vora Date: Fri, 23 Oct 2020 13:33:05 +0530 Subject: [PATCH 03/55] fix(website): replace target field in Top Bar Item table with a checkbox --- frappe/patches.txt | 2 + ...place_field_target_with_open_in_new_tab.py | 11 ++ .../includes/footer/footer_grouped_links.html | 3 +- .../includes/footer/footer_links.html | 2 +- .../includes/navbar/dropdown_login.html | 2 +- .../includes/navbar/navbar_items.html | 4 +- .../includes/navbar/navbar_login.html | 2 +- .../website/doctype/footer_item/__init__.py | 0 .../doctype/footer_item/footer_item.json | 146 ------------------ .../doctype/footer_item/footer_item.py | 10 -- .../doctype/top_bar_item/top_bar_item.json | 22 +-- 11 files changed, 31 insertions(+), 173 deletions(-) create mode 100644 frappe/patches/v13_0/replace_field_target_with_open_in_new_tab.py delete mode 100644 frappe/website/doctype/footer_item/__init__.py delete mode 100644 frappe/website/doctype/footer_item/footer_item.json delete mode 100644 frappe/website/doctype/footer_item/footer_item.py diff --git a/frappe/patches.txt b/frappe/patches.txt index 05f067f4b9..bef780e092 100644 --- a/frappe/patches.txt +++ b/frappe/patches.txt @@ -313,3 +313,5 @@ frappe.patches.v13_0.update_newsletter_content_type execute:frappe.db.set_value('Website Settings', 'Website Settings', {'navbar_template': 'Standard Navbar', 'footer_template': 'Standard Footer'}) frappe.patches.v13_0.delete_event_producer_and_consumer_keys frappe.patches.v13_0.web_template_set_module #2020-10-05 +execute:frappe.delete_doc("DocType", "Footer Item") +frappe.patches.v13_0.replace_field_target_with_open_in_new_tab diff --git a/frappe/patches/v13_0/replace_field_target_with_open_in_new_tab.py b/frappe/patches/v13_0/replace_field_target_with_open_in_new_tab.py new file mode 100644 index 0000000000..21b2d8ef03 --- /dev/null +++ b/frappe/patches/v13_0/replace_field_target_with_open_in_new_tab.py @@ -0,0 +1,11 @@ +import frappe + + +def execute(): + doctype = "Top Bar Item" + if not frappe.db.table_exists(doctype) \ + or not frappe.db.has_column(doctype, "target"): + return + + frappe.reload_doc("website", "doctype", "top_bar_item") + frappe.db.set_value(doctype, {"target": 'target = "_blank"'}, 'open_in_new_tab', 1) diff --git a/frappe/templates/includes/footer/footer_grouped_links.html b/frappe/templates/includes/footer/footer_grouped_links.html index 06fa777a40..350f20af81 100644 --- a/frappe/templates/includes/footer/footer_grouped_links.html +++ b/frappe/templates/includes/footer/footer_grouped_links.html @@ -15,7 +15,8 @@