Commit 8b0ce079 authored by Romain Loth's avatar Romain Loth

super short registration form variant

parent 2473ecfe
...@@ -522,7 +522,7 @@ def register(): ...@@ -522,7 +522,7 @@ def register():
if request.method == 'GET': if request.method == 'GET':
return render_template( return render_template(
"registration_short_form.html" "registration_super_short_form.html"
) )
elif request.method == 'POST': elif request.method == 'POST':
# ex: request.form = ImmutableMultiDict([('initials', 'R.L.'), ('email', 'romain.loth@iscpif.fr'), ('last_name', 'Loth'), ('country', 'France'), ('first_name', 'Romain'), ('my-captchaHash', '-773776109'), ('my-captcha', 'TSZVIN')]) # ex: request.form = ImmutableMultiDict([('initials', 'R.L.'), ('email', 'romain.loth@iscpif.fr'), ('last_name', 'Loth'), ('country', 'France'), ('first_name', 'Romain'), ('my-captchaHash', '-773776109'), ('my-captcha', 'TSZVIN')])
......
...@@ -24,8 +24,7 @@ var regfo = cmxClt.uauth.AuthForm( ...@@ -24,8 +24,7 @@ var regfo = cmxClt.uauth.AuthForm(
{ {
'type': "register", 'type': "register",
'validateCaptcha': true, 'validateCaptcha': true,
'multiTextinputs': [{'id':'keywords'}, 'multiTextinputs': [{'id':'keywords'}]
{'id':'hashtags', 'color': "#23A"}]
} }
) )
...@@ -41,7 +40,9 @@ var validateWithMessage = false ...@@ -41,7 +40,9 @@ var validateWithMessage = false
var shortRegVersion = true var shortRegVersion = true
var ignoredFields = [] var ignoredFields = []
if (shortRegVersion) { if (shortRegVersion) {
ignoredFields = ['gender', 'home_url', 'org', 'org_type'] ignoredFields = ['gender', 'home_url', 'org',
'hon_title', 'position', 'org_type',
'hashtags']
} }
// done when anything in the form changes // done when anything in the form changes
...@@ -58,12 +59,9 @@ function testAsYouGo() { ...@@ -58,12 +59,9 @@ function testAsYouGo() {
// on submit then clicks "back" and ends up with // on submit then clicks "back" and ends up with
// hashtags in brackets like "['#a','#b']" // hashtags in brackets like "['#a','#b']"
} }
cmxClt.uform.checkJobDateStatus()
if (regfo.passStatus if (regfo.passStatus
&& regfo.emailStatus && regfo.emailStatus
&& regfo.captchaStatus && regfo.captchaStatus) {
&& cmxClt.uform.jobLookingDateStatus) {
regfo.elSubmitBtn.disabled = false regfo.elSubmitBtn.disabled = false
} }
else { else {
...@@ -75,10 +73,6 @@ function testAsYouGo() { ...@@ -75,10 +73,6 @@ function testAsYouGo() {
var teamCityDivStyle = document.getElementById('team_city_div').style var teamCityDivStyle = document.getElementById('team_city_div').style
if (document.getElementById('other_org_div')) {
var otherInstDivStyle = document.getElementById('other_org_div').style
}
function registerDoorsAndSubmit(){ function registerDoorsAndSubmit(){
regfo.elMainMessage.innerHTML = "Registering with ISCPIF Doors..." regfo.elMainMessage.innerHTML = "Registering with ISCPIF Doors..."
...@@ -128,15 +122,17 @@ function validateAndMsg() { ...@@ -128,15 +122,17 @@ function validateAndMsg() {
regfo.elMainMessage.innerHTML = "Validating the form..." regfo.elMainMessage.innerHTML = "Validating the form..."
// runs field-by-field validation and highlights mandatory missing fields // runs field-by-field validation and highlights mandatory missing fields
var diagnostic = cmxClt.uform.testFillField(regfo) var diagnostic = cmxClt.uform.testFillField(
// +++++++++++++ regfo,
{'ignore':ignoredFields}
)
// RESULTS // RESULTS
var valid = diagnostic[0] var valid = diagnostic[0]
var missingFields = diagnostic[1] var missingFields = diagnostic[1]
if (valid) { if (valid) {
regfo.elMainMessage.innerHTML = "Form is valid... Will register and submit..." regfo.elMainMessage.innerHTML = "Form is valid... Will submit and register..."
regfo.elMainMessage.style.opacity = 1 regfo.elMainMessage.style.opacity = 1
regfo.elMainMessage.style.display = 'block' regfo.elMainMessage.style.display = 'block'
...@@ -159,8 +155,10 @@ function addUidThenSubmit(doorsResp) { ...@@ -159,8 +155,10 @@ function addUidThenSubmit(doorsResp) {
var doorsUid = doorsResp[0] var doorsUid = doorsResp[0]
var doorsMsg = doorsResp[1] var doorsMsg = doorsResp[1]
console.warn("TODO FIX doorsUid will be available only later now")
if (doorsUid == null) { if (doorsUid == null) {
regfo.elMainMessage.innerHTML = "Problem with doors registration... TODO debug" regfo.elMainMessage.innerHTML = "Problem with doors registration..."
regfo.elMainMessage.mainMessage.style.color = cmxClt.colorRed regfo.elMainMessage.mainMessage.style.color = cmxClt.colorRed
regfo.elSubmitBtn.disabled = false regfo.elSubmitBtn.disabled = false
} }
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment