rename index template to app

This commit is contained in:
Victor Lacasse-Beaudoin 2024-12-30 19:14:49 -05:00
parent 7f3901ddc2
commit 294c6221aa
3 changed files with 4 additions and 6 deletions

View file

@ -20,7 +20,7 @@ func UIIndex(ctx context.Context, bottinClient *bottin.APIClient, dbClient *DBCl
Result string Result string
} }
return c.Render(http.StatusOK, "index", func() (d data) { return c.Render(http.StatusOK, "app", func() (d data) {
if err := func() error { if err := func() error {
select { select {
case <-ctx.Done(): case <-ctx.Done():
@ -78,7 +78,7 @@ func UICreateTransaction(ctx context.Context, cfg Config, bottinClient *bottin.A
//BottinHealth bottin.ReadHealthResponse //BottinHealth bottin.ReadHealthResponse
} }
return c.Render(http.StatusOK, "index", func() (d data) { return c.Render(http.StatusOK, "app", func() (d data) {
if err := func() error { if err := func() error {
if bottinClient == nil { if bottinClient == nil {
return fmt.Errorf("Cannot operate on nil *bottin.APIClient") return fmt.Errorf("Cannot operate on nil *bottin.APIClient")

View file

@ -1,4 +1,4 @@
{{ define "index" }} {{ define "app" }}
<!DOCTYPE html> <!DOCTYPE html>
<html lang="fr"> <html lang="fr">
<head> <head>
@ -114,6 +114,7 @@ button {
{{ if .Error }}<p class="result">Erreur: {{ .Error }}</p>{{ end }} {{ if .Error }}<p class="result">Erreur: {{ .Error }}</p>{{ end }}
{{ if .Result }}<p class="result">{{ .Result }}</p>{{ end }} {{ if .Result }}<p class="result">{{ .Result }}</p>{{ end }}
</body> </body>
</html> </html>

View file

@ -1,3 +0,0 @@
{{ define "test" }}
{{ . }}
{{ end }}