diff libervia/pages/blog/page_meta.py @ 1416:0554103ec700

pages (blog): new `edit` page: this page is used for new blog post and may be used for editing existing posts too. New `editor` module is using for autosave and tags editor. New `mbPreview` bridge method is used to generate preview when javascript is available.
author Goffi <goffi@goffi.org>
date Thu, 29 Apr 2021 16:55:07 +0200
parents 470c6cfdf4ce
children ce879da7fcf7
line wrap: on
line diff
--- a/libervia/pages/blog/page_meta.py	Thu Apr 29 16:45:39 2021 +0200
+++ b/libervia/pages/blog/page_meta.py	Thu Apr 29 16:55:07 2021 +0200
@@ -15,12 +15,11 @@
 template = "blog/discover.html"
 
 
-@defer.inlineCallbacks
-def prepare_render(self, request):
+async def prepare_render(self, request):
     profile = self.getProfile(request)
     template_data = request.template_data
     if profile is not None:
-        __, entities_own, entities_roster = yield self.host.bridgeCall(
+        __, entities_own, entities_roster = await self.host.bridgeCall(
             "discoFindByFeatures",
             [],
             [("pubsub", "pep")],
@@ -50,7 +49,7 @@
                         [],
                         True,
                         profile)
-        identities_data = yield defer.DeferredList(d_list.values())
+        identities_data = await defer.DeferredList(d_list.values())
         entities_idx = list(d_list.keys())
         for idx, (success, identity_raw) in enumerate(identities_data):
             entity_jid_s = entities_idx[idx]
@@ -60,6 +59,8 @@
             else:
                 identities[entity_jid_s] = data_format.deserialise(identity_raw)
 
+        template_data["url_blog_edit"] = self.getSubPageURL(request, "blog_edit")
+
 
 def on_data_post(self, request):
     jid_str = self.getPostedData(request, "jid")