comparison pages/news/page_meta.py @ 8:dc880664a8ec

modernisation of the theme using Bulma
author Goffi <goffi@goffi.org>
date Fri, 16 Apr 2021 18:51:12 +0200
parents 9ce41ef66dfa
children 5fd933e238bb
comparison
equal deleted inserted replaced
7:b5fc67c97c50 8:dc880664a8ec
1 #!/usr/bin/env python2.7
2 # -*- coding: utf-8 -*-
3
4 from libervia.server.constants import Const as C 1 from libervia.server.constants import Const as C
5 from twisted.words.protocols.jabber import jid 2 from twisted.words.protocols.jabber import jid
6 from twisted.internet import defer
7 from sat.core.i18n import _ 3 from sat.core.i18n import _
8 from sat.core.log import getLogger 4 from sat.core.log import getLogger
9 5
10 log = getLogger(__name__) 6 log = getLogger(__name__)
11 7
13 template = "news/news.html" 9 template = "news/news.html"
14 service = None 10 service = None
15 node = None 11 node = None
16 12
17 13
18 @defer.inlineCallbacks 14 async def prepare_render(self, request):
19 def prepare_render(self, request):
20 global service, node 15 global service, node
21 if service is None: 16 if service is None:
22 blog_dict = self.getConfig('news_blog_dict', {}) 17 blog_dict = self.getConfig('news_blog_dict', {})
23 try: 18 try:
24 service = jid.JID(blog_dict['service']) 19 service = jid.JID(blog_dict['service'])
41 # request, C.CACHE_PUBSUB, service=service, node=node, short="microblog") 36 # request, C.CACHE_PUBSUB, service=service, node=node, short="microblog")
42 37
43 # we now need blog items, using blog common page 38 # we now need blog items, using blog common page
44 # this will fill the "items" template data 39 # this will fill the "items" template data
45 blog_page = self.getPageByName("blog_view") 40 blog_page = self.getPageByName("blog_view")
46 yield blog_page.prepare_render(self, request) 41 await blog_page.prepare_render(self, request)