88 lines
3.8 KiB
HTML
88 lines
3.8 KiB
HTML
<form class="signup-form" role="form">
|
|
<div class="page-card-body">
|
|
<div class="form-group">
|
|
<label class="form-label sr-only" for="signup_fullname"></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>
|
|
|
|
{% if frappe.db.get_single_value("LMS Settings", "designation") %}
|
|
<div class="form-group">
|
|
<label class="form-label sr-only">Designation</label>
|
|
<div class="control-input-wrapper">
|
|
<div class="control-input flex align-center">
|
|
<select type="text" id="designation" data-fieldname="designation" style="color: var(--text-color)"
|
|
class="input-with-feedback form-control ellipsis" data-fieldtype="Select" required>
|
|
<option value=""> {{ _("Designation") }} </option>
|
|
<option value="CEO/Founder/GM"> {{ _("CEO/Founder/GM") }} </option>
|
|
<option value="CFO">CFO</option><option value="CTO/CIO"> {{ _("CTO/CIO") }} </option>
|
|
<option value="Vice president"> {{ _("Vice president") }} </option>
|
|
<option value="Director/Head of Department"> {{ _("Director/Head of Department") }} </option>
|
|
<option value="IT/System manager"> {{ _("IT/System manager") }} </option>
|
|
<option value="Manager (Sales/Marketing/Customer)"> {{ _("Manager (Sales/Marketing/Customer)") }} </option>
|
|
<option value="Developer/Analyst"> {{ _("Developer/Analyst") }} </option>
|
|
<option value="Student/Freelancer/Just looking"> {{ _("Student/Freelancer/Just looking") }} </option>
|
|
<option value="Others"> {{ _("Others") }} </option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<div class="form-group">
|
|
<div class="checkbox">
|
|
<label>
|
|
<span class="input-area">
|
|
<input type="checkbox" autocomplete="off" class="input-with-feedback"
|
|
data-fieldtype="Check" data-fieldname="terms" id="signup-terms" required>
|
|
</span>
|
|
<span class="label-area">
|
|
{{ _("I have read and agree to your {0}").format(get_signup_optin_checks()) }}
|
|
</span>
|
|
</label>
|
|
<p class="help-box small text-muted"></p>
|
|
</div>
|
|
</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>
|
|
|
|
<script>
|
|
frappe.ready(function () {
|
|
$(".signup-form").on("submit", function (e) {
|
|
e.preventDefault();
|
|
const email = ($("#signup_email").val() || "").trim();
|
|
const full_name = frappe.utils.xss_sanitise(($("#signup_fullname").val() || "").trim());
|
|
|
|
if (!email || !validate_email(email) || !full_name) {
|
|
login.set_status('{{ _("Valid email and name required") }}', 'red');
|
|
return false;
|
|
}
|
|
|
|
frappe.call({
|
|
method: "lms.overrides.user.sign_up",
|
|
args: {
|
|
"email": email,
|
|
"full_name": full_name,
|
|
"verify_terms": $("#signup-terms").prop("checked") ? 1 : 0,
|
|
"designation": $("#designation").val()
|
|
},
|
|
statusCode: login.login_handlers
|
|
})
|
|
return false;
|
|
});
|
|
});
|
|
</script>
|