From 0403494f48d4403f1a90a1f77427a89db4fe5fa1 Mon Sep 17 00:00:00 2001 From: cangui Date: Fri, 9 May 2025 16:57:13 +0200 Subject: [PATCH] JJJJJJ --- backend/renders/renders.go | 5 +++-- frontend/templates/dashboard.pages.tmpl | 4 +++- frontend/templates/head.pages.tmpl | 14 -------------- frontend/templates/sidebar.pages.tmpl | 16 ++++++++++++++++ 4 files changed, 22 insertions(+), 17 deletions(-) create mode 100644 frontend/templates/sidebar.pages.tmpl diff --git a/backend/renders/renders.go b/backend/renders/renders.go index 57ee78e..61521ec 100644 --- a/backend/renders/renders.go +++ b/backend/renders/renders.go @@ -157,8 +157,9 @@ func Dashboard(db *gorm.DB) http.HandlerFunc { func renderTemplate(w http.ResponseWriter, templ string, data map[string]interface{}) { t, err := template.ParseFiles( - "./frontend/templates/head.pages.tmpl", // Template inclus - "./frontend/templates/" + templ + ".pages.tmpl", // Template principal + "./frontend/templates/head.pages.tmpl", + "./frontend/templates/sidebar.pages.tmpl", + "./frontend/templates/" + templ + ".pages.tmpl", ) if err != nil { diff --git a/frontend/templates/dashboard.pages.tmpl b/frontend/templates/dashboard.pages.tmpl index 4c1ed85..6f3ff91 100644 --- a/frontend/templates/dashboard.pages.tmpl +++ b/frontend/templates/dashboard.pages.tmpl @@ -1,7 +1,9 @@ {{ define "dashboard.pages.tmpl" }} {{ template "head" . }} - +
+ + {{ template "sidebar" . }}
diff --git a/frontend/templates/head.pages.tmpl b/frontend/templates/head.pages.tmpl index b15d014..eb36f55 100644 --- a/frontend/templates/head.pages.tmpl +++ b/frontend/templates/head.pages.tmpl @@ -22,20 +22,6 @@ Login -
- - {{ end }} \ No newline at end of file diff --git a/frontend/templates/sidebar.pages.tmpl b/frontend/templates/sidebar.pages.tmpl new file mode 100644 index 0000000..67ecbf0 --- /dev/null +++ b/frontend/templates/sidebar.pages.tmpl @@ -0,0 +1,16 @@ +{{ define "sidebar" }} + +{{ end }}