Mercurial > libervia-web
view libervia/web/pages/forums/list/page_meta.py @ 1602:6feac4a25e60
browser: Remote Control implementation:
- Add `cbor-x` JS dependency.
- In "Call" page, a Remote Control session can now be started. This is done by clicking on
a search item 3 dots menu. Libervia Web will act as a controlling device. The call box
is then adapted, and mouse/wheel and keyboard events are sent to remote, touch events
are converted to mouse one.
- Some Brython 3.12* related changes.
rel 436
author | Goffi <goffi@goffi.org> |
---|---|
date | Sat, 11 May 2024 14:02:22 +0200 |
parents | eb00d593801d |
children |
line wrap: on
line source
#!/usr/bin/env python3 from libervia.web.server.constants import Const as C from libervia.backend.core.log import getLogger from libervia.backend.core.i18n import _ from libervia.backend.tools.common import uri as xmpp_uri log = getLogger(__name__) import json """forum handling pages""" name = "forums" access = C.PAGES_ACCESS_PUBLIC template = "forum/overview.html" def parse_url(self, request): self.get_path_args( request, ["service", "node", "forum_key"], service="@jid", node="@", forum_key="", ) def add_breadcrumb(self, request, breadcrumbs): # we don't want breadcrumbs here as long as there is no forum discovery # because it will be the landing page for forums activity until then pass def get_links(self, forums): for forum in forums: try: uri = forum["uri"] except KeyError: pass else: uri = xmpp_uri.parse_xmpp_uri(uri) service = uri["path"] node = uri["node"] forum["http_url"] = self.get_page_by_name("forum_topics").get_url(service, node) if "sub-forums" in forum: get_links(self, forum["sub-forums"]) async def prepare_render(self, request): data = self.get_r_data(request) template_data = request.template_data service, node, key = data["service"], data["node"], data["forum_key"] profile = self.get_profile(request) or C.SERVICE_PROFILE try: forums_raw = await self.host.bridge_call( "forums_get", service.full() if service else "", node, key, profile ) except Exception as e: log.warning(_("Can't retrieve forums: {msg}").format(msg=e)) forums = [] else: forums = json.loads(forums_raw) get_links(self, forums) template_data["forums"] = forums