fix: renamed hook and moved template
This commit is contained in:
parent
fa4bccb284
commit
679c61531f
3 changed files with 33 additions and 31 deletions
22
frappe/templates/signup.html
Normal file
22
frappe/templates/signup.html
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
<form class="form-signin form-signup hide" role="form">
|
||||
<div class="page-card-body">
|
||||
<div class="form-group">
|
||||
<label class="form-label sr-only" for="signup_fullname">Full Name</label>
|
||||
<input type="text" id="signup_fullname" class="form-control" placeholder="{{ _('Jane Doe') }}"
|
||||
required autofocus>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-label sr-only" for="signup_email">Email</label>
|
||||
<input type="email" id="signup_email" class="form-control"
|
||||
placeholder="{{ _('jane@example.com') }}" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="page-card-actions">
|
||||
<button class="btn btn-sm btn-primary btn-block btn-signup"
|
||||
type="submit">{{ _("Sign up") }}</button>
|
||||
|
||||
<p class="text-center sign-up-message">
|
||||
<a href="#login" class="blue">{{ _("Have an account? Login") }}</a>
|
||||
</p>
|
||||
</div>
|
||||
</form>
|
||||
|
|
@ -131,34 +131,7 @@
|
|||
<div class="login-content page-card">
|
||||
{{ logo_section() }}
|
||||
{%- if not disable_signup -%}
|
||||
|
||||
{% if custom_signup_form %}
|
||||
{{ custom_signup_form }}
|
||||
{% else %}
|
||||
<form class="form-signin form-signup hide" role="form">
|
||||
<div class="page-card-body">
|
||||
<div class="form-group">
|
||||
<label class="form-label sr-only" for="signup_fullname">Full Name</label>
|
||||
<input type="text" id="signup_fullname" class="form-control" placeholder="{{ _('Jane Doe') }}"
|
||||
required autofocus>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-label sr-only" for="signup_email">Email</label>
|
||||
<input type="email" id="signup_email" class="form-control"
|
||||
placeholder="{{ _('jane@example.com') }}" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="page-card-actions">
|
||||
<button class="btn btn-sm btn-primary btn-block btn-signup"
|
||||
type="submit">{{ _("Sign up") }}</button>
|
||||
|
||||
<p class="text-center sign-up-message">
|
||||
<a href="#login" class="blue">{{ _("Have an account? Login") }}</a>
|
||||
</p>
|
||||
</div>
|
||||
</form>
|
||||
{% endif %}
|
||||
|
||||
{{ signup_form_template }}
|
||||
{%- else -%}
|
||||
<div class='page-card-head mb-2'>
|
||||
<span class='indicator gray'>{{_("Signup Disabled")}}</span>
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ from frappe.utils.password import get_decrypted_password
|
|||
from frappe.utils.html_utils import get_icon_html
|
||||
from frappe.integrations.oauth2_logins import decoder_compat
|
||||
from frappe.website.utils import get_home_page
|
||||
from frappe.utils.jinja import guess_is_path
|
||||
|
||||
no_cache = True
|
||||
|
||||
|
|
@ -40,9 +41,15 @@ def get_context(context):
|
|||
context["app_name"] = (frappe.db.get_single_value('Website Settings', 'app_name') or
|
||||
frappe.get_system_settings("app_name") or _("Frappe"))
|
||||
|
||||
custom_signup = frappe.get_hooks("custom_signup_form")
|
||||
if custom_signup and len(custom_signup) and custom_signup[0]:
|
||||
context["custom_signup_form"] = frappe.get_template(custom_signup[0]).render()
|
||||
signup_form_template = frappe.get_hooks("signup_form_template")
|
||||
if signup_form_template and len(signup_form_template) and signup_form_template[0]:
|
||||
path = signup_form_template[0]
|
||||
if not guess_is_path(path):
|
||||
path = frappe.get_attr(signup_form_template[0])()
|
||||
else:
|
||||
path = "frappe/templates/signup.html"
|
||||
if path:
|
||||
context["signup_form_template"] = frappe.get_template(path).render()
|
||||
|
||||
providers = [i.name for i in frappe.get_all("Social Login Key", filters={"enable_social_login":1}, order_by="name")]
|
||||
for provider in providers:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue