diff options
Diffstat (limited to 'backend/templates')
| -rw-r--r-- | backend/templates/admin.html | 33 | ||||
| -rw-r--r-- | backend/templates/components.html | 24 |
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> |
