Split join and include as inline
All checks were successful
/ preview (pull_request) Successful in 38s
All checks were successful
/ preview (pull_request) Successful in 38s
This commit is contained in:
parent
4f748e6fff
commit
b42d2b42b7
4 changed files with 82 additions and 2 deletions
|
@ -46,6 +46,7 @@ add_plugins:
|
|||
- typography
|
||||
- sidebar2
|
||||
- po
|
||||
- inline
|
||||
# plugins to disable
|
||||
disable_plugins:
|
||||
- htmlscrubber
|
||||
|
@ -411,7 +412,7 @@ po_master_language: en|English
|
|||
po_slave_languages:
|
||||
- fr|Français
|
||||
# configures what pages are translatable
|
||||
po_translatable_pages: 'index or footer or platforms or sidebar or join or recentchanges or shortcuts'
|
||||
po_translatable_pages: 'index or platforms or join or sidebar'
|
||||
# used to decide how internal links should be generated, depending on web server features and site-specific preferences.
|
||||
po_link_to: current
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[[!meta title="Join"]]
|
||||
|
||||
<script src="../js/join.js"></script>
|
||||
[[!inline pages="join/join-en" raw="yes"]]
|
||||
|
||||
<header class="text-center">
|
||||
<h1 class="post-title">Registration Form</h1>
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
<script>
|
||||
async function checkDuplicate() {
|
||||
var url='https://forge.ilot.io/api/v1/repos/ilot/registration/issues';
|
||||
var email = document.getElementById("email").value;
|
||||
|
@ -73,3 +74,4 @@
|
|||
console.error('Error:', error)
|
||||
});
|
||||
}
|
||||
</script>
|
77
join/join-fr.html
Normal file
77
join/join-fr.html
Normal file
|
@ -0,0 +1,77 @@
|
|||
<script>
|
||||
async function checkDuplicate() {
|
||||
var url='https://forge.ilot.io/api/v1/repos/ilot/registration/issues';
|
||||
var email = document.getElementById("email").value;
|
||||
|
||||
const response = await fetch(url, {
|
||||
headers: {
|
||||
'authorization': 'token b8d8617bb6049c0e47b7bba5cd0931799f54609c',
|
||||
'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 url = 'https://forge.ilot.io/api/v1/repos/ilot/registration/issues';
|
||||
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("Vous devez être d'accord avec notre code de conduite"),
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!email) {
|
||||
alert("Le courriel ne peut pas être vide");
|
||||
return false;
|
||||
}
|
||||
|
||||
if(mathspamtrap != "9") {
|
||||
alert("Pas la bonne réponse mathématique");
|
||||
return false;
|
||||
}
|
||||
|
||||
if(await checkDuplicate(email) === true) {
|
||||
alert("Ce courriel à déja 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 howfound = document.getElementById("how-found").value;
|
||||
var howfound = howfound.replace (/^/,'How I found ilot: ');
|
||||
var ocuser = document.getElementById("oc-user").value;
|
||||
var ocuser = ocuser.replace (/^/,'OpenCollective Profile: ');
|
||||
var description = name + "\n\n" + aboutme + "\n\n" + howfound + "\n\n" + ocuser;
|
||||
console.log('Description:', description);
|
||||
|
||||
fetch(url, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'authorization': 'token b8d8617bb6049c0e47b7bba5cd0931799f54609c',
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify({ title: email, body: description }),
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(result => {
|
||||
console.log('Success:', result);
|
||||
alert("Votre demande a été soumis. Un membre d'un groupe de travail va traiter votre demande sous peu. Si vous ne recevez pas de nouvelle d'ici sept jours, contactez-vous via support@ilot.io");
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error:', error)
|
||||
});
|
||||
}
|
||||
</script>
|
Loading…
Add table
Reference in a new issue