Compare commits
12 Commits
modifyAnEv
...
deleteMemb
| Author | SHA1 | Date | |
|---|---|---|---|
| f698891865 | |||
| 193f5dfb6f | |||
| 49de2f22c4 | |||
| ab8cbf6f73 | |||
| 10bde53c5e | |||
| 28c8fa8a90 | |||
| 11851fec61 | |||
| 696cd1d87f | |||
|
|
372647b3b9 | ||
|
|
56c1b45f45 | ||
|
|
62f64747c3 | ||
| 56d0914568 |
@@ -7,7 +7,6 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"sort"
|
"sort"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
formvalidators "git.coopgo.io/coopgo-apps/parcoursmob/utils/form-validators"
|
formvalidators "git.coopgo.io/coopgo-apps/parcoursmob/utils/form-validators"
|
||||||
@@ -108,7 +107,6 @@ func (h *ApplicationHandler) AgendaCreateEvent(w http.ResponseWriter, r *http.Re
|
|||||||
Allday: eventForm.Allday,
|
Allday: eventForm.Allday,
|
||||||
MaxSubscribers: int64(eventForm.MaxSubscribers),
|
MaxSubscribers: int64(eventForm.MaxSubscribers),
|
||||||
Data: data,
|
Data: data,
|
||||||
Deleted: false,
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -121,7 +119,7 @@ func (h *ApplicationHandler) AgendaCreateEvent(w http.ResponseWriter, r *http.Re
|
|||||||
}
|
}
|
||||||
|
|
||||||
http.Redirect(w, r, fmt.Sprintf("/app/agenda/%s", resp.Event.Id), http.StatusFound)
|
http.Redirect(w, r, fmt.Sprintf("/app/agenda/%s", resp.Event.Id), http.StatusFound)
|
||||||
return
|
|
||||||
}
|
}
|
||||||
h.Renderer.AgendaCreateEvent(w, r)
|
h.Renderer.AgendaCreateEvent(w, r)
|
||||||
}
|
}
|
||||||
@@ -227,13 +225,14 @@ func (h *ApplicationHandler) AgendaSubscribeEvent(w http.ResponseWriter, r *http
|
|||||||
w.WriteHeader(http.StatusBadRequest)
|
w.WriteHeader(http.StatusBadRequest)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
dis := fmt.Sprint(current_user_claims["first_name"]) + " " + fmt.Sprint(current_user_claims["last_name"])
|
|
||||||
subscriber := r.FormValue("subscriber")
|
subscriber := r.FormValue("subscriber")
|
||||||
data := map[string]any{
|
data := map[string]any{
|
||||||
"subscribed_by": map[string]any{
|
"subscribed_by": map[string]any{
|
||||||
"user": map[string]any{
|
"user": map[string]any{
|
||||||
"id": current_user_token.Subject,
|
"id": current_user_token.Subject,
|
||||||
"display_name": dis,
|
"display_name": current_user_claims["first_name"].(string) + " " + current_user_claims["last_name"].(string),
|
||||||
|
"email": current_user_claims["email"].(string),
|
||||||
},
|
},
|
||||||
"group": map[string]any{
|
"group": map[string]any{
|
||||||
"id": current_group.ID,
|
"id": current_group.ID,
|
||||||
@@ -332,12 +331,19 @@ func contains(s []*agenda.Subscription, e string) bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////Update Event/////////////////////////////////////////
|
///////////////////////////Delete subscriber///////////////////////////////
|
||||||
func (h *ApplicationHandler) AgendaUpdateEvent(w http.ResponseWriter, r *http.Request) {
|
|
||||||
adm := strings.Split(r.URL.Path, "/")
|
func (h *ApplicationHandler) AgendaDeleteSubscribeEvent(w http.ResponseWriter, r *http.Request) {
|
||||||
eventID := adm[3]
|
vars := mux.Vars(r)
|
||||||
|
eventId := vars["eventid"]
|
||||||
|
subscribeid := vars["subscribeid"]
|
||||||
|
s_b_id := ""
|
||||||
|
s_b_name := ""
|
||||||
|
s_b_email := ""
|
||||||
|
s_b_group_id := ""
|
||||||
|
s_b_group_name := ""
|
||||||
request := &agenda.GetEventRequest{
|
request := &agenda.GetEventRequest{
|
||||||
Id: eventID,
|
Id: eventId,
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := h.services.GRPC.Agenda.GetEvent(context.TODO(), request)
|
resp, err := h.services.GRPC.Agenda.GetEvent(context.TODO(), request)
|
||||||
@@ -346,109 +352,189 @@ func (h *ApplicationHandler) AgendaUpdateEvent(w http.ResponseWriter, r *http.Re
|
|||||||
w.WriteHeader(http.StatusInternalServerError)
|
w.WriteHeader(http.StatusInternalServerError)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for i := range resp.Event.Subscriptions {
|
||||||
|
if resp.Event.Subscriptions[i].Subscriber == subscribeid {
|
||||||
|
subscribed_by_id := resp.Event.Subscriptions[i].Data.Fields["subscribed_by"].GetStructValue().Fields["user"].GetStructValue().Fields["id"].GetStringValue()
|
||||||
|
subscribed_by_name := resp.Event.Subscriptions[i].Data.Fields["subscribed_by"].GetStructValue().Fields["user"].GetStructValue().Fields["display_name"].GetStringValue()
|
||||||
|
subscribed_by_email := resp.Event.Subscriptions[i].Data.Fields["subscribed_by"].GetStructValue().Fields["user"].GetStructValue().Fields["email"].GetStringValue()
|
||||||
|
subscribed_by_group_id := resp.Event.Subscriptions[i].Data.Fields["subscribed_by"].GetStructValue().Fields["group"].GetStructValue().Fields["id"].GetStringValue()
|
||||||
|
subscribed_by_group_name := resp.Event.Subscriptions[i].Data.Fields["subscribed_by"].GetStructValue().Fields["group"].GetStructValue().Fields["name"].GetStringValue()
|
||||||
|
s_b_id = subscribed_by_id
|
||||||
|
s_b_name = subscribed_by_name
|
||||||
|
s_b_email = subscribed_by_email
|
||||||
|
s_b_group_id = subscribed_by_group_id
|
||||||
|
s_b_group_name = subscribed_by_group_name
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
current_group, err := h.currentGroup(r)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
w.WriteHeader(http.StatusInternalServerError)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
current_user_token, current_user_claims, err := h.currentUser(r)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
w.WriteHeader(http.StatusInternalServerError)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
data := map[string]any{
|
||||||
|
"subscribed_by": map[string]any{
|
||||||
|
"user": map[string]any{
|
||||||
|
"id": s_b_id,
|
||||||
|
"display_name": s_b_name,
|
||||||
|
"email": s_b_email,
|
||||||
|
},
|
||||||
|
"group": map[string]any{
|
||||||
|
"id": s_b_group_id,
|
||||||
|
"name": s_b_group_name,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"unsubscribed_by": map[string]any{
|
||||||
|
"user": map[string]any{
|
||||||
|
"id": current_user_token.Subject,
|
||||||
|
"display_name": current_user_claims["first_name"].(string) + " " + current_user_claims["last_name"].(string),
|
||||||
|
"email": current_user_claims["email"],
|
||||||
|
},
|
||||||
|
"group": map[string]any{
|
||||||
|
"id": current_group.ID,
|
||||||
|
"name": current_group.Data["name"],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"motif": r.FormValue("motif"),
|
||||||
|
}
|
||||||
|
|
||||||
|
datapb, err := structpb.NewStruct(data)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
w.WriteHeader(http.StatusInternalServerError)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if r.Method == "POST" {
|
if r.Method == "POST" {
|
||||||
|
request := &agenda.DeleteSubscriptionRequest{
|
||||||
|
Subscriber: subscribeid,
|
||||||
|
Eventid: eventId,
|
||||||
|
Data: datapb,
|
||||||
|
}
|
||||||
|
|
||||||
|
data := map[string]any{
|
||||||
|
"key": r.FormValue("motif"),
|
||||||
|
"user": current_user_claims["email"],
|
||||||
|
}
|
||||||
|
|
||||||
|
// récupérer l'adresse mail de l'utilisateur qui a créé l'événement
|
||||||
|
mail := s_b_email;
|
||||||
|
fmt.Println(mail)
|
||||||
|
|
||||||
|
_, err := h.services.GRPC.Agenda.DeleteSubscription(context.TODO(), request)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
w.WriteHeader(http.StatusInternalServerError)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := h.emailing.Send("delete_subscriber.request", mail, data); err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
w.WriteHeader(http.StatusInternalServerError)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
http.Redirect(w, r, fmt.Sprintf("/app/agenda/%s", eventId), http.StatusFound)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
h.Renderer.AgendaDeleteSubscribeEvent(w, r, eventId)
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
// /////////////////////History Event////////////////////////
|
||||||
|
func (h *ApplicationHandler) AgendaHistoryEvent(w http.ResponseWriter, r *http.Request) {
|
||||||
|
vars := mux.Vars(r)
|
||||||
|
eventId := vars["eventid"]
|
||||||
|
request := &agenda.GetEventRequest{
|
||||||
|
Id: eventId,
|
||||||
|
}
|
||||||
|
|
||||||
|
resp, err := h.services.GRPC.Agenda.GetEvent(context.TODO(), request)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
w.WriteHeader(http.StatusInternalServerError)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
grouprequest := &groupsmanagement.GetGroupRequest{
|
||||||
|
Id: resp.Event.Owners[0],
|
||||||
|
}
|
||||||
|
|
||||||
|
groupresp, err := h.services.GRPC.GroupsManagement.GetGroup(context.TODO(), grouprequest)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
w.WriteHeader(http.StatusInternalServerError)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
subscribers := map[string]any{}
|
||||||
|
|
||||||
|
accids := []string{}
|
||||||
|
for _, v := range resp.Event.DeletedSubscription {
|
||||||
|
accids = append(accids, v.Subscriber)
|
||||||
|
}
|
||||||
|
|
||||||
|
subscriberresp, err := h.services.GRPC.MobilityAccounts.GetAccountsBatch(
|
||||||
|
context.TODO(),
|
||||||
|
&mobilityaccounts.GetAccountsBatchRequest{
|
||||||
|
Accountids: accids,
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
|
if err == nil {
|
||||||
|
for _, sub := range subscriberresp.Accounts {
|
||||||
|
subscribers[sub.Id] = sub.ToStorageType()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
g := r.Context().Value(identification.GroupKey)
|
g := r.Context().Value(identification.GroupKey)
|
||||||
if g == nil {
|
if g == nil {
|
||||||
w.WriteHeader(http.StatusBadRequest)
|
fmt.Println(err)
|
||||||
|
w.WriteHeader(http.StatusInternalServerError)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
group := g.(storage.Group)
|
group := g.(storage.Group)
|
||||||
|
|
||||||
eventForm, err := parseEventsForm(r)
|
accountids := []string{}
|
||||||
if err != nil {
|
for _, m := range group.Members {
|
||||||
fmt.Println(err)
|
if !contains(resp.Event.DeletedSubscription, m) {
|
||||||
w.WriteHeader(http.StatusBadRequest)
|
accountids = append(accountids, m)
|
||||||
return
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
data, _ := structpb.NewStruct(map[string]any{
|
accountresp, err := h.services.GRPC.MobilityAccounts.GetAccountsBatch(
|
||||||
"address": eventForm.Address,
|
context.TODO(),
|
||||||
})
|
&mobilityaccounts.GetAccountsBatchRequest{
|
||||||
|
Accountids: accountids,
|
||||||
request := &agenda.UpdateEventRequest{
|
|
||||||
Event: &agenda.Event{
|
|
||||||
Namespace: "parcoursmob_dispositifs",
|
|
||||||
Id: eventID,
|
|
||||||
Owners: []string{group.ID},
|
|
||||||
Type: eventForm.Type,
|
|
||||||
Name: eventForm.Name,
|
|
||||||
Description: eventForm.Description,
|
|
||||||
Startdate: timestamppb.New(*eventForm.Startdate),
|
|
||||||
Enddate: timestamppb.New(*eventForm.Enddate),
|
|
||||||
Starttime: eventForm.Starttime,
|
|
||||||
Endtime: eventForm.Endtime,
|
|
||||||
Allday: eventForm.Allday,
|
|
||||||
MaxSubscribers: int64(eventForm.MaxSubscribers),
|
|
||||||
Data: data,
|
|
||||||
Subscriptions: resp.Event.Subscriptions,
|
|
||||||
},
|
},
|
||||||
|
)
|
||||||
|
|
||||||
|
accounts := []any{}
|
||||||
|
|
||||||
|
if err == nil {
|
||||||
|
for _, acc := range accountresp.Accounts {
|
||||||
|
accounts = append(accounts, acc)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := h.services.GRPC.Agenda.UpdateEvent(context.TODO(), request)
|
|
||||||
|
|
||||||
if err != nil {
|
h.Renderer.AgendaHistoryEvent(w, r, resp.Event.ToStorageType(), groupresp.Group.ToStorageType(), subscribers, accounts)
|
||||||
fmt.Println(err)
|
|
||||||
w.WriteHeader(http.StatusInternalServerError)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
http.Redirect(w, r, fmt.Sprintf("/app/agenda/%s", resp.Event.Id), http.StatusFound)
|
/////////////////////////////////////////////////////////
|
||||||
return
|
|
||||||
}
|
|
||||||
h.Renderer.AgendaUpdateEvent(w, r, resp.Event.ToStorageType())
|
|
||||||
}
|
|
||||||
|
|
||||||
func (h *ApplicationHandler) AgendaDeleteEvent(w http.ResponseWriter, r *http.Request) {
|
|
||||||
|
|
||||||
vars := mux.Vars(r)
|
|
||||||
eventID := vars["eventid"]
|
|
||||||
request := &agenda.GetEventRequest{
|
|
||||||
Id: eventID,
|
|
||||||
}
|
|
||||||
|
|
||||||
resp, err := h.services.GRPC.Agenda.GetEvent(context.TODO(), request)
|
|
||||||
if err != nil {
|
|
||||||
fmt.Println(err)
|
|
||||||
w.WriteHeader(http.StatusInternalServerError)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if r.Method == "POST" {
|
|
||||||
|
|
||||||
request := &agenda.UpdateEventRequest{
|
|
||||||
Event: &agenda.Event{
|
|
||||||
Namespace: resp.Event.Namespace,
|
|
||||||
Id: resp.Event.Id,
|
|
||||||
Owners: resp.Event.Owners,
|
|
||||||
Type: resp.Event.Type,
|
|
||||||
Name: resp.Event.Name,
|
|
||||||
Description: resp.Event.Description,
|
|
||||||
Startdate: resp.Event.Startdate,
|
|
||||||
Enddate: resp.Event.Enddate,
|
|
||||||
Starttime: resp.Event.Starttime,
|
|
||||||
Endtime: resp.Event.Endtime,
|
|
||||||
Allday: resp.Event.Allday,
|
|
||||||
MaxSubscribers: int64(resp.Event.MaxSubscribers),
|
|
||||||
Data: resp.Event.Data,
|
|
||||||
Subscriptions: resp.Event.Subscriptions,
|
|
||||||
Deleted: true,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
_, err := h.services.GRPC.Agenda.UpdateEvent(context.TODO(), request)
|
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
fmt.Println(err)
|
|
||||||
w.WriteHeader(http.StatusInternalServerError)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
http.Redirect(w, r, "/app/agenda/", http.StatusFound)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
h.Renderer.AgendaDeleteEvent(w, r, resp.Event.ToStorageType())
|
|
||||||
}
|
|
||||||
|
|
||||||
// func contains[V string](s []V, e V) bool {
|
// func contains[V string](s []V, e V) bool {
|
||||||
// for _, a := range s {
|
// for _, a := range s {
|
||||||
@@ -458,3 +544,5 @@ func (h *ApplicationHandler) AgendaDeleteEvent(w http.ResponseWriter, r *http.Re
|
|||||||
// }
|
// }
|
||||||
// return false
|
// return false
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
//test
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ func (h *ApplicationHandler) MemberUpdate(w http.ResponseWriter, r *http.Request
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
http.Redirect(w, r, fmt.Sprintf("/app/members/%s", resp.Account.Id), http.StatusFound)
|
http.Redirect(w, r, fmt.Sprintf("/app/profile/%s", resp.Account.Id), http.StatusFound)
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ func (h *AuthHandler) Onboarding(w http.ResponseWriter, r *http.Request) {
|
|||||||
if onboardingmap["admin"].(bool) {
|
if onboardingmap["admin"].(bool) {
|
||||||
groups = append(groups, onboardingmap["group"].(string)+":admin")
|
groups = append(groups, onboardingmap["group"].(string)+":admin")
|
||||||
}
|
}
|
||||||
display_name := fmt.Sprint(r.FormValue("first_name")) + " " + fmt.Sprint(r.FormValue("last_name"))
|
|
||||||
account := &ma.Account{
|
account := &ma.Account{
|
||||||
Authentication: ma.AccountAuth{
|
Authentication: ma.AccountAuth{
|
||||||
Local: ma.LocalAuth{
|
Local: ma.LocalAuth{
|
||||||
@@ -46,9 +46,7 @@ func (h *AuthHandler) Onboarding(w http.ResponseWriter, r *http.Request) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
Namespace: "parcoursmob",
|
Namespace: "parcoursmob",
|
||||||
|
|
||||||
Data: map[string]any{
|
Data: map[string]any{
|
||||||
"display_name": display_name,
|
|
||||||
"first_name": r.FormValue("first_name"),
|
"first_name": r.FormValue("first_name"),
|
||||||
"last_name": r.FormValue("last_name"),
|
"last_name": r.FormValue("last_name"),
|
||||||
"email": onboardingmap["username"],
|
"email": onboardingmap["username"],
|
||||||
|
|||||||
9
main.go
9
main.go
@@ -104,11 +104,6 @@ func main() {
|
|||||||
application.HandleFunc("/agenda/", applicationHandler.AgendaHome)
|
application.HandleFunc("/agenda/", applicationHandler.AgendaHome)
|
||||||
application.HandleFunc("/agenda/create-event", applicationHandler.AgendaCreateEvent)
|
application.HandleFunc("/agenda/create-event", applicationHandler.AgendaCreateEvent)
|
||||||
application.HandleFunc("/agenda/{eventid}", applicationHandler.AgendaDisplayEvent)
|
application.HandleFunc("/agenda/{eventid}", applicationHandler.AgendaDisplayEvent)
|
||||||
///////////////////////////////Code to modify event///////////////////////
|
|
||||||
application.HandleFunc("/agenda/{eventid}/update", applicationHandler.AgendaUpdateEvent)
|
|
||||||
application.HandleFunc("/agenda/{eventid}/delete", applicationHandler.AgendaDeleteEvent)
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////
|
|
||||||
application.HandleFunc("/agenda/{eventid}/subscribe", applicationHandler.AgendaSubscribeEvent)
|
application.HandleFunc("/agenda/{eventid}/subscribe", applicationHandler.AgendaSubscribeEvent)
|
||||||
application.HandleFunc("/directory/", applicationHandler.DirectoryHome)
|
application.HandleFunc("/directory/", applicationHandler.DirectoryHome)
|
||||||
|
|
||||||
@@ -142,6 +137,10 @@ func main() {
|
|||||||
appAdmin.HandleFunc("/groups/{groupid}/invite-member", applicationHandler.AdministrationGroupInviteMember)
|
appAdmin.HandleFunc("/groups/{groupid}/invite-member", applicationHandler.AdministrationGroupInviteMember)
|
||||||
appAdmin.HandleFunc("/stats/vehicles", applicationHandler.AdminStatVehicles)
|
appAdmin.HandleFunc("/stats/vehicles", applicationHandler.AdminStatVehicles)
|
||||||
|
|
||||||
|
/////////////////////////////////////Delete subscriber///////////////////////////////////////////////
|
||||||
|
application.HandleFunc("/agenda/{eventid}/{subscribeid}/delete", applicationHandler.AgendaDeleteSubscribeEvent)
|
||||||
|
application.HandleFunc("/agenda/{eventid}/history", applicationHandler.AgendaHistoryEvent)
|
||||||
|
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
fmt.Println("-> HTTP server listening on", address)
|
fmt.Println("-> HTTP server listening on", address)
|
||||||
|
|
||||||
srv := &http.Server{
|
srv := &http.Server{
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ func (renderer *Renderer) AgendaCreateEvent(w http.ResponseWriter, r *http.Reque
|
|||||||
func (renderer *Renderer) AgendaDisplayEvent(w http.ResponseWriter, r *http.Request, event any, group any, subscribers map[string]any, beneficiaries any) {
|
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")
|
files := renderer.ThemeConfig.GetStringSlice("views.agenda.display_event.files")
|
||||||
state := NewState(r, renderer.ThemeConfig, agendaMenu)
|
state := NewState(r, renderer.ThemeConfig, agendaMenu)
|
||||||
|
|
||||||
state.ViewState = map[string]any{
|
state.ViewState = map[string]any{
|
||||||
"event": event,
|
"event": event,
|
||||||
"group": group,
|
"group": group,
|
||||||
@@ -40,24 +39,30 @@ func (renderer *Renderer) AgendaDisplayEvent(w http.ResponseWriter, r *http.Requ
|
|||||||
renderer.Render("agenda create event", w, r, files, state)
|
renderer.Render("agenda create event", w, r, files, state)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (renderer *Renderer) AgendaUpdateEvent(w http.ResponseWriter, r *http.Request, event any) {
|
//////////////////////////DElete subscriber//////////////////////////////////
|
||||||
files := renderer.ThemeConfig.GetStringSlice("views.agenda.update.files")
|
func (renderer *Renderer) AgendaDeleteSubscribeEvent(w http.ResponseWriter, r *http.Request, eventid string) {
|
||||||
|
files := renderer.ThemeConfig.GetStringSlice("views.agenda.delete_subscriber.files")
|
||||||
state := NewState(r, renderer.ThemeConfig, agendaMenu)
|
state := NewState(r, renderer.ThemeConfig, agendaMenu)
|
||||||
|
state.ViewState = map[string]any{
|
||||||
|
"eventid": eventid,
|
||||||
|
}
|
||||||
|
|
||||||
|
renderer.Render("agenda delete subscriber", w, r, files, state)
|
||||||
|
}
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
//////////////////////////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{
|
state.ViewState = map[string]any{
|
||||||
"event": event,
|
"event": event,
|
||||||
|
"group": group,
|
||||||
|
"subscribers": subscribers,
|
||||||
|
"beneficiaries": beneficiaries,
|
||||||
}
|
}
|
||||||
|
|
||||||
renderer.Render("event_update", w, r, files, state)
|
renderer.Render("agenda history event", 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)
|
|
||||||
}
|
}
|
||||||
|
////////////////////////////////////////////////////////////////////////
|
||||||
Reference in New Issue
Block a user