aboutsummaryrefslogtreecommitdiff
path: root/templates/invite_send_code.html
blob: 6894142170db88fbb501945035b29246dd664c1d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
{{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="send" id="choice_send" checked="true">
          </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>
      {{if .ErrorInvalidEmail}}
        <div class="alert alert-warning mt-4">
          Addresse mail invalide.
        </div>
      {{end}}

      <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">
          </div>
        </div>
        <label class="form-control" for="choice_display">
                  Afficher le code et me laisser l'envoyer
        </label>
      </div>

      <div class="form-group mt-4">
        <button type="submit" class="btn btn-primary">Génerer le code</button>
      </div>
    </form>
  {{end}}
{{end}}