comparison libervia/pages/forums/view/page_meta.py @ 1427:eaf36fffcbdb

pages (forums): better breadcrumbs
author Goffi <goffi@goffi.org>
date Sat, 01 May 2021 19:05:16 +0200
parents 4cf2b73e63aa
children 106bae41f5c8
comparison
equal deleted inserted replaced
1426:4cf2b73e63aa 1427:eaf36fffcbdb
1 #!/usr/bin/env python3 1 #!/usr/bin/env python3
2 2
3 3
4 from libervia.server.constants import Const as C 4 from libervia.server.constants import Const as C
5 from twisted.internet import defer 5 from sat.core.i18n import _, D_
6 from sat.core.i18n import _
7 from sat.core.log import getLogger 6 from sat.core.log import getLogger
8 from sat.tools.common import data_format 7 from sat.tools.common import data_format
9 8
10 log = getLogger(__name__) 9 log = getLogger(__name__)
11 10
12 name = "forum_view" 11 name = "forum_view"
12 label = D_("View")
13 access = C.PAGES_ACCESS_PUBLIC 13 access = C.PAGES_ACCESS_PUBLIC
14 template = "forum/view.html" 14 template = "forum/view.html"
15 15
16 16
17 def parse_url(self, request): 17 def parse_url(self, request):
18 self.getPathArgs(request, ["service", "node"], 2, service="jid") 18 self.getPathArgs(request, ["service", "node"], 2, service="jid")
19 19
20 20
21 @defer.inlineCallbacks 21 async def prepare_render(self, request):
22 def prepare_render(self, request):
23 data = self.getRData(request) 22 data = self.getRData(request)
24 data["show_comments"] = False 23 data["show_comments"] = False
25 blog_page = self.getPageByName("blog_view") 24 blog_page = self.getPageByName("blog_view")
26 request.args[b"before"] = [b""] 25 request.args[b"before"] = [b""]
27 request.args[b"reverse"] = [b"1"] 26 request.args[b"reverse"] = [b"1"]
28 yield blog_page.prepare_render(self, request) 27 await blog_page.prepare_render(self, request)
29 request.template_data["login_url"] = self.getPageRedirectURL(request) 28 request.template_data["login_url"] = self.getPageRedirectURL(request)
30 29
31 30
32 async def on_data_post(self, request): 31 async def on_data_post(self, request):
33 profile = self.getProfile(request) 32 profile = self.getProfile(request)