comparison libervia/pages/files/list/page_meta.py @ 1419:6fc41f000d24

pages (blog/view, u, files/list): custom breadcrumbs: - for `blog/view`, feed is added, then post if an item is shown - for `files/list`, files server then directories (with icons) are used - for `u` we deactivate breadcrumb for now
author Goffi <goffi@goffi.org>
date Thu, 29 Apr 2021 20:51:36 +0200
parents 886d1856e9de
children e065c8886b81
comparison
equal deleted inserted replaced
1418:d6bcb0cf92d2 1419:6fc41f000d24
18 template = "file/overview.html" 18 template = "file/overview.html"
19 19
20 20
21 def parse_url(self, request): 21 def parse_url(self, request):
22 self.getPathArgs(request, ["service", "*path"], min_args=1, service="jid", path="") 22 self.getPathArgs(request, ["service", "*path"], min_args=1, service="jid", path="")
23
24
25 def add_breadcrumb(self, request, breadcrumbs):
26 data = self.getRData(request)
27 breadcrumbs.append({
28 "label": data["service"],
29 "url": self.getURL(data["service"].full()),
30 "icon": "server",
31 })
32 for idx, p in enumerate(data["path"]):
33 breadcrumbs.append({
34 "label": p,
35 "url": self.getURL(data["service"].full(), *data["path"][:idx+1]),
36 "icon": "folder-open-empty",
37 })
23 38
24 39
25 async def prepare_render(self, request): 40 async def prepare_render(self, request):
26 data = self.getRData(request) 41 data = self.getRData(request)
27 thumb_limit = data.get("thumb_limit", 400) 42 thumb_limit = data.get("thumb_limit", 400)