Mercurial > libervia-web
comparison libervia/pages/events/rsvp/page_meta.py @ 1509:106bae41f5c8
massive refactoring from camelCase -> snake_case. See backend commit log for more details
author | Goffi <goffi@goffi.org> |
---|---|
date | Sat, 08 Apr 2023 13:44:11 +0200 |
parents | d6bcb0cf92d2 |
children |
comparison
equal
deleted
inserted
replaced
1508:ec3ad9abf9f9 | 1509:106bae41f5c8 |
---|---|
18 template = "event/invitation.html" | 18 template = "event/invitation.html" |
19 log = getLogger(__name__) | 19 log = getLogger(__name__) |
20 | 20 |
21 | 21 |
22 def parse_url(self, request): | 22 def parse_url(self, request): |
23 self.getPathArgs( | 23 self.get_path_args( |
24 request, | 24 request, |
25 ("event_service", "event_node", "event_id"), | 25 ("event_service", "event_node", "event_id"), |
26 min_args=2, | 26 min_args=2, |
27 event_service="@jid", | 27 event_service="@jid", |
28 event_id="", | 28 event_id="", |
30 | 30 |
31 | 31 |
32 @defer.inlineCallbacks | 32 @defer.inlineCallbacks |
33 def prepare_render(self, request): | 33 def prepare_render(self, request): |
34 template_data = request.template_data | 34 template_data = request.template_data |
35 data = self.getRData(request) | 35 data = self.get_r_data(request) |
36 profile = self.getProfile(request) | 36 profile = self.get_profile(request) |
37 | 37 |
38 ## Event ## | 38 ## Event ## |
39 | 39 |
40 event_service = data["event_service"] | 40 event_service = data["event_service"] |
41 event_node = data["event_node"] | 41 event_node = data["event_node"] |
42 event_id = data["event_id"] | 42 event_id = data["event_id"] |
43 event_timestamp, event_data = yield self.host.bridgeCall( | 43 event_timestamp, event_data = yield self.host.bridge_call( |
44 "eventGet", | 44 "eventGet", |
45 event_service.userhost() if event_service else "", | 45 event_service.userhost() if event_service else "", |
46 event_node, | 46 event_node, |
47 event_id, | 47 event_id, |
48 profile, | 48 profile, |
60 } | 60 } |
61 """ | 61 """ |
62 % html.escape(background_image, True) | 62 % html.escape(background_image, True) |
63 ) | 63 ) |
64 template_data["event"] = event_data | 64 template_data["event"] = event_data |
65 event_invitee_data = yield self.host.bridgeCall( | 65 event_invitee_data = yield self.host.bridge_call( |
66 "eventInviteeGet", | 66 "event_invitee_get", |
67 event_data["invitees_service"], | 67 event_data["invitees_service"], |
68 event_data["invitees_node"], | 68 event_data["invitees_node"], |
69 '', | 69 '', |
70 profile, | 70 profile, |
71 ) | 71 ) |
78 data["node"] = event_data["blog_node"] | 78 data["node"] = event_data["blog_node"] |
79 data["allow_commenting"] = "simple" | 79 data["allow_commenting"] = "simple" |
80 | 80 |
81 # we now need blog items, using blog common page | 81 # we now need blog items, using blog common page |
82 # this will fill the "items" template data | 82 # this will fill the "items" template data |
83 blog_page = self.getPageByName("blog_view") | 83 blog_page = self.get_page_by_name("blog_view") |
84 yield blog_page.prepare_render(self, request) | 84 yield blog_page.prepare_render(self, request) |
85 | 85 |
86 | 86 |
87 @defer.inlineCallbacks | 87 @defer.inlineCallbacks |
88 def on_data_post(self, request): | 88 def on_data_post(self, request): |
89 type_ = self.getPostedData(request, "type") | 89 type_ = self.get_posted_data(request, "type") |
90 if type_ == "comment": | 90 if type_ == "comment": |
91 blog_page = self.getPageByName("blog_view") | 91 blog_page = self.get_page_by_name("blog_view") |
92 yield blog_page.on_data_post(self, request) | 92 yield blog_page.on_data_post(self, request) |
93 elif type_ == "attendance": | 93 elif type_ == "attendance": |
94 profile = self.getProfile(request) | 94 profile = self.get_profile(request) |
95 service, node, attend, guests = self.getPostedData( | 95 service, node, attend, guests = self.get_posted_data( |
96 request, ("service", "node", "attend", "guests") | 96 request, ("service", "node", "attend", "guests") |
97 ) | 97 ) |
98 data = {"attend": attend, "guests": guests} | 98 data = {"attend": attend, "guests": guests} |
99 yield self.host.bridgeCall("eventInviteeSet", service, node, data, profile) | 99 yield self.host.bridge_call("event_invitee_set", service, node, data, profile) |
100 else: | 100 else: |
101 log.warning(_("Unhandled data type: {}").format(type_)) | 101 log.warning(_("Unhandled data type: {}").format(type_)) |