2022-08-11 15:26:55 +00:00
|
|
|
package renderer
|
|
|
|
|
|
|
|
import "net/http"
|
|
|
|
|
|
|
|
const administrationMenu = "administration"
|
|
|
|
|
|
|
|
func (renderer *Renderer) Administration(w http.ResponseWriter, r *http.Request, groups any) {
|
|
|
|
files := renderer.ThemeConfig.GetStringSlice("views.administration.home.files")
|
|
|
|
state := NewState(r, renderer.ThemeConfig, administrationMenu)
|
|
|
|
state.ViewState = map[string]any{
|
|
|
|
"groups": groups,
|
|
|
|
}
|
|
|
|
|
|
|
|
renderer.Render("administration", w, r, files, state)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (renderer *Renderer) AdministrationCreateGroup(w http.ResponseWriter, r *http.Request) {
|
|
|
|
files := renderer.ThemeConfig.GetStringSlice("views.administration.create_group.files")
|
|
|
|
state := NewState(r, renderer.ThemeConfig, administrationMenu)
|
|
|
|
|
|
|
|
renderer.Render("administration", w, r, files, state)
|
|
|
|
}
|
|
|
|
|
2022-09-06 13:02:59 +00:00
|
|
|
func (renderer *Renderer) AdministrationGroupDisplay(w http.ResponseWriter, r *http.Request, group any, groupmembers []any, admins []any) {
|
2022-08-11 15:26:55 +00:00
|
|
|
files := renderer.ThemeConfig.GetStringSlice("views.administration.display_group.files")
|
|
|
|
state := NewState(r, renderer.ThemeConfig, administrationMenu)
|
|
|
|
state.ViewState = map[string]any{
|
2022-09-06 13:02:59 +00:00
|
|
|
"group": group,
|
|
|
|
"members": groupmembers,
|
|
|
|
"admins": admins,
|
2022-08-11 15:26:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
renderer.Render("administration", w, r, files, state)
|
|
|
|
}
|