add place holder in login.py and then use in templateversion-14
@@ -16,17 +16,7 @@ | |||||
</div> | </div> | ||||
<input type="text" id="login_email" | <input type="text" id="login_email" | ||||
class="form-control" placeholder="{{ | |||||
_('Email address or Mobile number or Username') | |||||
if frappe.utils.cint(frappe.db.get_value('System Settings', 'System Settings', 'allow_login_using_mobile_number')) and frappe.utils.cint(frappe.db.get_value('System Settings', 'System Settings', 'allow_login_using_user_name')) | |||||
else ( | |||||
_('Email address or Username') | |||||
if frappe.utils.cint(frappe.db.get_value('System Settings', 'System Settings', 'allow_login_using_user_name')) | |||||
else ( | |||||
_('Email address or Mobile number') | |||||
if frappe.utils.cint(frappe.db.get_value('System Settings', 'System Settings', 'allow_login_using_mobile_number')) | |||||
else _('Email address')) | |||||
) }}" | |||||
class="form-control" placeholder="{{ login_name_placeholder }}" | |||||
required autofocus> | required autofocus> | ||||
@@ -31,6 +31,16 @@ def get_context(context): | |||||
ldap_settings = get_ldap_settings() | ldap_settings = get_ldap_settings() | ||||
context["ldap_settings"] = ldap_settings | context["ldap_settings"] = ldap_settings | ||||
login_name_placeholder = "Email address" | |||||
if frappe.utils.cint(frappe.db.get_value("System Settings", "System Settings", "allow_login_using_mobile_number")): | |||||
login_name_placeholder += " or Mobile number" | |||||
if frappe.utils.cint(frappe.db.get_value("System Settings", "System Settings", "allow_login_using_user_name")): | |||||
login_name_placeholder += " or Username" | |||||
context['login_name_placeholder'] = login_name_placeholder | |||||
return context | return context | ||||
@frappe.whitelist(allow_guest=True) | @frappe.whitelist(allow_guest=True) | ||||