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{"g13qc662fku4lkwz605ks6vj0e9p555lcdxemg9l"},
23 Gatekeepers: []string{},
24 Title: "Bibliothèque de Livres Vivants à la BU de Lettres",
25 Description: "Vous souhaitez écouter des témoignages de personnes concernées par un trouble psychique ? Devenez lecteur de livres vivants et luter contre la stigmatisation !\n\nRendez-vous le samedi 20 septembre à La Virgule à Morlaix pour écouter les Livres Vivants qui partageront leurs tranches de vie. C'est Gratuit !\n\n💬 Bibliothèque de Livres Vivants\n📆 Mercredi 15 octobre 2025, de 15h à 17h.\n📍 Bibliothèque universitaire des Lettres",
26 ImageURI: "ipfs://bafkreibhv7plafjkhriihbc66llrmmih27trujzpndrs4rgfjt36dowqoe",
27 StartDate: 1760533200,
28 EndDate: 1760540400,
29 Capacity: 42,
30 GetProfileString: profile.GetStringField,
31 SetProfileString: profile.SetStringField,
32 ZenaoAdminAddr: "g1djrkw9tf4px658j85cc6fhsvm50uf9s0g6kfsm",
33 Location: &zenaov1.EventLocation{
34 Address: &zenaov1.AddressGeo{
35 Address: "Bibliothèque universitaire des Lettres et Sciences Humaines - 11 Avenue du Maréchal Foch, 29200 Brest, France",
36 Lat: 48.393135,
37 Lng: -4.4884477,
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.17 Kb · 64 lines