Si on suit les considérations du domain-driven design, le fait qu'on réfère toustes à cette partie du code comme `le frontend` me pousse à renommer le package pour mieux réflèter notre utilisation. Ça devrait rendre plus évident où les fichiers sources du frontend sont situés.
55 lines
1.7 KiB
HTML
55 lines
1.7 KiB
HTML
{{ define "admin-edit-html" }}
|
|
<!DOCTYPE html>
|
|
<html lang="fr">
|
|
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>AGECEM</title>
|
|
{{ template "general-html" }}
|
|
<link rel="stylesheet" href="/public/css/admin-edit.css">
|
|
<script src="https://unpkg.com/htmx.org@2.0.3"></script>
|
|
</head>
|
|
|
|
<body>
|
|
{{ template "header-html" }}
|
|
{{ if .Error }}
|
|
<b>{{ .Error }}</b>
|
|
{{ end }}
|
|
<article id="moduleAdminEdit">
|
|
<h2>Modifier les documents</h2>
|
|
|
|
{{ range .Buckets }}
|
|
{{ $bucketID := .ID }}
|
|
<h3>{{ .DisplayName }} ({{ .ID }})</h3>
|
|
{{ if not .DocumentKeys }}
|
|
<p><i>Aucun document de type {{ .DisplayName }} enregistré, voir le <a href="/admin">panneau d'administration</a> pour en ajouter.</i></p>
|
|
{{ else }}
|
|
<table>
|
|
<tr><th></th><th>Renommer</th><th>Effacer</th></tr>
|
|
{{ range .DocumentKeys }}
|
|
<tr>
|
|
<td>{{ . }}</td>
|
|
<td><a
|
|
hx-get="/admin/documents/edit/{{$bucketID}}/{{.}}/key"
|
|
hx-target="#app-dialog"
|
|
hx-on:click="document.getElementById('app-dialog').style.display = 'block';">
|
|
<button>🖉</button>
|
|
</a></td>
|
|
<td><a
|
|
hx-get="/admin/documents/edit/{{$bucketID}}/{{.}}/delete"
|
|
hx-target="#app-dialog"
|
|
hx-on:click="document.getElementById('app-dialog').style.display = 'block';">
|
|
<button>🗑</button>
|
|
</a></td>
|
|
</tr>
|
|
{{ end }}
|
|
</table>
|
|
{{ end }}
|
|
{{ end }}
|
|
<div id="app-dialog" style="display: none;"> </div>
|
|
</article>
|
|
{{ template "footer-html" }}
|
|
</body>
|
|
|
|
</html>
|
|
{{ end }}
|