Improve the presentation of related links.

This commit is contained in:
Schimon Jehudah, Adv. 2024-07-14 14:14:34 +03:00
parent a9c7832da1
commit 44e7778578
3 changed files with 37 additions and 17 deletions

View file

@ -107,6 +107,7 @@ async def view_node_items(request: Request):
link = form_an_item_link(pubsub, node, item_id) link = form_an_item_link(pubsub, node, item_id)
xml_atom = generate_atom(iq, link) xml_atom = generate_atom(iq, link)
iq = await get_node_items(pubsub, node) iq = await get_node_items(pubsub, node)
if not '/' in node:
if iq: if iq:
generate_json(iq) generate_json(iq)
else: else:

View file

@ -136,6 +136,7 @@ window.onload = async function(){
// Convert URI xmpp: to URI http: links. // Convert URI xmpp: to URI http: links.
for (let xmppLink of document.querySelectorAll( for (let xmppLink of document.querySelectorAll(
'#articles h3 > a[href^="xmpp:"][id^="rivista-"],' + '#articles h3 > a[href^="xmpp:"][id^="rivista-"],' +
'#articles h5.related > a[class^="rivista-"],' +
'#journal > ol > li > a[href^="xmpp:"]')) { '#journal > ol > li > a[href^="xmpp:"]')) {
xmppUri = new URL(xmppLink); xmppUri = new URL(xmppLink);
let parameters = xmppUri.search.split(';'); let parameters = xmppUri.search.split(';');

View file

@ -284,7 +284,16 @@ xmlns:atom='http://www.w3.org/2005/Atom'>
<xsl:attribute name='href'> <xsl:attribute name='href'>
<xsl:value-of select='atom:link[@rel="alternate" and @type="x-scheme-handler/xmpp"]/@href'/> <xsl:value-of select='atom:link[@rel="alternate" and @type="x-scheme-handler/xmpp"]/@href'/>
</xsl:attribute> </xsl:attribute>
💡️ XMPP <xsl:attribute name='class'>
<xsl:text>rivista-jabber</xsl:text>
</xsl:attribute>
💡️ Source
</xsl:element>
<xsl:element name='a'>
<xsl:attribute name='href'>
<xsl:value-of select='atom:link[@rel="alternate" and @type="x-scheme-handler/xmpp"]/@href'/>
</xsl:attribute>
(XMPP)
</xsl:element> </xsl:element>
</xsl:if> </xsl:if>
<xsl:if test='atom:link[@rel="replies"]'> <xsl:if test='atom:link[@rel="replies"]'>
@ -292,8 +301,17 @@ xmlns:atom='http://www.w3.org/2005/Atom'>
<xsl:attribute name='href'> <xsl:attribute name='href'>
<xsl:value-of select='atom:link[@rel="replies"]/@href'/> <xsl:value-of select='atom:link[@rel="replies"]/@href'/>
</xsl:attribute> </xsl:attribute>
<xsl:attribute name='class'>
<xsl:text>rivista-replies</xsl:text>
</xsl:attribute>
💬 Discussion 💬 Discussion
</xsl:element> </xsl:element>
<xsl:element name='a'>
<xsl:attribute name='href'>
<xsl:value-of select='atom:link[@rel="replies"]/@href'/>
</xsl:attribute>
(XMPP)
</xsl:element>
</xsl:if> </xsl:if>
<xsl:if test='atom:link[@rel="alternate" and @type="text/html"]'> <xsl:if test='atom:link[@rel="alternate" and @type="text/html"]'>
<xsl:element name='a'> <xsl:element name='a'>