From 0b855706318aafab545267c3c95c2bab4c23682d Mon Sep 17 00:00:00 2001 From: "Schimon Jehudah, Adv." Date: Mon, 14 Oct 2024 14:37:18 +0300 Subject: [PATCH] Add a dynamic message in accord to JID purpose (Thanks to Ramiro from Above Phone and TBOT). --- css/stylesheet.css | 32 ++++++++++++++++------------- fasi.py | 12 +++++------ xhtml/jid.xhtml | 50 ++++++++++++++++++++++++++++++++++++---------- 3 files changed, 64 insertions(+), 30 deletions(-) diff --git a/css/stylesheet.css b/css/stylesheet.css index 88c7c9e..9b99627 100644 --- a/css/stylesheet.css +++ b/css/stylesheet.css @@ -210,8 +210,10 @@ label, background: #439639; /* #a0ce67 */ } -#logo-bottom { +#logo-bottom, +#notice { display: none; + text-align: center; } #logo-bottom { @@ -351,7 +353,7 @@ h3, h4, h5 { */ /* max-height: 75vh; */ padding-top: 1em; - padding-bottom: 3em; + padding-bottom: 2em; text-align: center; width: 80%; } @@ -536,6 +538,11 @@ h3, h4, h5 { width: unset; } + #message { + display: none; + } + + #notice, #profile #photo, #profile #qrcode { display: block; @@ -545,12 +552,21 @@ h3, h4, h5 { } #profile #qrcode { + margin-bottom: 1em; outline: solid; outline-color: #333; } } +@media (max-width: 725px) and (prefers-color-scheme: dark) { + + body { + background: #2b2a33; + } + +} + @media (max-width: 725px) { body { @@ -567,10 +583,6 @@ h3, h4, h5 { filter: unset; } - #message { - display: none; - } - #logo-bottom { display: unset; } @@ -631,14 +643,6 @@ h3, h4, h5 { } -@media (max-width: 725px) and (prefers-color-scheme: dark) { - - body { - background: #2b2a33; - } - -} - @media (max-width: 572px) { #bar, diff --git a/fasi.py b/fasi.py index ec3c5d4..1bb6c71 100644 --- a/fasi.py +++ b/fasi.py @@ -128,7 +128,7 @@ class HttpInstance: elif jid_kind in ('mix', 'muc'): #title = 'Group Chat ' + title # TODO Set group chat subject as description. - action = 'Join to' + action = 'Join' instance = 'participants' link_href = 'xmpp:{}?join'.format(jid_bare) links.append({'name' : 'Join', @@ -141,7 +141,7 @@ class HttpInstance: elif jid_kind == 'pubsub': #node_name = request.query_params.get('node', '') if node_name: - action = 'Subscribe to' + action = 'Subscribe' instance = 'articles' link_href = 'xmpp:{}?pubsub;node={};action=subscribe'.format(jid_bare, node_name) view_href = '/d/{}/{}'.format(jid_bare, node_name) @@ -373,7 +373,7 @@ class HttpInstance: elif jid_kind in ('mix', 'muc'): #title = 'Group Chat ' + title # TODO Set group chat subject as description. - action = 'Join to' + action = 'Join' instance = 'participants' link_href = 'xmpp:{}?join'.format(jid_bare) links.append({'name' : 'Join', @@ -386,7 +386,7 @@ class HttpInstance: elif jid_kind == 'pubsub': #node_name = request.query_params.get('node', '') if node_name: - action = 'Subscribe to' + action = 'Subscribe' instance = 'articles' link_href = 'xmpp:{}?pubsub;node={};action=subscribe'.format(jid_bare, node_name) view_href = '/d/{}/{}'.format(jid_bare, node_name) @@ -770,7 +770,7 @@ class HttpInstance: elif jid_kind in ('mix', 'muc'): #title = 'Group Chat ' + title # TODO Set group chat subject as description. - action = 'Join to' + action = 'Join' instance = 'participants' link_href = 'xmpp:{}?join'.format(jid_bare) links.append(['Join', link_href]) @@ -781,7 +781,7 @@ class HttpInstance: elif jid_kind == 'pubsub': #node_name = request.query_params.get('node', '') if node_name: - action = 'Subscribe to' + action = 'Subscribe' instance = 'articles' link_href = 'xmpp:{}?pubsub;node={};action=subscribe'.format(jid_bare, node_name) links.append(['Subscribe', link_href]) diff --git a/xhtml/jid.xhtml b/xhtml/jid.xhtml index 9cfa8fd..7496a7f 100644 --- a/xhtml/jid.xhtml +++ b/xhtml/jid.xhtml @@ -43,6 +43,16 @@ ); } } + @media (max-width: 725px) and (prefers-color-scheme: dark) { + body { + background: #2b2a33; + } + } + @media (max-width: 725px) { + body { + background: #f5f5f5; + } + } {% endif %} @@ -92,26 +102,46 @@ Preview journal OR Preview group chat - {% if count or jid_kind in ('mix', 'muc') %} + {% if count or jid_kind in ('conference', 'mix', 'muc') %}
{% if count %} {{count}} {{instance}} - {% elif jid_kind in ('mix', 'muc') %} + {% elif jid_kind in ('conference', 'mix', 'muc') %} Preview {% endif %}
{% endif %} - - +
+ If you already have an XMPP Client you can +
+ {% if jid_kind in ('conference', 'mix', 'muc') %} + join to + {% elif jid_kind == 'pubsub' %} + subscribe to + {% elif jid_kind == 'bot' %} + try + {% elif jid_kind == 'server' %} + explore + {% else %} + talk with + {% endif %} + {{title}} + right now. +
+ {% if message %}
{{message}}