# HG changeset patch # User Goffi # Date 1521655897 -3600 # Node ID 7dc20bacd3b6352bead760c66a2725174238b567 # Parent 8f77e36cd51d8aec4f118809f00d2d2f01c11e47 pages (common/blog): added xmpp_uri in template_data diff -r 8f77e36cd51d -r 7dc20bacd3b6 src/pages/common/blog/page_meta.py --- a/src/pages/common/blog/page_meta.py Wed Mar 21 19:11:22 2018 +0100 +++ b/src/pages/common/blog/page_meta.py Wed Mar 21 19:11:37 2018 +0100 @@ -7,6 +7,7 @@ from libervia.server import session_iface from sat.core.i18n import _ from sat.tools.common.template import safe +from sat.tools.common import uri from libervia.server import utils import unicodedata import re @@ -264,6 +265,14 @@ # if True, page should display a comment box template_data[u'allow_commenting'] = data.get(u'allow_commenting', False) + # last but not least, we add a xmpp: link to the node + uri_args = {u'path': service.full()} + if node: + uri_args[u'node'] = node + if item_id: + uri_args[u'item'] = item_id + template_data[u'xmpp_uri'] = uri.buildXMPPUri(u'pubsub', subtype='microblog', **uri_args) + @defer.inlineCallbacks def on_data_post(self, request):