aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/admin_groups.html5
-rw-r--r--templates/admin_mailing.html32
-rw-r--r--templates/admin_mailing_list.html73
-rw-r--r--templates/home.html1
-rw-r--r--templates/layout.html2
5 files changed, 112 insertions, 1 deletions
diff --git a/templates/admin_groups.html b/templates/admin_groups.html
index f6eabfe..ece4128 100644
--- a/templates/admin_groups.html
+++ b/templates/admin_groups.html
@@ -8,6 +8,11 @@
<a class="ml-4 btn btn-info" href="/">Menu principal</a>
</div>
+<div class="alert alert-warning mt-4">
+ Les groupes servent uniquement à contrôler l'accès à différentes fonctionalités de Deuxfleurs.
+ Ce ne sont pas des <a href="/admin/mailing">mailing lists</a>.
+</div>
+
<table class="table mt-4">
<thead>
<th scope="col">Identifiant</th>
diff --git a/templates/admin_mailing.html b/templates/admin_mailing.html
new file mode 100644
index 0000000..d81545f
--- /dev/null
+++ b/templates/admin_mailing.html
@@ -0,0 +1,32 @@
+{{define "title"}}Mailing lists |{{end}}
+
+{{define "body"}}
+
+<div class="d-flex">
+ <h4>Mailing lists</h4>
+ <a class="ml-auto btn btn-success" href="/admin/create/group/{{.MailingBaseDN}}">Nouvelle mailing list</a>
+ <a class="ml-4 btn btn-info" href="/">Menu principal</a>
+</div>
+
+<table class="table mt-4">
+ <thead>
+ <th scope="col">Adresse</th>
+ <th scope="col">Description</th>
+ </thead>
+ <tbody>
+ {{with $root := .}}
+ {{range $ml := $root.MailingLists}}
+ <tr>
+ <td>
+ <a href="/admin/mailing/{{$ml.GetAttributeValue $root.MailingNameAttr}}">
+ {{$ml.GetAttributeValue $root.MailingNameAttr}}
+ </a>
+ </td>
+ <td>{{$ml.GetAttributeValue "description"}}</td>
+ </tr>
+ {{end}}
+ {{end}}
+ </tbody>
+</table>
+
+{{end}}
diff --git a/templates/admin_mailing_list.html b/templates/admin_mailing_list.html
new file mode 100644
index 0000000..c5903b6
--- /dev/null
+++ b/templates/admin_mailing_list.html
@@ -0,0 +1,73 @@
+{{define "title"}}ML {{.MailingList.GetAttributeValue .MailingNameAttr}} |{{end}}
+
+{{define "body"}}
+
+<div class="d-flex">
+ <h4>ML {{.MailingList.GetAttributeValue .MailingNameAttr}}
+ <a class="ml-auto btn btn-sm btn-dark" href="/admin/ldap/{{.MailingList.DN}}">Vue avancée</a>
+ </h4>
+ <a class="ml-auto btn btn-dark" href="/admin/mailing">Liste des ML</a>
+ <a class="ml-4 btn btn-info" href="/">Menu principal</a>
+</div>
+
+{{if .Success}}
+ <div class="alert alert-success mt-2">Modification enregistrée.</div>
+{{end}}
+{{if .Error}}
+ <div class="alert alert-danger mt-2">
+ Impossible d'effectuer la modification.
+ <div style="font-size: 0.8em">{{.Error}}</div>
+ </div>
+{{end}}
+
+<table class="table mt-4">
+ <thead>
+ <th scope="col">Adresse</th>
+ <th scope="col">Nom</th>
+ <th scope="col" style="width: 6em"></th>
+ </thead>
+ <tbody>
+ {{with $root := .}}
+ {{range $member := $root.Members}}
+ <tr>
+ <td>
+ <a href="/admin/ldap/{{$member.DN}}">
+ {{$member.GetAttributeValue "mail"}}
+ </a>
+ </td>
+ <td>{{$member.GetAttributeValue "displayname"}}</td>
+ <td>
+ <form method="POST" onsubmit="return confirm('Supprimer de la ML ?');">
+ <input type="hidden" name="action" value="delete-member" />
+ <input type="hidden" name="member" value="{{.DN}}" />
+ <input type="submit" value="Suppr" class="form-control btn btn-danger btn-sm" />
+ </form>
+ </td>
+ </tr>
+ {{end}}
+ {{end}}
+ </tbody>
+</table>
+
+ <hr class="mt-4" />
+ <h5 class="mt-4">Ajouter un destinataire</h5>
+ <form method="POST">
+ <input type="hidden" name="action" value="add-member" />
+ <div class="row mt-4">
+ <div class="col-md-3"><strong>Utilisateur existant :</strong>
+ </div>
+ <div class="col-md-5">
+ <input class="form-control" type="text" list="users" name="member" placeholder="Utilisateur..." />
+ <datalist id="users">
+ {{range .PossibleNewMembers}}
+ {{if .GetAttributeValue "mail"}}
+ <option value="{{.DN}}">{{if .GetAttributeValue "displayname"}}{{.GetAttributeValue "displayname"}} ({{.GetAttributeValue "mail" }}){{else}}{{.GetAttributeValue "mail"}}{{end}}</option>
+ {{end}}
+ {{end}}
+ </datalist>
+ </div>
+ <div class="col-md-2">
+ <input type="submit" value="Ajouter" class="form-control btn btn-success btn-sm" />
+ </div>
+ </form>
+{{end}}
diff --git a/templates/home.html b/templates/home.html
index 376aefe..afa282f 100644
--- a/templates/home.html
+++ b/templates/home.html
@@ -40,6 +40,7 @@
<div class="list-group list-group-flush">
<a class="list-group-item list-group-item-action" href="/admin/users">Utilisateur·ices</a>
<a class="list-group-item list-group-item-action" href="/admin/groups">Groupes</a>
+ <a class="list-group-item list-group-item-action" href="/admin/mailing">Mailing lists</a>
<a class="list-group-item list-group-item-action" href="/admin/ldap/{{.BaseDN}}">Explorateur LDAP</a>
</div>
</div>
diff --git a/templates/layout.html b/templates/layout.html
index 5f4a315..212ce5e 100644
--- a/templates/layout.html
+++ b/templates/layout.html
@@ -9,7 +9,7 @@
<title>{{template "title"}} Guichet</title>
</head>
<body>
- <div class="container">
+ <div class="container mb-4">
<h1>Guichet Deuxfleurs💮💮</h1>
<hr />
{{template "body" .}}