aboutsummaryrefslogtreecommitdiff
path: root/backend/templates
diff options
context:
space:
mode:
authorAnhgelus Morhtuuzh <william@herges.fr>2025-12-22 15:07:55 +0100
committerAnhgelus Morhtuuzh <william@herges.fr>2025-12-22 15:07:55 +0100
commit84af6427d8205b1882b9f9df11ce394f96d6b792 (patch)
treeae51188d67616069300afd6a19300ff7ed23e7d3 /backend/templates
parent93c4f9047426f9f56940ed2b733dcde2d98b0c0e (diff)
feat(backend): admin dashboard
Diffstat (limited to 'backend/templates')
-rw-r--r--backend/templates/admin.html33
-rw-r--r--backend/templates/components.html24
2 files changed, 45 insertions, 12 deletions
diff --git a/backend/templates/admin.html b/backend/templates/admin.html
new file mode 100644
index 0000000..41addc9
--- /dev/null
+++ b/backend/templates/admin.html
@@ -0,0 +1,33 @@
+{{define "body"}}
+<main id="content">
+ <div class="introduction">
+ <h1>Administration</h1>
+ <p>
+ Panel d'administration très simple. Il affiche les stats et possiblement les webmentions et autre contenu à
+ modérer.
+ </p>
+ </div>
+ <article>
+ <h2>Stats</h2>
+ <table>
+ <thead>
+ <tr>
+ <th>Origin</th>
+ <th>Target</th>
+ <th>Visits</th>
+ </tr>
+ </thead>
+ <tbody>
+ {{ range .Rows }}
+ <tr>
+ <td>{{ .Origin }}</td>
+ <td>{{ .Target }}</td>
+ <td>{{ .Visit }}</td>
+ </tr>
+ {{ end }}
+ </tbody>
+ </table>
+ <div class="pagination">{{ template "pagination" . }}</div>
+ </article>
+</main>
+{{end}}
diff --git a/backend/templates/components.html b/backend/templates/components.html
index b4ffbe6..b180123 100644
--- a/backend/templates/components.html
+++ b/backend/templates/components.html
@@ -1,4 +1,14 @@
-{{define "section_display"}}
+{{ define "pagination" }}
+<nav>
+ {{ if ne .CurrentPage 1 }}<a href="?page={{ before .CurrentPage }}">Précédent</a>{{else}}
+ <p></p>
+ {{end}}
+ <p>{{ .CurrentPage }}/{{ .PagesNumber }}</p>
+ {{ if ne .CurrentPage .PagesNumber }}<a href="?page={{ next .CurrentPage }}">Suivant</a>{{else}}
+ <p></p>
+ {{end}}
+</nav>
+{{ end }} {{define "section_display"}}
<article>
{{ $uri := .URI }} {{ range .Data }}
<article>
@@ -11,17 +21,7 @@
</article>
{{ end }}
<div class="pagination">
- {{ if .Paginate }}
- <nav>
- {{ if ne .CurrentPage 1 }}<a href="?page={{ before .CurrentPage }}">Précédent</a>{{else}}
- <p></p>
- {{end}}
- <p>{{ .CurrentPage }}/{{ .PagesNumber }}</p>
- {{ if ne .CurrentPage .PagesNumber }}<a href="?page={{ next .CurrentPage }}">Suivant</a>{{else}}
- <p></p>
- {{end}}
- </nav>
- {{ else }} {{ if eq (len .Data) .LenMax }}
+ {{ if .Paginate }} {{ template "pagination" . }} {{ else }} {{ if eq (len .Data) .LenMax }}
<a href="/{{ $uri }}/">Voir plus</a>
{{ end }} {{ end }}
</div>