aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2020-02-14 21:58:34 +0100
committerAlex Auvolat <alex@adnab.me>2020-02-14 21:58:34 +0100
commit151a31a4250cde38d8a66f2bfc8390f8132dc552 (patch)
tree5a5b775b4657e5d0ab44ac6f84e10b55d984bba2 /templates
parent768f2de9162bbf3fd0a1005554f3fd595818f1b3 (diff)
downloadguichet-151a31a4250cde38d8a66f2bfc8390f8132dc552.tar.gz
guichet-151a31a4250cde38d8a66f2bfc8390f8132dc552.zip
Invitation mechanism with codes etc
Diffstat (limited to 'templates')
-rw-r--r--templates/home.html2
-rw-r--r--templates/invite_invalid_code.html12
-rw-r--r--templates/invite_mail.txt13
-rw-r--r--templates/invite_send_code.html62
4 files changed, 88 insertions, 1 deletions
diff --git a/templates/home.html b/templates/home.html
index 57d6930..5556ba7 100644
--- a/templates/home.html
+++ b/templates/home.html
@@ -2,7 +2,7 @@
{{define "body"}}
<div class="alert alert-info">
- Bienvenue, <strong>{{ .WelcomeName }}</strong> !
+ Bienvenue, <strong>{{ .Login.WelcomeName }}</strong> !
</div>
<div class="d-flex">
<a class="ml-auto btn btn-sm btn-dark" href="/logout">Se déconnecter</a>
diff --git a/templates/invite_invalid_code.html b/templates/invite_invalid_code.html
new file mode 100644
index 0000000..107afab
--- /dev/null
+++ b/templates/invite_invalid_code.html
@@ -0,0 +1,12 @@
+{{define "title"}}Créer un compte |{{end}}
+
+{{define "body"}}
+<div class="d-flex">
+ <h4>Création d'un nouveau compte</h4>
+ <a class="ml-auto btn btn-info" href="/">Retour</a>
+</div>
+
+ <div class="alert alert-danger mt-4">
+ Code d'invitation invalide.
+ </div>
+{{end}}
diff --git a/templates/invite_mail.txt b/templates/invite_mail.txt
new file mode 100644
index 0000000..f1667b7
--- /dev/null
+++ b/templates/invite_mail.txt
@@ -0,0 +1,13 @@
+From: {{.From}}
+To: {{.To}}
+Subject: Code d'invitation Deuxfleurs
+Content-type: text/plain; charset=utf-8
+
+Vous avez été invité à créer un compte sur Deuxfleurs par {{.InviteFrom}} :)
+
+Pour créer votre compte, rendez-vous à l'addresse suivante:
+
+{{.WebBaseAddress}}/invite/{{.Code}}
+
+À bientôt sur Deuxfleurs !
+
diff --git a/templates/invite_send_code.html b/templates/invite_send_code.html
new file mode 100644
index 0000000..8d09b3a
--- /dev/null
+++ b/templates/invite_send_code.html
@@ -0,0 +1,62 @@
+{{define "title"}}Envoyer un code d'invitation |{{end}}
+
+{{define "body"}}
+<div class="d-flex">
+ <h4>Envoyer un code d'invitation</h4>
+ <a class="ml-auto btn btn-info" href="/">Retour</a>
+</div>
+
+ {{if .ErrorMessage}}
+ <div class="alert alert-danger mt-4">Impossible de génerer ou d'envoyer le code.
+ <div style="font-size: 0.8em">{{ .ErrorMessage }}</div>
+ </div>
+ {{end}}
+ {{if .Success}}
+ <div class="alert alert-success mt-4">
+ {{if .CodeSentTo}}
+ Un code d'invitation a bien été envoyé à <code>{{ .CodeSentTo }}</code>.
+ {{end}}
+ {{if .CodeDisplay}}
+ Le code généré est le suivant:
+
+ <p style="text-align: center; font-size: 1.6em;" class="mt-4 mb-4">
+ {{ .CodeDisplay }}
+ </p>
+ <p style="text-align: center" class="mt-4 mb-4">
+ <a href="{{.WebBaseAddress}}/invitation/{{ .CodeDisplay }}">{{.WebBaseAddress}}/invitation/{{.CodeDisplay}}</a>
+ </p>
+ {{end}}
+ </div>
+ {{else}}
+ <form method="POST" class="mt-4">
+ Choisissez une option:
+
+ <div class="input-group mt-4">
+ <div class="input-group-prepend">
+ <div class="input-group-text">
+ <input type="radio" name="choice" value="display" id="choice_display" checked="true">
+ </div>
+ </div>
+ <label class="form-control" for="choice_display">
+ Afficher le code et me laisser l'envoyer
+ </label>
+ </div>
+
+ <div class="input-group mt-4">
+ <div class="input-group-prepend">
+ <div class="input-group-text">
+ <input type="radio" name="choice" value="send" id="choice_send" aria-label="Checkbox for following text input">
+ </div>
+ </div>
+ <label class="form-control" for="choice_send">
+ Envoyer le code à l'addresse suivante:
+ </label>
+ <input class="form-control" type="text" name="sendto" id="sendto" placeholder="Addresse mail..." onclick="document.getElementById('choice_send').checked = true;" />
+ </div>
+
+ <div class="form-group mt-4">
+ <button type="submit" class="btn btn-primary">Génerer le code</button>
+ </div>
+ </form>
+ {{end}}
+{{end}}