26 lines
753 B
Go
26 lines
753 B
Go
package handlers
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"git.haelnorr.com/h/golib/hws"
|
|
adminview "git.haelnorr.com/h/oslstats/internal/view/adminview"
|
|
"github.com/uptrace/bun"
|
|
)
|
|
|
|
// AdminRolesPage renders the full admin dashboard page with roles section
|
|
func AdminRolesPage(s *hws.Server, conn *bun.DB) http.Handler {
|
|
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
// TODO: Load roles from database
|
|
renderSafely(adminview.RolesPage(), s, r, w)
|
|
})
|
|
}
|
|
|
|
// AdminRolesList shows all roles (HTMX content replacement)
|
|
func AdminRolesList(s *hws.Server, conn *bun.DB) http.Handler {
|
|
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
// TODO: Load roles from database
|
|
renderSafely(adminview.RolesList(), s, r, w)
|
|
})
|
|
}
|