Compare commits
No commits in common. "be2c3ae1784883b6ea40009ebe09c579d4138a62" and "eff740072d1ca3abe908bd14f3bbc412381dc149" have entirely different histories.
be2c3ae178
...
eff740072d
@ -3,7 +3,6 @@ package routes
|
|||||||
import (
|
import (
|
||||||
"GoWeb/app"
|
"GoWeb/app"
|
||||||
"GoWeb/controllers"
|
"GoWeb/controllers"
|
||||||
"io/fs"
|
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
)
|
)
|
||||||
@ -16,14 +15,8 @@ func GetRoutes(app *app.App) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Serve static files
|
// Serve static files
|
||||||
staticFS, err := fs.Sub(app.Res, "static")
|
http.Handle("/file/", http.FileServer(http.Dir("./static")))
|
||||||
if err != nil {
|
log.Println("Serving static files from: ./static")
|
||||||
log.Println(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
staticHandler := http.FileServer(http.FS(staticFS))
|
|
||||||
http.Handle("/static/", http.StripPrefix("/static/", staticHandler))
|
|
||||||
log.Println("Serving static files from embedded FS")
|
|
||||||
|
|
||||||
// Pages
|
// Pages
|
||||||
http.HandleFunc("/", getController.ShowHome)
|
http.HandleFunc("/", getController.ShowHome)
|
||||||
|
@ -1,75 +0,0 @@
|
|||||||
body {
|
|
||||||
font-family: Arial, sans-serif;
|
|
||||||
background-color: lightblue;
|
|
||||||
color: #333;
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.container {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
width: 80%;
|
|
||||||
padding: 20px;
|
|
||||||
margin: 0 auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.footer-container {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
height: 80px;
|
|
||||||
background-color: lightblue;
|
|
||||||
}
|
|
||||||
|
|
||||||
footer {
|
|
||||||
color: #0077be;
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
|
|
||||||
form label {
|
|
||||||
display: block;
|
|
||||||
font-weight: bold;
|
|
||||||
margin-bottom: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
form input[type="text"],
|
|
||||||
form input[type="password"] {
|
|
||||||
padding: 10px;
|
|
||||||
font-size: 16px;
|
|
||||||
border-radius: 5px;
|
|
||||||
border: none;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
width: 100%;
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
|
|
||||||
form input[type="submit"] {
|
|
||||||
display: inline-block;
|
|
||||||
padding: 10px 20px;
|
|
||||||
background-color: #0077be;
|
|
||||||
color: #fff;
|
|
||||||
border-radius: 5px;
|
|
||||||
text-decoration: none;
|
|
||||||
border: none;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
form input[type="submit"]:hover {
|
|
||||||
background-color: #005fa3;
|
|
||||||
}
|
|
||||||
|
|
||||||
h1, h2, h3, h4, h5, h6 {
|
|
||||||
font-weight: bold;
|
|
||||||
color: #333;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
a {
|
|
||||||
color: #0077be;
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
a:hover {
|
|
||||||
text-decoration: underline;
|
|
||||||
}
|
|
@ -3,14 +3,11 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<title>SiteName - {{ template "pageTitle" }}</title>
|
<title>SiteName - {{ template "pageTitle" }}</title>
|
||||||
<link rel="stylesheet" href="/static/css/style.css">
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
{{ template "content" . }}
|
{{ template "content" . }}
|
||||||
<div class="footer-container">
|
|
||||||
<footer>
|
|
||||||
<p>SiteName - Powered by GoWeb!</p>
|
|
||||||
</footer>
|
|
||||||
</div>
|
|
||||||
</body>
|
</body>
|
||||||
|
<footer>
|
||||||
|
<p>SiteName - Powered by Go!</p>
|
||||||
|
</footer>
|
||||||
</html>
|
</html>
|
@ -1,16 +1,13 @@
|
|||||||
{{ define "pageTitle" }}Login{{ end }}
|
{{ define "pageTitle" }}Login{{ end }}
|
||||||
|
|
||||||
{{ define "content" }}
|
{{ define "content" }}
|
||||||
<h1>Login</h1>
|
<form action="/login-handle" method="post">
|
||||||
<div class="container">
|
<input name="csrf_token" type="hidden" value="{{ .CsrfToken }}">
|
||||||
<form action="/login-handle" method="post">
|
|
||||||
<input name="csrf_token" type="hidden" value="{{ .CsrfToken }}">
|
|
||||||
|
|
||||||
<label for="username">Username:</label><br>
|
<label for="username">Username:</label><br>
|
||||||
<input id="username" name="username" type="text" value="John"><br><br>
|
<input id="username" name="username" type="text" value="John"><br><br>
|
||||||
<label for="password">Password:</label><br>
|
<label for="password">Password:</label><br>
|
||||||
<input id="password" name="password" type="password"><br><br>
|
<input id="password" name="password" type="password"><br><br>
|
||||||
<input type="submit" value="Submit">
|
<input type="submit" value="Submit">
|
||||||
</form>
|
</form>
|
||||||
</div>
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
@ -1,16 +1,13 @@
|
|||||||
{{ define "pageTitle" }}Register{{ end }}
|
{{ define "pageTitle" }}Register{{ end }}
|
||||||
|
|
||||||
{{ define "content" }}
|
{{ define "content" }}
|
||||||
<h1>Register</h1>
|
<form action="/register-handle" method="post">
|
||||||
<div class="container">
|
<input name="csrf_token" type="hidden" value="{{ .CsrfToken }}">
|
||||||
<form action="/register-handle" method="post">
|
|
||||||
<input name="csrf_token" type="hidden" value="{{ .CsrfToken }}">
|
|
||||||
|
|
||||||
<label for="username">Username:</label><br>
|
<label for="username">Username:</label><br>
|
||||||
<input id="username" name="username" type="text" value="John"><br><br>
|
<input id="username" name="username" type="text" value="John"><br><br>
|
||||||
<label for="password">Password:</label><br>
|
<label for="password">Password:</label><br>
|
||||||
<input id="password" name="password" type="password"><br><br>
|
<input id="password" name="password" type="password"><br><br>
|
||||||
<input type="submit" value="Submit">
|
<input type="submit" value="Submit">
|
||||||
</form>
|
</form>
|
||||||
</div>
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user