1package event
2
3import (
4 "gno.land/p/zenao/basedao"
5 "gno.land/p/zenao/daocond"
6 "gno.land/p/zenao/daokit"
7 "gno.land/p/zenao/events"
8 zenaov1 "gno.land/p/zenao/zenao/v1"
9 "gno.land/r/demo/profile"
10 "gno.land/r/zenao/eventreg"
11 "gno.land/r/zenao/social_feed"
12)
13
14var (
15 DAO daokit.DAO
16 daoPrivate *basedao.DAOPrivate
17 event *events.Event
18)
19
20func init() {
21 conf := events.Config{
22 Organizers: []string{"g19stlwntp87hseqdakp30u7p788gjhpts2sx7yk"},
23 Gatekeepers: []string{},
24 Title: "La Maison Perchée en Finistère présente : Le Ciné Perché aux Studios",
25 Description: "## Hi there !\n\nQue dites-vous d'une petite séance de ciné le jeudi soir ?\n\nOn peut voter pour choisir un film à l'affiche. Pour l'horaire, je pensais à la séance de 18h, mais dites-moi ce qui vous arrange !\n\nOn pourrait se boire un coup ou manger un truc ensemble avant ou après le film. N'hésitez pas à faire tourner le mot si vous voulez inviter d'autres potes !\n\nJ'attends vos retours pour qu'on organise ça comme il faut.\n\nÀ bientôt aux Studios !\n\nPS : Si certains ont des contraintes de budget, il y a une offre à 5 € le ticket ce qui reste raisonnable.",
26 ImageURI: "ipfs://bafybeidi2dsza6eccj2ksm7jdajdrnmx56h4xc42egcwq5aw6yjlpbffse",
27 StartDate: 1753371900,
28 EndDate: 1753383600,
29 Capacity: 9,
30 GetProfileString: profile.GetStringField,
31 SetProfileString: profile.SetStringField,
32 ZenaoAdminAddr: "g1djrkw9tf4px658j85cc6fhsvm50uf9s0g6kfsm",
33 Location: &zenaov1.EventLocation{
34 Address: &zenaov1.AddressGeo{
35 Address: "Les Studios - 136 Rue Jean Jaurès, 29200 Brest, France",
36 Lat: 48.3962,
37 Lng: -4.4770656,
38 },
39 },
40 ParticipationPubkey: "",
41 }
42 event = events.NewEvent(&conf)
43 daoPrivate = event.DAOPrivate
44 DAO = event.DAO
45 eventreg.Register(func() *zenaov1.EventInfo { return event.Info() })
46 social_feed.NewFeed("main", false, IsMember)
47}
48
49// Set public to be used as auth layer for external entities (e.g polls)
50func IsMember(memberId string) bool {
51 return daoPrivate.Members.IsMember(memberId)
52}
53
54func Vote(proposalID uint64, vote daocond.Vote) {
55 DAO.Vote(proposalID, vote)
56}
57
58func Execute(proposalID uint64) {
59 DAO.Execute(proposalID)
60}
61
62func Render(path string) string {
63 return event.Render(path)
64}
event.gno
2.27 Kb · 64 lines