Commit d45ccbf8 authored by Dario Pinto's avatar Dario Pinto
Browse files

Merge branch 'master' into 'master'

Registration page for existing courses

See merge request !88
parents 1f71b7f9 55901a93
<h1 id="page-title">Register your team</h1>
<br />
Registration form to participate in the training courses.
<hr>
<form id="registration" onsubmit="return validateFormOnSubmit();">
<label for="fcourse">Course:</label><br>
<select class="small-text" id ="fcourse">
<option value="OCaml Development">OCaml Development</option>
<option value="OCaml Expert">OCaml Expert</option>
<option value="OCaml Code Optimization">OCaml Code Optimization</option>
<option value="Rust Vocational Training">Rust Vocational Training</option>
<option value="Mastering OPAM & OCaml Tools">Mastering OPAM &amp; OCaml Tools</option>
<option value="Custom Training">Custom Training</option>
</select><br>
<label for="fname">Name:</label><br>
<input class="small-text" type="text" id="fname" name="fname" onkeyup="return updateInput(this)"><br>
<label for="femail">Email:</label><br>
<input class="small-text" type="email" id="femail" name="femail" onkeyup="return updateInput(this)"><br>
<label for="ftel">Telephone:</label><br>
<input class="small-text" type="tel" id="ftel" name="ftel" onkeyup="return updateInput(this)"><br>
<small><span id="warning">Warning</span> : this pre-registration will only be confirmed upon signature of the training agreement by both sides.</small><br>
<input type="submit" value="Send">
</form>
<br>
> OCamlPro is registered as a training provider in accordance with the provisions of Article R. 6351-6 of the Labor Code under number **11755991975**. This registration does not constitute state approval.
<style>
.small-text {
font-size:16px;
}
#warning{
color:red;
}
.invalid-input {
background-color: #ffa5a5;
}
</style>
<script>
/* converts input to a valid string */
function validInput(str) {
return encodeURIComponent(str.trim());
}
/* sends pre-filled mail to contact@ocamlpro.com */
function mailto(name,email,tel){
let new_line = "%0D%0A";
let course = document.getElementById("fcourse").value;
let subject = course + " pre-registration by " + name;
let body =
"Name: " + name + new_line +
"Email: " + email + new_line +
"Telephone: " + tel;
let url =
"mailto:contact@ocamlpro.com?subject=" + subject + "&body=" + body;
window.open(url);
}
/** form onsubmit handler */
function validateFormOnSubmit() {
let nameInput = document.getElementById("fname");
let name = validInput(nameInput.value);
/* Colors input to colar color if input is empty */
if(!name) {
nameInput.classList.add("invalid-input");
}
let emailInput = document.getElementById("femail");
let email = validInput(emailInput.value);
if(!email) {
emailInput.classList.add("invalid-input");
}
let telInput = document.getElementById("ftel");
let tel = validInput(telInput.value);
if(!tel) {
telInput.classList.add("invalid-input");
}
if (name && email && tel) {
mailto(name,email,tel);
}
return false;
}
/** Updates input color when entering new letter */
function updateInput(input) {
input.classList.remove("invalid-input");
return false;
}
</script>
\ No newline at end of file
......@@ -45,6 +45,7 @@
<li><a class="dropdown-item" href="/course_mastering_opam_ocaml_tools">Mastering OPAM &amp; OCaml
Tools</a></li>
<li><a class="dropdown-item" href="mailto:contact@ocamlpro.com">Custom Training</a></li>
<li><a class="dropdown-item" href="/course_register">Register your team</a></li>
</ul>
</li>
<li class="nav-item dropdown">
......
......@@ -3,20 +3,15 @@
* *)
(* (OLD URL, NEW URL) *)
let old_to_new =
(* NO EQUIVALENT *)
[ ( "https://www.ocamlpro.com/pre-inscription-a-une-session-de-formation-inter-entreprises/"
, "/" )
; ("https://www.ocamlpro.com/fr/preinscription-aux-formations-ocamlpro/", "/")
]
(* LEAD TO 404 *)
@ [ ("https://www.ocamlpro.com/2017/05/04/opam-build", "404")
; ("https://www.ocamlpro.com/2018/07/26/opam-2-0-0-rc3", "404")
; ("https://files.ocamlpro.com/pub/opam-full-latest.tar.gz", "404")
; ("https://files.ocamlpro.com/pub/opam-full-1.1.0.tar.gz", "404")
; ("https://www.ocamlpro.com/blog/2013/03/14/opam-1.0.0.html", "404")
; ("https://files.ocamlpro.com/files/tuareg-mode-with-ppx.el", "404")
; ("http://ocamlpro.com/pub/ny-meetup.pdf", "404" )
]
[ ("https://www.ocamlpro.com/2017/05/04/opam-build", "404")
; ("https://www.ocamlpro.com/2018/07/26/opam-2-0-0-rc3", "404")
; ("https://files.ocamlpro.com/pub/opam-full-latest.tar.gz", "404")
; ("https://files.ocamlpro.com/pub/opam-full-1.1.0.tar.gz", "404")
; ("https://www.ocamlpro.com/blog/2013/03/14/opam-1.0.0.html", "404")
; ("https://files.ocamlpro.com/files/tuareg-mode-with-ppx.el", "404")
; ("http://ocamlpro.com/pub/ny-meetup.pdf", "404" )
]
(* PAGES STATIQUES FR *)
@ [ ("/fr/accueil/", "/index")
; ("/fr/accueil", "/index")
......@@ -42,6 +37,7 @@ let old_to_new =
; ("/fr/formation-passer-a-ocaml/", "/course_ocaml_development")
; ("/fr/formation-optimiser-du-code-ocaml", "/course_ocaml_code_opti")
; ("/fr/formation-optimiser-du-code-ocaml/", "/course_ocaml_code_opti")
; ("/fr/preinscription-aux-formations-ocamlpro/", "/course_register" )
]
(* STATIC PAGES *)
@ [ ("/", "/index")
......@@ -63,6 +59,8 @@ let old_to_new =
; ("/course-ocaml-development/", "/course_ocaml_development")
; ("/course-ocaml-code-optimization/", "/course_ocaml_code_opti")
; ("/rust-vocational-training-2/", "/course_rust_vocational_training")
; ("/pre-inscription-a-une-session-de-formation-inter-entreprises/"
, "/course_register" )
]
(* AUTHORS *)
@ [ ("/fr/author/lefessan/", "/blog/authors/fabrice_le_fessant")
......
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