Séparer templates de public/ -> templates/
Séparer embedFS en publicFS et templatesFS
This commit is contained in:
parent
129e8fbf1b
commit
2eee1f2fd2
14 changed files with 26 additions and 9 deletions
14
templates/html/a-propos.gohtml
Normal file
14
templates/html/a-propos.gohtml
Normal file
|
@ -0,0 +1,14 @@
|
|||
{{ define "a-propos-html" }}
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>AGECEM | À propos</title>
|
||||
{{ template "general-html" }}
|
||||
</head>
|
||||
<body>
|
||||
{{ template "header-html" }}
|
||||
<h1>À propos</h1>
|
||||
</body>
|
||||
</html>
|
||||
{{ end }}
|
14
templates/html/actualite.gohtml
Normal file
14
templates/html/actualite.gohtml
Normal file
|
@ -0,0 +1,14 @@
|
|||
{{ define "actualite-html" }}
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>AGECEM | Actualité</title>
|
||||
{{ template "general-html" }}
|
||||
</head>
|
||||
<body>
|
||||
{{ template "header-html" }}
|
||||
<h1>Actualité</h1>
|
||||
</body>
|
||||
</html>
|
||||
{{ end }}
|
28
templates/html/admin-upload.gohtml
Normal file
28
templates/html/admin-upload.gohtml
Normal file
|
@ -0,0 +1,28 @@
|
|||
{{ define "admin-upload-html" }}
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>AGECEM</title>
|
||||
{{ template "general-html" }}
|
||||
</head>
|
||||
<body>
|
||||
{{ template "header-html" }}
|
||||
<h1>Upload</h1>
|
||||
<form action="/admin/documents/upload" method="post" enctype="multipart/form-data">
|
||||
<label for="bucket">Type de document:</label>
|
||||
|
||||
<select name="bucket" id="bucket">
|
||||
<option value="proces-verbaux">Procès verbaux</option>
|
||||
<option value="politiques-et-reglements">Politiques et Règlements</option>
|
||||
</select>
|
||||
<br>
|
||||
Document: <input type="file" name="document">
|
||||
<br>
|
||||
<br>
|
||||
<input type="submit" value="Submit">
|
||||
</form>
|
||||
<p>{{ .Message }}</p>
|
||||
</body>
|
||||
</html>
|
||||
{{ end }}
|
17
templates/html/admin.gohtml
Normal file
17
templates/html/admin.gohtml
Normal file
|
@ -0,0 +1,17 @@
|
|||
{{ define "admin-html" }}
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>AGECEM</title>
|
||||
{{ template "general-html" }}
|
||||
</head>
|
||||
<body>
|
||||
{{ template "header-html" }}
|
||||
<h1>Admin</h1>
|
||||
<ul>
|
||||
<li><a href="/admin/documents/upload">Ajout de document</a></li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
||||
{{ end }}
|
26
templates/html/documentation.gohtml
Normal file
26
templates/html/documentation.gohtml
Normal file
|
@ -0,0 +1,26 @@
|
|||
{{ define "documentation-html" }}
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>AGECEM | Documentation</title>
|
||||
{{ template "general-html" }}
|
||||
</head>
|
||||
<body>
|
||||
{{ template "header-html" }}
|
||||
<h1>Documentation</h1>
|
||||
<p>
|
||||
{{ range . }}
|
||||
{{ $bucket_name := .Name }}
|
||||
<h2>{{ $bucket_name }}</h2>
|
||||
|
||||
<ul>
|
||||
{{ range .Documents }}
|
||||
<li> <a href="/public/documentation/{{ $bucket_name }}/{{ . }}">{{ . }}</a></li>
|
||||
{{ end}}
|
||||
</ul>
|
||||
{{ end }}
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
{{ end }}
|
14
templates/html/formulaires.gohtml
Normal file
14
templates/html/formulaires.gohtml
Normal file
|
@ -0,0 +1,14 @@
|
|||
{{ define "formulaires-html" }}
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>AGECEM | Formulaires</title>
|
||||
{{ template "general-html" }}
|
||||
</head>
|
||||
<body>
|
||||
{{ template "header-html" }}
|
||||
<h1>Formulaires</h1>
|
||||
</body>
|
||||
</html>
|
||||
{{ end }}
|
3
templates/html/general.gohtml
Normal file
3
templates/html/general.gohtml
Normal file
|
@ -0,0 +1,3 @@
|
|||
{{ define "general-html" }}
|
||||
<link rel="stylesheet" href="/static/general.css">
|
||||
{{ end }}
|
16
templates/html/header.gohtml
Normal file
16
templates/html/header.gohtml
Normal file
|
@ -0,0 +1,16 @@
|
|||
{{ define "header-html" }}
|
||||
|
||||
<ul>
|
||||
<li><a href="/">index</a></li>
|
||||
<li><a href="/a-propos">À propos</a></li>
|
||||
<li><a href="/actualite">Actualité</a></li>
|
||||
<li><a href="/vie-etudiante">Vie étudiante</a></li>
|
||||
<li><a href="/documentation">Documentation</a></li>
|
||||
<li><a href="/formulaires">Formulaires</a></li>
|
||||
</ul>
|
||||
|
||||
<ul>
|
||||
<li><a href="/admin">admin</a></li>
|
||||
</ul>
|
||||
|
||||
{{ end }}
|
15
templates/html/index.gohtml
Normal file
15
templates/html/index.gohtml
Normal file
|
@ -0,0 +1,15 @@
|
|||
{{ define "index-html" }}
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>AGECEM</title>
|
||||
{{ template "general-html" }}
|
||||
<link rel="stylesheet" href="static/index.css">
|
||||
</head>
|
||||
<body>
|
||||
{{ template "header-html" }}
|
||||
<h1>Association Générale Étudiante du Cégep Édouard-Montpetit</h1>
|
||||
</body>
|
||||
</html>
|
||||
{{ end }}
|
14
templates/html/vie-etudiante.gohtml
Normal file
14
templates/html/vie-etudiante.gohtml
Normal file
|
@ -0,0 +1,14 @@
|
|||
{{ define "vie-etudiante-html" }}
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>AGECEM | Vie étudiante</title>
|
||||
{{ template "general-html" }}
|
||||
</head>
|
||||
<body>
|
||||
{{ template "header-html" }}
|
||||
<h1>Vie étudiante</h1>
|
||||
</body>
|
||||
</html>
|
||||
{{ end }}
|
10
templates/templates.go
Normal file
10
templates/templates.go
Normal file
|
@ -0,0 +1,10 @@
|
|||
package templates
|
||||
|
||||
import "embed"
|
||||
|
||||
//go:embed html/*.gohtml
|
||||
var templatesFS embed.FS
|
||||
|
||||
func GetTemplatesFS() embed.FS {
|
||||
return templatesFS
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue