You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
398 B
19 lines
398 B
package web
|
|
|
|
import (
|
|
"html/template"
|
|
"net/http"
|
|
)
|
|
|
|
func UsersHandler(w http.ResponseWriter, r *http.Request) {
|
|
tmpl := template.Must(template.ParseFiles("templates/layout.html", "templates/partials/users.html"))
|
|
data := map[string]interface{}{
|
|
"Title": "Users",
|
|
}
|
|
|
|
if r.Header.Get("HX-Request") == "true" {
|
|
tmpl.ExecuteTemplate(w, "content", data)
|
|
} else {
|
|
tmpl.Execute(w, data)
|
|
}
|
|
}
|
|
|