startpage + panel k i w
This commit is contained in:
parent
4de2ee47f4
commit
24a415a8a6
9
main.go
9
main.go
@ -10,13 +10,20 @@ var view *template.Template
|
|||||||
func startpage(w http.ResponseWriter, r *http.Request){
|
func startpage(w http.ResponseWriter, r *http.Request){
|
||||||
view.ExecuteTemplate(w, "index.html", nil)
|
view.ExecuteTemplate(w, "index.html", nil)
|
||||||
}
|
}
|
||||||
|
func klientpage(w http.ResponseWriter, r *http.Request){
|
||||||
|
view.ExecuteTemplate(w, "panelklient.html", nil)
|
||||||
|
}
|
||||||
|
func wlaspage(w http.ResponseWriter, r *http.Request){
|
||||||
|
view.ExecuteTemplate(w, "panelwlas.html", nil)
|
||||||
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
||||||
view = template.Must(template.ParseGlob("templates/*.html"))
|
view = template.Must(template.ParseGlob("templates/*.html"))
|
||||||
http.Handle("/appearance/", http.StripPrefix("/appearance/", http.FileServer(http.Dir("appearance"))))
|
http.Handle("/appearance/", http.StripPrefix("/appearance/", http.FileServer(http.Dir("appearance"))))
|
||||||
http.HandleFunc("/", startpage)
|
http.HandleFunc("/", startpage)
|
||||||
|
http.HandleFunc("/panelklient", klientpage)
|
||||||
|
http.HandleFunc("/panelwlas", wlaspage)
|
||||||
http.ListenAndServe(":8888", nil)
|
http.ListenAndServe(":8888", nil)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,20 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="pl">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<h1>Utwórz liste potrzebnych produktów</h1>
|
||||||
|
<a href="/panelklient"><button>Utwórz</button></a>
|
||||||
|
|
||||||
|
|
||||||
|
<h1>Panel właściciela</h1>
|
||||||
|
<form method="post" action="/panelwlas" name="zaloguj">
|
||||||
|
<input type="text" name="login" placeholder="Login">
|
||||||
|
<input type="password" name="password" placeholder="Password">
|
||||||
|
<input type="submit" value="Zaloguj" class="btn">
|
||||||
|
</form>
|
||||||
|
</body>
|
||||||
|
</html>
|
9
templates/panelklient.html
Normal file
9
templates/panelklient.html
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="pl">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
LISTA KLIENT
|
||||||
|
</body>
|
||||||
|
</html>
|
9
templates/panelwlas.html
Normal file
9
templates/panelwlas.html
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="pl">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
LISTA WLAS
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Reference in New Issue
Block a user