This commit is contained in:
parent
bb37522121
commit
c15e3c9177
4 changed files with 3 additions and 117 deletions
|
@ -1 +1 @@
|
||||||
Tue Oct 8 15:30:30 UTC 2024
|
Tue Oct 8 15:38:28 UTC 2024
|
||||||
|
|
|
@ -90,85 +90,7 @@
|
||||||
<div class="container" id="content">
|
<div class="container" id="content">
|
||||||
|
|
||||||
|
|
||||||
<script>
|
<script src="../js/join.js"></script>
|
||||||
async function checkDuplicate() {
|
|
||||||
var url='https://lab.ilot.io/api/v4/projects/99/issues';
|
|
||||||
var email = document.getElementById("email").value;
|
|
||||||
|
|
||||||
const response = await fetch(url, {
|
|
||||||
headers: {
|
|
||||||
'PRIVATE-TOKEN': 'glpat-RaoZSW_3XMhkGr19k6Wv',
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
},
|
|
||||||
})
|
|
||||||
const result = await response.json();
|
|
||||||
let index = result
|
|
||||||
.findIndex(item => item.title === email);
|
|
||||||
|
|
||||||
if (index !== -1) {
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function createIssue() {
|
|
||||||
var baseurl = 'https://lab.ilot.io/api/v4/projects/99/issues?&labels=Request';
|
|
||||||
var mathspamtrap = document.getElementById("math-spam-trap").value;
|
|
||||||
var agreetoterms = document.getElementById("agree-to-terms").checked;
|
|
||||||
var email = document.getElementById("email").value;
|
|
||||||
|
|
||||||
if(!agreetoterms) {
|
|
||||||
alert("Registration requires agreement of Code of Conduct");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!email) {
|
|
||||||
alert("Email cannot be empty");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(mathspamtrap != "9") {
|
|
||||||
alert("Wrong math answer");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(await checkDuplicate(email) === true) {
|
|
||||||
alert("This email address has already requested an account");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
var name = document.getElementById("name").value;
|
|
||||||
var name = name.replace (/^/,'Name: ');
|
|
||||||
var aboutme = document.getElementById("about-me").value;
|
|
||||||
var aboutme = aboutme.replace (/^/,'About me: ');
|
|
||||||
var aboutme = aboutme.replace(/\r?\n/g, "%0A%0A");
|
|
||||||
var howfound = document.getElementById("how-found").value;
|
|
||||||
var howfound = howfound.replace (/^/,'How I found ilot: ');
|
|
||||||
var howfound = howfound.replace(/\r?\n/g, "%0A%0A");
|
|
||||||
var ocuser = document.getElementById("oc-user").value;
|
|
||||||
var ocuser = ocuser.replace (/^/,'OpenCollective Profile: ');
|
|
||||||
var description = name + "%0A%0A" + aboutme + "%0A%0A" + howfound + "%0A%0A" + ocuser;
|
|
||||||
var url = baseurl.concat("&title=", email, "&description=", description);
|
|
||||||
console.log('Description:', description);
|
|
||||||
|
|
||||||
fetch(url, {
|
|
||||||
method: 'POST',
|
|
||||||
headers: {
|
|
||||||
'PRIVATE-TOKEN': 'glpat-RaoZSW_3XMhkGr19k6Wv',
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
},
|
|
||||||
})
|
|
||||||
.then(response => response.json())
|
|
||||||
.then(result => {
|
|
||||||
console.log('Success:', result);
|
|
||||||
alert("Request submitted. A working group member will process your registration shortly. If you receive no contact within seven days of registration, please send an email to support@ilot.io");
|
|
||||||
})
|
|
||||||
.catch(error => {
|
|
||||||
console.error('Error:', error)
|
|
||||||
});
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<header class="text-center">
|
<header class="text-center">
|
||||||
<h1 class="post-title">Registration Form</h1>
|
<h1 class="post-title">Registration Form</h1>
|
||||||
|
|
|
@ -91,42 +91,7 @@ onclick="window.location.href='https://ilot.io/apps/files';"> Vos fichiers
|
||||||
<div class="container" id="content">
|
<div class="container" id="content">
|
||||||
|
|
||||||
|
|
||||||
<script>
|
<script src="../js/join.js"></script>
|
||||||
async function checkDuplicate() { var
|
|
||||||
url='https://lab.ilot.io/api/v4/projects/99/issues'; var email =
|
|
||||||
document.getElementById("email").value; const response = await fetch(url, {
|
|
||||||
headers: { 'PRIVATE-TOKEN': 'glpat-RaoZSW_3XMhkGr19k6Wv', 'Content-Type':
|
|
||||||
'application/json', }, }) const result = await response.json(); let index =
|
|
||||||
result .findIndex(item => item.title === email); if (index !== -1) { return
|
|
||||||
true; } else { return false; } } async function createIssue() { var baseurl
|
|
||||||
= 'https://lab.ilot.io/api/v4/projects/99/issues?&labels=Request'; var
|
|
||||||
mathspamtrap = document.getElementById("math-spam-trap").value; var
|
|
||||||
agreetoterms = document.getElementById("agree-to-terms").checked; var email
|
|
||||||
= document.getElementById("email").value; if(!agreetoterms) {
|
|
||||||
alert("Registration requires agreement of Code of Conduct"); return false; }
|
|
||||||
if(!email) { alert("Courriel ne peut pas être vide"); return false; }
|
|
||||||
if(mathspamtrap != "9") { alert("Mauvaise réponse mathématique"); return
|
|
||||||
false; } if(await checkDuplicate(email) === true) { alert("Ce courriel a
|
|
||||||
déjà fait une demande de compte"); return false; } var name =
|
|
||||||
document.getElementById("name").value; var name = name.replace (/^/,'Name:
|
|
||||||
'); var aboutme = document.getElementById("about-me").value; var aboutme =
|
|
||||||
aboutme.replace (/^/,'About me: '); var aboutme = aboutme.replace(/\r?\n/g,
|
|
||||||
"%0A%0A"); var howfound = document.getElementById("how-found").value; var
|
|
||||||
howfound = howfound.replace (/^/,'How I found ilot: '); var howfound =
|
|
||||||
howfound.replace(/\r?\n/g, "%0A%0A"); var ocuser =
|
|
||||||
document.getElementById("oc-user").value; var ocuser = ocuser.replace
|
|
||||||
(/^/,'OpenCollective Profile: '); var description = name + "%0A%0A" +
|
|
||||||
aboutme + "%0A%0A" + howfound + "%0A%0A" + ocuser; var url =
|
|
||||||
baseurl.concat("&title=", email, "&description=", description);
|
|
||||||
console.log('Description:', description); fetch(url, { method: 'POST',
|
|
||||||
headers: { 'PRIVATE-TOKEN': 'glpat-RaoZSW_3XMhkGr19k6Wv', 'Content-Type':
|
|
||||||
'application/json', }, }) .then(response => response.json()) .then(result
|
|
||||||
=> { console.log('Success:', result); alert("Demande soumise. Un membre du
|
|
||||||
groupe de travail traitera votre inscription dans les plus brefs délais. Si
|
|
||||||
vous n'êtes pas contacté dans les sept jours suivant votre inscription,
|
|
||||||
veuillez envoyer un courriel à support@ilot.io."); }) .catch(error => {
|
|
||||||
console.error('Error:', error) }); }
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<header class="text-center">
|
<header class="text-center">
|
||||||
<h1 class="post-title">Formulaire d'inscription</h1>
|
<h1 class="post-title">Formulaire d'inscription</h1>
|
||||||
|
|
|
@ -56,7 +56,6 @@
|
||||||
var ocuser = document.getElementById("oc-user").value;
|
var ocuser = document.getElementById("oc-user").value;
|
||||||
var ocuser = ocuser.replace (/^/,'OpenCollective Profile: ');
|
var ocuser = ocuser.replace (/^/,'OpenCollective Profile: ');
|
||||||
var description = name + "%0A%0A" + aboutme + "%0A%0A" + howfound + "%0A%0A" + ocuser;
|
var description = name + "%0A%0A" + aboutme + "%0A%0A" + howfound + "%0A%0A" + ocuser;
|
||||||
var description = name + "%0A%0A" + aboutme + "%0A%0A" + howfound;
|
|
||||||
var url = baseurl.concat("&title=", email, "&description=", description);
|
var url = baseurl.concat("&title=", email, "&description=", description);
|
||||||
console.log('Description:', description);
|
console.log('Description:', description);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue