Merge pull request #324 from pateljannat/designation-during-signup
feat: Designation during signup
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
"in_preview": 0,
|
||||
"in_standard_filter": 0,
|
||||
"insert_after": "username",
|
||||
"is_system_generated": 1,
|
||||
"is_virtual": 0,
|
||||
"label": "Country",
|
||||
"length": 0,
|
||||
@@ -79,6 +80,7 @@
|
||||
"in_preview": 0,
|
||||
"in_standard_filter": 0,
|
||||
"insert_after": "country",
|
||||
"is_system_generated": 0,
|
||||
"is_virtual": 0,
|
||||
"label": "Acceptance for Terms and/or Policies",
|
||||
"length": 0,
|
||||
@@ -103,6 +105,59 @@
|
||||
"unique": 0,
|
||||
"width": null
|
||||
},
|
||||
{
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"collapsible_depends_on": null,
|
||||
"columns": 0,
|
||||
"default": null,
|
||||
"depends_on": null,
|
||||
"description": null,
|
||||
"docstatus": 0,
|
||||
"doctype": "Custom Field",
|
||||
"dt": "User",
|
||||
"fetch_from": null,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "designation",
|
||||
"fieldtype": "Select",
|
||||
"hidden": 0,
|
||||
"hide_border": 0,
|
||||
"hide_days": 0,
|
||||
"hide_seconds": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_preview": 0,
|
||||
"in_standard_filter": 0,
|
||||
"insert_after": "time_zone",
|
||||
"is_system_generated": 0,
|
||||
"is_virtual": 0,
|
||||
"label": "Designation",
|
||||
"length": 0,
|
||||
"mandatory_depends_on": null,
|
||||
"modified": "2022-04-19 13:02:18.219508",
|
||||
"module": "LMS",
|
||||
"name": "User-designation",
|
||||
"no_copy": 0,
|
||||
"non_negative": 0,
|
||||
"options": "CEO/Founder/GM\nCTO/CIO\nVice presiden\n\nDirector/Head of Department\nIT/System manager\nManager (Sales/Marketing/Customer)\nDeveloper/Analyst\nStudent/Freelancer/Just looking\nOthers",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"print_width": null,
|
||||
"read_only": 0,
|
||||
"read_only_depends_on": null,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"translatable": 1,
|
||||
"unique": 0,
|
||||
"width": null
|
||||
},
|
||||
{
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
@@ -131,6 +186,7 @@
|
||||
"in_preview": 0,
|
||||
"in_standard_filter": 0,
|
||||
"insert_after": "desk_theme",
|
||||
"is_system_generated": 1,
|
||||
"is_virtual": 0,
|
||||
"label": "College Name",
|
||||
"length": 0,
|
||||
@@ -183,6 +239,7 @@
|
||||
"in_preview": 0,
|
||||
"in_standard_filter": 0,
|
||||
"insert_after": "college",
|
||||
"is_system_generated": 1,
|
||||
"is_virtual": 0,
|
||||
"label": "Branch",
|
||||
"length": 0,
|
||||
@@ -235,6 +292,7 @@
|
||||
"in_preview": 0,
|
||||
"in_standard_filter": 0,
|
||||
"insert_after": "mute_sounds",
|
||||
"is_system_generated": 1,
|
||||
"is_virtual": 0,
|
||||
"label": "Headline",
|
||||
"length": 0,
|
||||
@@ -287,6 +345,7 @@
|
||||
"in_preview": 0,
|
||||
"in_standard_filter": 0,
|
||||
"insert_after": "headline",
|
||||
"is_system_generated": 1,
|
||||
"is_virtual": 0,
|
||||
"label": "City",
|
||||
"length": 0,
|
||||
@@ -339,6 +398,7 @@
|
||||
"in_preview": 0,
|
||||
"in_standard_filter": 0,
|
||||
"insert_after": "mobile_no",
|
||||
"is_system_generated": 1,
|
||||
"is_virtual": 0,
|
||||
"label": "LinkedIn ID",
|
||||
"length": 0,
|
||||
@@ -391,6 +451,7 @@
|
||||
"in_preview": 0,
|
||||
"in_standard_filter": 0,
|
||||
"insert_after": "linkedin",
|
||||
"is_system_generated": 1,
|
||||
"is_virtual": 0,
|
||||
"label": "Github ID",
|
||||
"length": 0,
|
||||
@@ -443,6 +504,7 @@
|
||||
"in_preview": 0,
|
||||
"in_standard_filter": 0,
|
||||
"insert_after": "github",
|
||||
"is_system_generated": 1,
|
||||
"is_virtual": 0,
|
||||
"label": "Medium ID",
|
||||
"length": 0,
|
||||
@@ -495,6 +557,7 @@
|
||||
"in_preview": 0,
|
||||
"in_standard_filter": 0,
|
||||
"insert_after": "medium",
|
||||
"is_system_generated": 1,
|
||||
"is_virtual": 0,
|
||||
"label": "Profession",
|
||||
"length": 0,
|
||||
@@ -547,6 +610,7 @@
|
||||
"in_preview": 0,
|
||||
"in_standard_filter": 0,
|
||||
"insert_after": "profession",
|
||||
"is_system_generated": 1,
|
||||
"is_virtual": 0,
|
||||
"label": "Education Details",
|
||||
"length": 0,
|
||||
@@ -599,6 +663,7 @@
|
||||
"in_preview": 0,
|
||||
"in_standard_filter": 0,
|
||||
"insert_after": "hide_private",
|
||||
"is_system_generated": 1,
|
||||
"is_virtual": 0,
|
||||
"label": "Profile Complete",
|
||||
"length": 0,
|
||||
@@ -651,6 +716,7 @@
|
||||
"in_preview": 0,
|
||||
"in_standard_filter": 0,
|
||||
"insert_after": "profession",
|
||||
"is_system_generated": 0,
|
||||
"is_virtual": 0,
|
||||
"label": "Hide my Private Information from others",
|
||||
"length": 0,
|
||||
@@ -703,6 +769,7 @@
|
||||
"in_preview": 0,
|
||||
"in_standard_filter": 0,
|
||||
"insert_after": "profile_complete",
|
||||
"is_system_generated": 1,
|
||||
"is_virtual": 0,
|
||||
"label": "Cover Image",
|
||||
"length": 0,
|
||||
@@ -755,6 +822,7 @@
|
||||
"in_preview": 0,
|
||||
"in_standard_filter": 0,
|
||||
"insert_after": "cover_image",
|
||||
"is_system_generated": 1,
|
||||
"is_virtual": 0,
|
||||
"label": "I am looking for a job",
|
||||
"length": 0,
|
||||
@@ -807,6 +875,7 @@
|
||||
"in_preview": 0,
|
||||
"in_standard_filter": 0,
|
||||
"insert_after": "education_details",
|
||||
"is_system_generated": 1,
|
||||
"is_virtual": 0,
|
||||
"label": "Education",
|
||||
"length": 0,
|
||||
@@ -859,6 +928,7 @@
|
||||
"in_preview": 0,
|
||||
"in_standard_filter": 0,
|
||||
"insert_after": "education",
|
||||
"is_system_generated": 1,
|
||||
"is_virtual": 0,
|
||||
"label": "Work Experience Details",
|
||||
"length": 0,
|
||||
@@ -911,6 +981,7 @@
|
||||
"in_preview": 0,
|
||||
"in_standard_filter": 0,
|
||||
"insert_after": "work_experience_details",
|
||||
"is_system_generated": 1,
|
||||
"is_virtual": 0,
|
||||
"label": "Work Experience",
|
||||
"length": 0,
|
||||
@@ -963,6 +1034,7 @@
|
||||
"in_preview": 0,
|
||||
"in_standard_filter": 0,
|
||||
"insert_after": "work_experience",
|
||||
"is_system_generated": 1,
|
||||
"is_virtual": 0,
|
||||
"label": "Volunteering or Internship",
|
||||
"length": 0,
|
||||
@@ -1015,6 +1087,7 @@
|
||||
"in_preview": 0,
|
||||
"in_standard_filter": 0,
|
||||
"insert_after": "internship",
|
||||
"is_system_generated": 1,
|
||||
"is_virtual": 0,
|
||||
"label": "Certification Details",
|
||||
"length": 0,
|
||||
@@ -1067,6 +1140,7 @@
|
||||
"in_preview": 0,
|
||||
"in_standard_filter": 0,
|
||||
"insert_after": "certification_details",
|
||||
"is_system_generated": 1,
|
||||
"is_virtual": 0,
|
||||
"label": "Certification",
|
||||
"length": 0,
|
||||
@@ -1119,6 +1193,7 @@
|
||||
"in_preview": 0,
|
||||
"in_standard_filter": 0,
|
||||
"insert_after": "certification",
|
||||
"is_system_generated": 1,
|
||||
"is_virtual": 0,
|
||||
"label": "Skill Details",
|
||||
"length": 0,
|
||||
@@ -1171,6 +1246,7 @@
|
||||
"in_preview": 0,
|
||||
"in_standard_filter": 0,
|
||||
"insert_after": "skill_details",
|
||||
"is_system_generated": 1,
|
||||
"is_virtual": 0,
|
||||
"label": "Skill",
|
||||
"length": 0,
|
||||
@@ -1223,6 +1299,7 @@
|
||||
"in_preview": 0,
|
||||
"in_standard_filter": 0,
|
||||
"insert_after": "skill",
|
||||
"is_system_generated": 1,
|
||||
"is_virtual": 0,
|
||||
"label": "Career Preference Details",
|
||||
"length": 0,
|
||||
@@ -1275,6 +1352,7 @@
|
||||
"in_preview": 0,
|
||||
"in_standard_filter": 0,
|
||||
"insert_after": "carrer_preference_details",
|
||||
"is_system_generated": 1,
|
||||
"is_virtual": 0,
|
||||
"label": "Preferred Functions",
|
||||
"length": 0,
|
||||
@@ -1327,6 +1405,7 @@
|
||||
"in_preview": 0,
|
||||
"in_standard_filter": 0,
|
||||
"insert_after": "preferred_functions",
|
||||
"is_system_generated": 1,
|
||||
"is_virtual": 0,
|
||||
"label": "Preferred Location",
|
||||
"length": 0,
|
||||
@@ -1379,6 +1458,7 @@
|
||||
"in_preview": 0,
|
||||
"in_standard_filter": 0,
|
||||
"insert_after": "preferred_location",
|
||||
"is_system_generated": 1,
|
||||
"is_virtual": 0,
|
||||
"label": "",
|
||||
"length": 0,
|
||||
@@ -1431,6 +1511,7 @@
|
||||
"in_preview": 0,
|
||||
"in_standard_filter": 0,
|
||||
"insert_after": "career_preference_column",
|
||||
"is_system_generated": 1,
|
||||
"is_virtual": 0,
|
||||
"label": "Preferred Industries",
|
||||
"length": 0,
|
||||
@@ -1483,6 +1564,7 @@
|
||||
"in_preview": 0,
|
||||
"in_standard_filter": 0,
|
||||
"insert_after": "preferred_industries",
|
||||
"is_system_generated": 1,
|
||||
"is_virtual": 0,
|
||||
"label": "Dream Companies",
|
||||
"length": 0,
|
||||
@@ -1535,6 +1617,7 @@
|
||||
"in_preview": 0,
|
||||
"in_standard_filter": 0,
|
||||
"insert_after": "dream_companies",
|
||||
"is_system_generated": 1,
|
||||
"is_virtual": 0,
|
||||
"label": "Work Environment",
|
||||
"length": 0,
|
||||
@@ -1587,6 +1670,7 @@
|
||||
"in_preview": 0,
|
||||
"in_standard_filter": 0,
|
||||
"insert_after": "work_environment",
|
||||
"is_system_generated": 1,
|
||||
"is_virtual": 0,
|
||||
"label": "Attire Preference",
|
||||
"length": 0,
|
||||
@@ -1639,6 +1723,7 @@
|
||||
"in_preview": 0,
|
||||
"in_standard_filter": 0,
|
||||
"insert_after": "attire",
|
||||
"is_system_generated": 1,
|
||||
"is_virtual": 0,
|
||||
"label": "Collaboration Preference",
|
||||
"length": 0,
|
||||
@@ -1691,6 +1776,7 @@
|
||||
"in_preview": 0,
|
||||
"in_standard_filter": 0,
|
||||
"insert_after": "collaboration",
|
||||
"is_system_generated": 1,
|
||||
"is_virtual": 0,
|
||||
"label": "Role Preference",
|
||||
"length": 0,
|
||||
@@ -1743,6 +1829,7 @@
|
||||
"in_preview": 0,
|
||||
"in_standard_filter": 0,
|
||||
"insert_after": "role",
|
||||
"is_system_generated": 1,
|
||||
"is_virtual": 0,
|
||||
"label": "",
|
||||
"length": 0,
|
||||
@@ -1795,6 +1882,7 @@
|
||||
"in_preview": 0,
|
||||
"in_standard_filter": 0,
|
||||
"insert_after": "work_environment_column",
|
||||
"is_system_generated": 1,
|
||||
"is_virtual": 0,
|
||||
"label": "Location Preference",
|
||||
"length": 0,
|
||||
@@ -1847,6 +1935,7 @@
|
||||
"in_preview": 0,
|
||||
"in_standard_filter": 0,
|
||||
"insert_after": "location_preference",
|
||||
"is_system_generated": 1,
|
||||
"is_virtual": 0,
|
||||
"label": "Time Preference",
|
||||
"length": 0,
|
||||
@@ -1899,6 +1988,7 @@
|
||||
"in_preview": 0,
|
||||
"in_standard_filter": 0,
|
||||
"insert_after": "time",
|
||||
"is_system_generated": 1,
|
||||
"is_virtual": 0,
|
||||
"label": "Company Type",
|
||||
"length": 0,
|
||||
@@ -1923,4 +2013,4 @@
|
||||
"unique": 0,
|
||||
"width": null
|
||||
}
|
||||
]
|
||||
]
|
||||
@@ -14,6 +14,7 @@
|
||||
"signup_settings_section",
|
||||
"terms_of_use",
|
||||
"terms_page",
|
||||
"designation",
|
||||
"column_break_9",
|
||||
"privacy_policy",
|
||||
"privacy_policy_page",
|
||||
@@ -130,12 +131,18 @@
|
||||
"label": "Cookie Policy Page",
|
||||
"mandatory_depends_on": "cookie_policy",
|
||||
"options": "Web Page"
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"fieldname": "designation",
|
||||
"fieldtype": "Check",
|
||||
"label": "Ask Designation during Signup"
|
||||
}
|
||||
],
|
||||
"index_web_pages_for_search": 1,
|
||||
"issingle": 1,
|
||||
"links": [],
|
||||
"modified": "2022-03-23 16:07:29.491432",
|
||||
"modified": "2022-04-19 13:48:45.176536",
|
||||
"modified_by": "Administrator",
|
||||
"module": "LMS",
|
||||
"name": "LMS Settings",
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
{% endif %}
|
||||
|
||||
{% if course.paid_certificate %}
|
||||
<div class="certificate-price small mt-3">
|
||||
<div class="certificate-price small mt-3" data-price="{{ course.price_certificate }}">
|
||||
{{ _("Certificate Price: ") }} {{ frappe.utils.fmt_money(course.price_certificate, 2, course.currency) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
@@ -190,7 +190,7 @@ def get_palette(full_name):
|
||||
return palette[idx % 8]
|
||||
|
||||
@frappe.whitelist(allow_guest=True)
|
||||
def sign_up(email, full_name, verify_terms):
|
||||
def sign_up(email, full_name, verify_terms, designation):
|
||||
if is_signup_disabled():
|
||||
frappe.throw(_('Sign Up is disabled'), title='Not Allowed')
|
||||
|
||||
@@ -211,6 +211,7 @@ def sign_up(email, full_name, verify_terms):
|
||||
"email": email,
|
||||
"first_name": escape_html(full_name),
|
||||
"verify_terms": verify_terms,
|
||||
"designation": designation,
|
||||
"country": "",
|
||||
"enabled": 1,
|
||||
"new_password": random_string(10),
|
||||
|
||||
@@ -1,63 +1,87 @@
|
||||
<form class="signup-form" 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 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>
|
||||
|
||||
<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>
|
||||
{% 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>
|
||||
<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>
|
||||
</label>
|
||||
<p class="help-box small text-muted"></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="page-card-actions">
|
||||
<button class="btn btn-sm btn-primary btn-block btn-signup"
|
||||
type="submit">{{ _("Sign up") }}</button>
|
||||
<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>
|
||||
<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());
|
||||
<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;
|
||||
}
|
||||
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": ($("#signup_email").val() || "").trim(),
|
||||
"full_name": frappe.utils.xss_sanitise(($("#signup_fullname").val() || "").trim()),
|
||||
"verify_terms": $("#signup-terms").prop("checked") ? 1 : 0
|
||||
},
|
||||
statusCode: login.login_handlers
|
||||
})
|
||||
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>
|
||||
</script>
|
||||
|
||||
@@ -152,7 +152,7 @@
|
||||
</div>
|
||||
|
||||
{% if course.paid_certificate %}
|
||||
<div class="certificate-price">
|
||||
<div class="certificate-price" data-price="{{ course.price_certificate }}">
|
||||
{{ _("Certificate Price:") }} {{ frappe.utils.fmt_money(course.price_certificate, 2, course.currency) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user