feat: redesign website templates with full pages
All checks were successful
CI / lint (push) Successful in 18s
CI / test (push) Successful in 20s
CI / build (push) Successful in 19s
CI / docker (push) Successful in 1m7s

- Redesigned base.html: dark Minecraft theme, sticky header, responsive grid, cards, server cards with status indicators, profile styles
- index.html: hero section, server list grid, how-to-start steps, features section
- login.html: centered card layout, client-side validation, fetch API
- registration.html: password confirmation, pattern validation, error alerts
- profile.html: new page — skin/cape upload & delete, launcher download links, auth-gated via localStorage token
- templates.go: added /profile route, extended pageData with Username/UUID
This commit is contained in:
2026-06-03 20:37:24 +03:00
parent e94cd4c23c
commit 008d9a129e
6 changed files with 759 additions and 116 deletions

View File

@@ -14,7 +14,9 @@ import (
// pageData is passed to all templates.
type pageData struct {
Title string
Title string
Username string
UUID string
}
// Handler serves template-rendered pages.
@@ -37,6 +39,7 @@ func (h *Handler) RegisterRoutes(mux *http.ServeMux) {
mux.HandleFunc("GET /", h.index)
mux.HandleFunc("GET /login", h.loginPage)
mux.HandleFunc("GET /register", h.registerPage)
mux.HandleFunc("GET /profile", h.profilePage)
}
// ── Page handlers ──────────────────────────────────────────────
@@ -69,6 +72,14 @@ func (h *Handler) registerPage(w http.ResponseWriter, r *http.Request) {
h.render(w, "register.html", pageData{Title: "Регистрация"})
}
func (h *Handler) profilePage(w http.ResponseWriter, r *http.Request) {
if !h.loaded {
fallback(w, "Profile")
return
}
h.render(w, "profile.html", pageData{Title: "Профиль"})
}
// render executes the named template with data, writing to w.
func (h *Handler) render(w http.ResponseWriter, name string, data pageData) {
w.Header().Set("Content-Type", "text/html; charset=utf-8")