diff options
author | Alex Auvolat <alex@adnab.me> | 2021-08-16 16:27:20 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2021-08-16 16:27:20 +0200 |
commit | 01bf4aa52279630910ce33d065efcda77e6df7bb (patch) | |
tree | 78dd9c82e09388aae5fd9f4847c0b854f9846de5 /templates | |
parent | e94bd728ec7f709883fb232b2eb123543ba5660e (diff) | |
download | guichet-01bf4aa52279630910ce33d065efcda77e6df7bb.tar.gz guichet-01bf4aa52279630910ce33d065efcda77e6df7bb.zip |
Fix directory searching
Diffstat (limited to 'templates')
-rw-r--r-- | templates/directory.html | 38 | ||||
-rw-r--r-- | templates/directory_results.html | 23 | ||||
-rw-r--r-- | templates/profile.html | 6 |
3 files changed, 39 insertions, 28 deletions
diff --git a/templates/directory.html b/templates/directory.html index f9bad61..d995fb2 100644 --- a/templates/directory.html +++ b/templates/directory.html @@ -1,35 +1,23 @@ -{{define "title"}}Directory |{{end}} +{{define "title"}}Annuaire |{{end}} {{define "body"}} <div class="d-flex"> - <h4>Directory</h4> + <h4>Annuaire</h4> <a class="ml-auto btn btn-info" href="/">Menu principal</a> </div> -<div class="d-flex"> - <div class="d-flex mx-auto"> - <p class="">Name:</p> - <form class="px-2" style="width: fit-content;"> - <input id="search" type="text" onkeyup="searchDirectory()" size="20"> - </form> - </div> -</div> +<form> + <div class="form-group form-row"> + <div class="col-sm-2"> </div> + <label for="search" class="col-sm-2 col-form-label">Rechercher :</label> + <input class="form-control col-sm-4" id="search" name="search" type="text" onkeyup="searchDirectory()" size="20"> + </div> +</form> + +<div id="search-results"></div> -<table class="table mt-4"> - <thead> - <th scope="col">Profil image</th> - <th scope="col">Identifiant</th> - <th scope="col">Nom complet</th> - <th scope="col">Email</th> - <th scope="col">Description</th> - </thead> - <tbody id="users"> - - - </tbody> - </table> - <script src="/static/javascript/search.js"></script> +<script src="/static/javascript/search.js"></script> -{{end}}
\ No newline at end of file +{{end}} diff --git a/templates/directory_results.html b/templates/directory_results.html new file mode 100644 index 0000000..c7dd715 --- /dev/null +++ b/templates/directory_results.html @@ -0,0 +1,23 @@ +{{if .Results}} + {{range .Results}} + <div class="card mt-4"> + <div class="card-body"> + <div class="float-right"> + {{if .ProfilePicture}} + <a href="/picture/{{.ProfilePicture}}"> + <img src="/picture/{{.ProfilePicture}}-thumb"/> + </a> + {{else}} + {{end}} + </div> + <h5 class="card-title"> + {{.DisplayName}} + <code>{{.Id}}@</code> + </h5> + <p class="card-text">{{.Description}}</p> + </div> + </div> + {{end}} +{{else}} + Aucun résultat. +{{end}} diff --git a/templates/profile.html b/templates/profile.html index 8704e23..edf9d76 100644 --- a/templates/profile.html +++ b/templates/profile.html @@ -5,7 +5,7 @@ <h4>Modifier mon profil</h4> <a class="ml-auto btn btn-info" href="/">Retour</a> </div> -<h5>Photo de profil</h5> + {{if .ErrorMessage}} <div class="alert alert-danger mt-4">Impossible d'effectuer la modification. <div style="font-size: 0.8em">{{ .ErrorMessage }}</div> @@ -70,8 +70,8 @@ </div> <div class="form-group"> - <label for="description">Description (180 caractères maximum)</label> - <textarea id="description" name="description" class="form-control" maxlength="180">{{ .Description }}</textarea> + <label for="description">Description</label> + <textarea id="description" name="description" class="form-control">{{ .Description }}</textarea> </div> <button type="submit" class="btn btn-primary">Enregistrer les modifications</button> </form> |