2020-02-14 17:57:25 +00:00
{{define "title"}}Créer un compte |{{end}}
2023-07-23 15:18:29 +00:00
{{define "admenu"}}
{{end}}
2020-02-14 17:57:25 +00:00
{{define "body"}}
< div class = "d-flex" >
2023-07-21 14:18:40 +00:00
< h2 > Création d'un nouveau compte< / h2 >
2020-02-14 17:57:25 +00:00
< / div >
2023-07-20 11:46:32 +00:00
{{if .ErrorMessage}}
< div class = "alert alert-danger mt-4" > Impossible de créer le compte.
< div style = "font-size: 0.8em" > {{ .ErrorMessage }}< / div >
< / div >
{{end}}
{{if .WarningMessage}}
< div class = "alert alert-danger mt-4" > Des erreurs se sont produites, le compte pourrait ne pas être totalement
fonctionnel.
< div style = "font-size: 0.8em" > {{ .WarningMessage }}< / div >
< / div >
{{end}}
{{if .Success}}
< div class = "alert alert-success mt-4" >
Le compe a été créé !
Rendez-vous < a href = "/logout" > sur la page d'accueil< / a > pour vous connecter avec ce nouveau compte.
< / div >
{{else}}
< form method = "POST" class = "mt-4" >
2023-07-21 05:58:45 +00:00
< div class = "form-group" >
2023-07-22 09:33:47 +00:00
< label for = "givenname" > Prénom :< / label >
< input type = "text" id = "givenname" name = "givenname" class = "form-control" value = "{{ .GivenName }}" / >
2023-07-21 05:58:45 +00:00
< / div >
< div class = "form-group" >
2023-07-22 09:33:47 +00:00
< label for = "surname" > Nom de famille :< / label >
< input type = "text" id = "surname" name = "surname" class = "form-control" value = "{{ .Surname }}" / >
< / div >
< div class = "form-group" >
2023-07-23 06:22:09 +00:00
< label for = "otheremail" > Email de secours:< / label >
< input type = "text" id = "otheremail" name = "otheremail" class = "form-control" value = "{{ .OtherEmail }}" / >
2023-07-21 05:58:45 +00:00
< small class = "form-text text-muted" >
Le courriel de l'utilisateur.
< / small >
< / div >
< div class = "form-group" >
2023-07-22 09:33:47 +00:00
< label for = "displayname" > Nom affiché :< / label >
< input type = "text" id = "displayname" name = "displayname" class = "form-control" value = "{{ .DisplayName }}" / >
2023-07-21 05:58:45 +00:00
< / div >
2023-07-20 11:46:32 +00:00
< div class = "form-group" >
2023-07-22 11:20:40 +00:00
< label for = "username" > Identifiant :< / label >
2023-07-20 11:46:32 +00:00
< input type = "text" id = "username" name = "username" class = "form-control" value = "{{ .Username }}" / >
< small class = "form-text text-muted" >
Votre identifiant doit être en minuscule.
< / small >
< / div >
< div id = "calc-uid" > < / div >
< div id = "calc-cn" > < / div >
{{if .ErrorInvalidUsername}}
< div class = "alert alert-warning" >
Nom d'utilisateur invalide. Ne peut contenir que les caractères suivants : chiffres, lettres minuscules, point,
tiret bas (_) et tiret du milieu (-).
< / div >
{{end}}
{{if .ErrorUsernameTaken}}
< div class = "alert alert-warning" >
Ce nom d'utilisateur est déjà pris.
< / div >
2020-02-14 17:57:25 +00:00
{{end}}
2023-07-22 09:33:47 +00:00
< div class = "form-group" >
< label for = "mail" > Email des GV:< / label >
< input type = "text" id = "mail" name = "mail" class = "form-control" value = "{{ .Mail }}" / >
< small class = "form-text text-muted" >
Le courriel et login interne.
< / small >
< / div >
2023-07-20 18:06:25 +00:00
< p > < a href = "#" onClick = "javascript:var suggestPW = Math.random().toString(36).slice(-10); document.getElementById('password').value='{{ .SuggestPW }}';document.getElementById('password2').value='{{ .SuggestPW }}';" > Utiliser ce mot de passe :< / a > {{ .SuggestPW }}< / p >
2023-07-20 11:46:32 +00:00
< div class = "form-group" >
< label for = "password" > Mot de passe :< / label >
< input type = "password" id = "password" name = "password" class = "form-control" / >
< small class = "form-text text-muted" >
La seule contrainte est que votre mot de passe doit faire au moins 8 caractères. Utilisez chiffres, majuscules, et
caractères spéciaux sans modération !
< / small >
< / div >
{{if .ErrorPasswordTooShort}}
< div class = "alert alert-warning" >
Le mot de passe choisi est trop court (minimum 8 caractères).
< / div >
2020-02-14 17:57:25 +00:00
{{end}}
2023-07-20 11:46:32 +00:00
< div class = "form-group" >
< label for = "password2" > Répéter le mot de passe :< / label >
< input type = "password" id = "password2" name = "password2" class = "form-control" / >
< / div >
{{if .ErrorPasswordMismatch}}
< div class = "alert alert-warning" >
Les deux mots de passe entrés ne correspondent pas.
< / div >
2020-02-14 17:57:25 +00:00
{{end}}
2023-07-20 11:46:32 +00:00
< button type = "submit" class = "btn btn-primary" > Créer le compte< / button >
< / form >
2023-07-21 05:52:22 +00:00
< script lang = "javascript" >
2023-07-22 09:33:47 +00:00
function changeGivenNameOrSurname () {
givenname = document.getElementById("givenname");
surname = document.getElementById("surname");
displayname = document.getElementById("displayname");
username = document.getElementById("username");
displayname.value = givenname.value + " " + surname.value
2023-07-22 09:37:43 +00:00
changeDisplayname();
2023-07-22 09:33:47 +00:00
}
2023-07-21 05:58:45 +00:00
function changeDisplayname () {
2023-07-22 09:33:47 +00:00
givenname = document.getElementById("givenname");
surname = document.getElementById("surname");
displayname = document.getElementById("displayname");
username = document.getElementById("username");
username.value = displayname.value.toLowerCase().replace(/[^A-z0-9.-]/g, '').replace(/^[.-]/, '').replace(/[.-]$/, '');
2023-07-22 09:37:43 +00:00
changeUsername();
2023-07-21 05:58:45 +00:00
}
function changeUsername () {
2023-07-22 09:33:47 +00:00
givenname = document.getElementById("givenname");
surname = document.getElementById("surname");
displayname = document.getElementById("displayname");
username = document.getElementById("username");
mail = document.getElementById("mail");
mail.value = username.value + "@lesgv.com";
2023-07-21 05:52:22 +00:00
}
2023-07-22 09:37:43 +00:00
document.getElementById("givenname").addEventListener("change",changeGivenNameOrSurname);
document.getElementById("surname").addEventListener("change",changeGivenNameOrSurname);
2023-07-21 05:58:45 +00:00
document.getElementById("displayname").addEventListener("change",changeDisplayname);
2023-07-22 09:37:43 +00:00
document.getElementById("username").addEventListener("change",changeUsername);
2023-07-21 05:52:22 +00:00
< / script >
2020-02-14 17:57:25 +00:00
{{end}}
2023-07-20 11:46:32 +00:00
{{end}}