feature(ui): permettre la modification de fichiers par UI
This commit is contained in:
parent
5943791364
commit
f6a8dfe2f4
9 changed files with 315 additions and 1 deletions
55
ui/admin-edit.html
Normal file
55
ui/admin-edit.html
Normal file
|
@ -0,0 +1,55 @@
|
|||
{{ 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 }}
|
Loading…
Add table
Add a link
Reference in a new issue