JJJJJJ
This commit is contained in:
parent
3cf5f3f214
commit
0403494f48
@ -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 {
|
||||
|
||||
@ -1,7 +1,9 @@
|
||||
{{ define "dashboard.pages.tmpl" }}
|
||||
{{ template "head" . }}
|
||||
|
||||
|
||||
<div class="columns">
|
||||
<!-- Sidebar -->
|
||||
{{ template "sidebar" . }}
|
||||
|
||||
<!-- Main content -->
|
||||
<div class="column is-10">
|
||||
|
||||
@ -22,20 +22,6 @@
|
||||
<script src="/frontend/assets/js/function/functions.js"></script>
|
||||
<title>Login</title>
|
||||
</head>
|
||||
<div class="columns">
|
||||
<!-- Sidebar -->
|
||||
<aside class="menu column is-2">
|
||||
<p class="menu-label">Navigation</p>
|
||||
<ul class="menu-list">
|
||||
<li><a href="/dashboard">🏠 Dashboard</a></li>
|
||||
{{ if eq .User.Role "ADMIN" }}
|
||||
<li><a href="/admin/users">👤 Utilisateurs</a></li>
|
||||
<li><a href="/test/send">📤 Test envoi</a></li>
|
||||
<li><a href="/test/send2">📤 Test envoi template</a></li>
|
||||
{{ end }}
|
||||
<a href="/admin/user/{{ .User.ID }}/conversations">💬 Mes conversations</a>
|
||||
|
||||
</ul>
|
||||
</aside>
|
||||
|
||||
{{ end }}
|
||||
16
frontend/templates/sidebar.pages.tmpl
Normal file
16
frontend/templates/sidebar.pages.tmpl
Normal file
@ -0,0 +1,16 @@
|
||||
{{ define "sidebar" }}
|
||||
<aside class="menu column is-2">
|
||||
<p class="menu-label">Navigation</p>
|
||||
<ul class="menu-list">
|
||||
<li><a href="/dashboard">🏠 Dashboard</a></li>
|
||||
|
||||
{{ if eq .User.Role "ADMIN" }}
|
||||
<li><a href="/admin/users">👤 Utilisateurs</a></li>
|
||||
<li><a href="/test/send">📤 Test envoi</a></li>
|
||||
<li><a href="/test/send2">📤 Test envoi template</a></li>
|
||||
{{ end }}
|
||||
|
||||
<li><a href="/admin/user/{{ .User.ID }}/conversations">💬 Mes conversations</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
{{ end }}
|
||||
Loading…
Reference in New Issue
Block a user