Add a dynamic message in accord to JID purpose (Thanks to Ramiro from Above Phone and TBOT).

This commit is contained in:
Schimon Jehudah, Adv. 2024-10-14 14:37:18 +03:00
parent 26d92eff7c
commit 0b85570631
3 changed files with 64 additions and 30 deletions

View file

@ -210,8 +210,10 @@ label,
background: #439639; /* #a0ce67 */ background: #439639; /* #a0ce67 */
} }
#logo-bottom { #logo-bottom,
#notice {
display: none; display: none;
text-align: center;
} }
#logo-bottom { #logo-bottom {
@ -351,7 +353,7 @@ h3, h4, h5 {
*/ */
/* max-height: 75vh; */ /* max-height: 75vh; */
padding-top: 1em; padding-top: 1em;
padding-bottom: 3em; padding-bottom: 2em;
text-align: center; text-align: center;
width: 80%; width: 80%;
} }
@ -536,6 +538,11 @@ h3, h4, h5 {
width: unset; width: unset;
} }
#message {
display: none;
}
#notice,
#profile #photo, #profile #photo,
#profile #qrcode { #profile #qrcode {
display: block; display: block;
@ -545,12 +552,21 @@ h3, h4, h5 {
} }
#profile #qrcode { #profile #qrcode {
margin-bottom: 1em;
outline: solid; outline: solid;
outline-color: #333; outline-color: #333;
} }
} }
@media (max-width: 725px) and (prefers-color-scheme: dark) {
body {
background: #2b2a33;
}
}
@media (max-width: 725px) { @media (max-width: 725px) {
body { body {
@ -567,10 +583,6 @@ h3, h4, h5 {
filter: unset; filter: unset;
} }
#message {
display: none;
}
#logo-bottom { #logo-bottom {
display: unset; 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) { @media (max-width: 572px) {
#bar, #bar,

12
fasi.py
View file

@ -128,7 +128,7 @@ class HttpInstance:
elif jid_kind in ('mix', 'muc'): elif jid_kind in ('mix', 'muc'):
#title = 'Group Chat ' + title #title = 'Group Chat ' + title
# TODO Set group chat subject as description. # TODO Set group chat subject as description.
action = 'Join to' action = 'Join'
instance = 'participants' instance = 'participants'
link_href = 'xmpp:{}?join'.format(jid_bare) link_href = 'xmpp:{}?join'.format(jid_bare)
links.append({'name' : 'Join', links.append({'name' : 'Join',
@ -141,7 +141,7 @@ class HttpInstance:
elif jid_kind == 'pubsub': elif jid_kind == 'pubsub':
#node_name = request.query_params.get('node', '') #node_name = request.query_params.get('node', '')
if node_name: if node_name:
action = 'Subscribe to' action = 'Subscribe'
instance = 'articles' instance = 'articles'
link_href = 'xmpp:{}?pubsub;node={};action=subscribe'.format(jid_bare, node_name) link_href = 'xmpp:{}?pubsub;node={};action=subscribe'.format(jid_bare, node_name)
view_href = '/d/{}/{}'.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'): elif jid_kind in ('mix', 'muc'):
#title = 'Group Chat ' + title #title = 'Group Chat ' + title
# TODO Set group chat subject as description. # TODO Set group chat subject as description.
action = 'Join to' action = 'Join'
instance = 'participants' instance = 'participants'
link_href = 'xmpp:{}?join'.format(jid_bare) link_href = 'xmpp:{}?join'.format(jid_bare)
links.append({'name' : 'Join', links.append({'name' : 'Join',
@ -386,7 +386,7 @@ class HttpInstance:
elif jid_kind == 'pubsub': elif jid_kind == 'pubsub':
#node_name = request.query_params.get('node', '') #node_name = request.query_params.get('node', '')
if node_name: if node_name:
action = 'Subscribe to' action = 'Subscribe'
instance = 'articles' instance = 'articles'
link_href = 'xmpp:{}?pubsub;node={};action=subscribe'.format(jid_bare, node_name) link_href = 'xmpp:{}?pubsub;node={};action=subscribe'.format(jid_bare, node_name)
view_href = '/d/{}/{}'.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'): elif jid_kind in ('mix', 'muc'):
#title = 'Group Chat ' + title #title = 'Group Chat ' + title
# TODO Set group chat subject as description. # TODO Set group chat subject as description.
action = 'Join to' action = 'Join'
instance = 'participants' instance = 'participants'
link_href = 'xmpp:{}?join'.format(jid_bare) link_href = 'xmpp:{}?join'.format(jid_bare)
links.append(['Join', link_href]) links.append(['Join', link_href])
@ -781,7 +781,7 @@ class HttpInstance:
elif jid_kind == 'pubsub': elif jid_kind == 'pubsub':
#node_name = request.query_params.get('node', '') #node_name = request.query_params.get('node', '')
if node_name: if node_name:
action = 'Subscribe to' action = 'Subscribe'
instance = 'articles' instance = 'articles'
link_href = 'xmpp:{}?pubsub;node={};action=subscribe'.format(jid_bare, node_name) link_href = 'xmpp:{}?pubsub;node={};action=subscribe'.format(jid_bare, node_name)
links.append(['Subscribe', link_href]) links.append(['Subscribe', link_href])

View file

@ -43,6 +43,16 @@
); );
} }
} }
@media (max-width: 725px) and (prefers-color-scheme: dark) {
body {
background: #2b2a33;
}
}
@media (max-width: 725px) {
body {
background: #f5f5f5;
}
}
</style> </style>
{% endif %} {% endif %}
</head> </head>
@ -92,26 +102,46 @@
Preview journal OR Preview group chat Preview journal OR Preview group chat
</a> </a>
</div --> </div -->
{% if count or jid_kind in ('mix', 'muc') %} {% if count or jid_kind in ('conference', 'mix', 'muc') %}
<div id="count"> <div id="count">
<a href="{{view_href}}"> <a href="{{view_href}}">
{% if count %} {% if count %}
{{count}} {{instance}} {{count}} {{instance}}
{% elif jid_kind in ('mix', 'muc') %} {% elif jid_kind in ('conference', 'mix', 'muc') %}
Preview Preview
{% endif %} {% endif %}
</a> </a>
</div> </div>
{% endif %} {% endif %}
<!-- div>
<a href="https://xmpp.org">
<img id="logo-bottom" src="/img/logo-wordmark-vertical.svg" />
</a>
</div -->
<!-- div id="note">
The Universal Messaging Standard
</div -->
</div> </div>
<div id="notice">
If you already have an <strong>XMPP Client</strong> you can
<br/>
{% 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 %}
<strong>{{title}}</strong>
right now.
</div>
<!-- div id="note">
<div>
You have been invited to
<abbr title="The Universal Messaging Standard">XMPP</abbr>.
</div>
<div>
XMPP is a decentralized, free, and private messaging and publishing
protocol, that allows for end-to-end encrypted messaging, voice
calls, video calls, groups and more. Join to the community!
</div>
</div -->
</div> </div>
{% if message %} {% if message %}
<div id="message">{{message}}</div> <div id="message">{{message}}</div>