Merge pull request #14020 from rmehta/login-page-options

feat(minor): Added app_name and app_logo in Website Settings
This commit is contained in:
Rushabh Mehta 2021-08-23 21:45:01 +05:30 committed by GitHub
commit 52d58ae958
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 8 deletions

View file

@ -56,9 +56,11 @@
"google_analytics_id",
"google_analytics_anonymize_ip",
"misc_section",
"subdomain",
"app_name",
"app_logo",
"disable_signup",
"section_break_38",
"subdomain",
"head_html",
"robots_txt",
"route_redirects",
@ -224,7 +226,7 @@
"collapsible": 1,
"fieldname": "misc_section",
"fieldtype": "Section Break",
"label": "Disable Signup"
"label": "Login Page"
},
{
"description": "An icon file with .ico extension. Should be 16 x 16 px. Generated using a favicon generator. [favicon-generator.org]",
@ -235,7 +237,7 @@
{
"description": "Sub-domain provided by erpnext.com",
"fieldname": "subdomain",
"fieldtype": "Text",
"fieldtype": "Small Text",
"label": "Subdomain",
"read_only": 1
},
@ -425,6 +427,17 @@
"fieldname": "navbar_template_section",
"fieldtype": "Section Break",
"label": "Navbar Template"
},
{
"default": "Frappe",
"fieldname": "app_name",
"fieldtype": "Data",
"label": "App Name"
},
{
"fieldname": "app_logo",
"fieldtype": "Attach Image",
"label": "App Logo"
}
],
"icon": "fa fa-cog",
@ -433,7 +446,7 @@
"issingle": 1,
"links": [],
"max_attachments": 10,
"modified": "2021-07-15 17:39:56.609771",
"modified": "2021-08-23 21:39:51.702248",
"modified_by": "Administrator",
"module": "Website",
"name": "Website Settings",
@ -457,4 +470,4 @@
"sort_field": "modified",
"sort_order": "ASC",
"track_changes": 1
}
}

View file

@ -34,9 +34,11 @@ def get_context(context):
context.for_test = 'login.html'
context["title"] = "Login"
context["provider_logins"] = []
context["disable_signup"] = frappe.utils.cint(frappe.db.get_value("Website Settings", "Website Settings", "disable_signup"))
context["logo"] = frappe.get_hooks("app_logo_url")[-1]
context["app_name"] = frappe.get_system_settings("app_name") or _("Frappe")
context["disable_signup"] = frappe.utils.cint(frappe.db.get_single_value("Website Settings", "disable_signup"))
context["logo"] = (frappe.db.get_single_value('Website Settings', 'app_logo') or
frappe.get_hooks("app_logo_url")[-1])
context["app_name"] = (frappe.db.get_single_value('Website Settings', 'app_name') or
frappe.get_system_settings("app_name") or _("Frappe"))
providers = [i.name for i in frappe.get_all("Social Login Key", filters={"enable_social_login":1}, order_by="name")]
for provider in providers:
client_id, base_url = frappe.get_value("Social Login Key", provider, ["client_id", "base_url"])