Ajouter upload de fichier par form html #49

Merged
vlbeaudoin merged 7 commits from feature/admin-route into main 2023-04-28 19:33:30 -04:00
3 changed files with 38 additions and 1 deletions
Showing only changes of commit a1146d182f - Show all commits

View file

@ -199,6 +199,8 @@ func RunServer() {
groupAdmin.GET("", handleAdmin) groupAdmin.GET("", handleAdmin)
groupAdmin.GET("/documents/upload", handleAdminDocumentsUpload)
e.Logger.Fatal(e.Start( e.Logger.Fatal(e.Start(
fmt.Sprintf(":%d", viper.GetInt("server.port")))) fmt.Sprintf(":%d", viper.GetInt("server.port"))))
} }
@ -717,7 +719,11 @@ func handlePublicDocumentation(c echo.Context) error {
} }
func handleAdmin(c echo.Context) error { func handleAdmin(c echo.Context) error {
return c.JSON(http.StatusNotImplemented, map[string]string{"message": "Not Implemented"}) return c.Render(http.StatusOK, "admin-html", nil)
}
func handleAdminDocumentsUpload(c echo.Context) error {
return c.Render(http.StatusOK, "admin-upload-html", nil)
} }
// CSS Handlers // CSS Handlers

View file

@ -0,0 +1,14 @@
{{ 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>
</body>
</html>
{{ end }}

17
public/html/admin.gohtml Normal file
View 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 }}