Mercurial > libervia-website
annotate pages/news/page_meta.py @ 12:0d6ae55579a5
presentation: added docker instructions + updated bullet points at the end.
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 23 Apr 2021 11:04:38 +0200 |
parents | dc880664a8ec |
children | 5fd933e238bb |
rev | line source |
---|---|
0 | 1 from libervia.server.constants import Const as C |
2 from twisted.words.protocols.jabber import jid | |
3 from sat.core.i18n import _ | |
4 from sat.core.log import getLogger | |
5 | |
6 log = getLogger(__name__) | |
7 | |
6 | 8 name = "news" |
9 template = "news/news.html" | |
0 | 10 service = None |
11 node = None | |
12 | |
13 | |
8
dc880664a8ec
modernisation of the theme using Bulma
Goffi <goffi@goffi.org>
parents:
6
diff
changeset
|
14 async def prepare_render(self, request): |
0 | 15 global service, node |
16 if service is None: | |
6 | 17 blog_dict = self.getConfig('news_blog_dict', {}) |
0 | 18 try: |
19 service = jid.JID(blog_dict['service']) | |
20 except RuntimeError as e: | |
6 | 21 log.warning(_("Can't parse service in news_blog_dict: {e}").format(e=e)) |
0 | 22 service = None |
23 except KeyError: | |
6 | 24 log.warnning(_("Missing service in news_blog_dict")) |
0 | 25 service = None |
6 | 26 node = blog_dict.get('node', '') |
0 | 27 if not blog_dict or service is None: |
6 | 28 log.warning(_('No value set for news_blog_dict, "news" page can\'t be used')) |
0 | 29 self.pageError(request, C.HTTP_SERVICE_UNAVAILABLE) |
30 | |
31 data = self.getRData(request) | |
6 | 32 data['service'] = service |
33 data['node'] = node | |
0 | 34 |
35 # self.checkCache( | |
36 # request, C.CACHE_PUBSUB, service=service, node=node, short="microblog") | |
37 | |
38 # we now need blog items, using blog common page | |
39 # this will fill the "items" template data | |
6 | 40 blog_page = self.getPageByName("blog_view") |
8
dc880664a8ec
modernisation of the theme using Bulma
Goffi <goffi@goffi.org>
parents:
6
diff
changeset
|
41 await blog_page.prepare_render(self, request) |