diff --git a/orbitcontroller.go b/orbitcontroller.go index 504053d..ada0c29 100644 --- a/orbitcontroller.go +++ b/orbitcontroller.go @@ -537,11 +537,31 @@ func RegisterOrbitRoutes(mux *http.ServeMux) { log.Println("[ORBIT] Orbit routes registered") } -// handleOrbitConsole serves the Orbit web dashboard. +// handleOrbitConsole serves the Orbit web dashboard or landing page. func handleOrbitConsole(w http.ResponseWriter, r *http.Request) { email, err := getSessionUser(r) if err != nil { - http.Redirect(w, r, "/oort/login?next=/orbit", http.StatusFound) + if r.URL.Query().Get("console") == "1" { + http.Redirect(w, r, "/oort/login?next=/orbit", http.StatusFound) + return + } + w.Header().Set("Content-Type", "text/html; charset=utf-8") + data := map[string]interface{}{ + "Year": time.Now().Year(), + } + if errTmpl := tmpl.ExecuteTemplate(w, "orbit.html", data); errTmpl != nil { + http.Redirect(w, r, "/oort/login?next=/orbit", http.StatusFound) + } + return + } + + if r.URL.Query().Get("landing") == "1" { + w.Header().Set("Content-Type", "text/html; charset=utf-8") + data := map[string]interface{}{ + "UserEmail": email, + "Year": time.Now().Year(), + } + tmpl.ExecuteTemplate(w, "orbit.html", data) return } diff --git a/templates/git.html b/templates/git.html index ffffd8d..60dd880 100644 --- a/templates/git.html +++ b/templates/git.html @@ -4,7 +4,7 @@