2022-09-05 05:25:05 +00:00
|
|
|
package renderer
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
|
|
|
|
agendastorage "git.coopgo.io/coopgo-platform/agenda/storage"
|
|
|
|
)
|
|
|
|
|
2022-10-17 03:02:19 +00:00
|
|
|
const agendaMenu = "agenda"
|
2022-09-05 05:25:05 +00:00
|
|
|
|
|
|
|
func (renderer *Renderer) AgendaHome(w http.ResponseWriter, r *http.Request, events []agendastorage.Event, groups map[string]any) {
|
|
|
|
files := renderer.ThemeConfig.GetStringSlice("views.agenda.list.files")
|
|
|
|
state := NewState(r, renderer.ThemeConfig, agendaMenu)
|
|
|
|
state.ViewState = map[string]any{
|
|
|
|
"events": events,
|
|
|
|
"groups": groups,
|
|
|
|
}
|
|
|
|
|
|
|
|
renderer.Render("agenda home", w, r, files, state)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (renderer *Renderer) AgendaCreateEvent(w http.ResponseWriter, r *http.Request) {
|
|
|
|
files := renderer.ThemeConfig.GetStringSlice("views.agenda.create_event.files")
|
|
|
|
state := NewState(r, renderer.ThemeConfig, agendaMenu)
|
|
|
|
|
|
|
|
renderer.Render("agenda create event", w, r, files, state)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (renderer *Renderer) AgendaDisplayEvent(w http.ResponseWriter, r *http.Request, event any, group any, subscribers map[string]any, beneficiaries any) {
|
|
|
|
files := renderer.ThemeConfig.GetStringSlice("views.agenda.display_event.files")
|
|
|
|
state := NewState(r, renderer.ThemeConfig, agendaMenu)
|
2023-02-01 08:53:01 +00:00
|
|
|
|
2022-09-05 05:25:05 +00:00
|
|
|
state.ViewState = map[string]any{
|
|
|
|
"event": event,
|
|
|
|
"group": group,
|
|
|
|
"subscribers": subscribers,
|
|
|
|
"beneficiaries": beneficiaries,
|
|
|
|
}
|
|
|
|
|
|
|
|
renderer.Render("agenda create event", w, r, files, state)
|
|
|
|
}
|
2023-02-01 09:47:19 +00:00
|
|
|
|
|
|
|
//////////////////////////DElete subscriber//////////////////////////////////
|
2023-02-01 10:51:46 +00:00
|
|
|
func (renderer *Renderer) AgendaDeleteSubscribeEvent(w http.ResponseWriter, r *http.Request, eventid string) {
|
2023-02-01 09:47:19 +00:00
|
|
|
files := renderer.ThemeConfig.GetStringSlice("views.agenda.delete_subscriber.files")
|
|
|
|
state := NewState(r, renderer.ThemeConfig, agendaMenu)
|
2023-02-01 10:51:46 +00:00
|
|
|
state.ViewState = map[string]any{
|
|
|
|
"eventid": eventid,
|
|
|
|
}
|
2023-02-01 09:47:19 +00:00
|
|
|
|
|
|
|
renderer.Render("agenda delete subscriber", w, r, files, state)
|
|
|
|
}
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////
|
2023-02-08 08:36:12 +00:00
|
|
|
|
|
|
|
//////////////////////////History Event//////////////////////////////////
|
|
|
|
func (renderer *Renderer) AgendaHistoryEvent(w http.ResponseWriter, r *http.Request, event any, group any, subscribers map[string]any, beneficiaries any) {
|
|
|
|
files := renderer.ThemeConfig.GetStringSlice("views.agenda.history_event.files")
|
|
|
|
state := NewState(r, renderer.ThemeConfig, agendaMenu)
|
|
|
|
state.ViewState = map[string]any{
|
|
|
|
"event": event,
|
|
|
|
"group": group,
|
|
|
|
"subscribers": subscribers,
|
|
|
|
"beneficiaries": beneficiaries,
|
|
|
|
}
|
|
|
|
|
|
|
|
renderer.Render("agenda history event", w, r, files, state)
|
|
|
|
}
|
2023-02-22 11:47:29 +00:00
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
2023-02-01 08:53:01 +00:00
|
|
|
func (renderer *Renderer) AgendaUpdateEvent(w http.ResponseWriter, r *http.Request, event any) {
|
|
|
|
files := renderer.ThemeConfig.GetStringSlice("views.agenda.update.files")
|
|
|
|
state := NewState(r, renderer.ThemeConfig, agendaMenu)
|
|
|
|
|
|
|
|
state.ViewState = map[string]any{
|
|
|
|
"event": event,
|
|
|
|
}
|
|
|
|
|
|
|
|
renderer.Render("event_update", w, r, files, state)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (renderer *Renderer) AgendaDeleteEvent(w http.ResponseWriter, r *http.Request, event any) {
|
|
|
|
files := renderer.ThemeConfig.GetStringSlice("views.agenda.delete.files")
|
|
|
|
state := NewState(r, renderer.ThemeConfig, agendaMenu)
|
|
|
|
|
|
|
|
state.ViewState = map[string]any{
|
|
|
|
"event": event,
|
|
|
|
}
|
|
|
|
|
|
|
|
renderer.Render("event_deleteEvent", w, r, files, state)
|
|
|
|
}
|