mirror of https://gitlab.com/bashrc2/epicyon
Show offline status on person options screen
parent
33498affc5
commit
7dc4a7624e
|
@ -9144,7 +9144,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
access_keys, is_group,
|
access_keys, is_group,
|
||||||
self.server.theme_name,
|
self.server.theme_name,
|
||||||
self.server.blocked_cache,
|
self.server.blocked_cache,
|
||||||
repo_url)
|
repo_url,
|
||||||
|
self.server.sites_unavailable)
|
||||||
if msg:
|
if msg:
|
||||||
msg = msg.encode('utf-8')
|
msg = msg.encode('utf-8')
|
||||||
msglen = len(msg)
|
msglen = len(msg)
|
||||||
|
|
|
@ -165,7 +165,8 @@ def html_person_options(default_timeline: str,
|
||||||
is_group: bool,
|
is_group: bool,
|
||||||
theme: str,
|
theme: str,
|
||||||
blocked_cache: [],
|
blocked_cache: [],
|
||||||
repo_url: str) -> str:
|
repo_url: str,
|
||||||
|
sites_unavailable: []) -> str:
|
||||||
"""Show options for a person: view/follow/block/report
|
"""Show options for a person: view/follow/block/report
|
||||||
"""
|
"""
|
||||||
options_link_str = ''
|
options_link_str = ''
|
||||||
|
@ -180,6 +181,9 @@ def html_person_options(default_timeline: str,
|
||||||
base_dir + '/accounts/options-background.jpg')
|
base_dir + '/accounts/options-background.jpg')
|
||||||
|
|
||||||
dormant = False
|
dormant = False
|
||||||
|
offline = False
|
||||||
|
if options_domain in sites_unavailable:
|
||||||
|
offline = True
|
||||||
follow_str = 'Follow'
|
follow_str = 'Follow'
|
||||||
if is_group:
|
if is_group:
|
||||||
follow_str = 'Join'
|
follow_str = 'Join'
|
||||||
|
@ -198,9 +202,10 @@ def html_person_options(default_timeline: str,
|
||||||
follow_str = 'Unfollow'
|
follow_str = 'Unfollow'
|
||||||
if is_group:
|
if is_group:
|
||||||
follow_str = 'Leave'
|
follow_str = 'Leave'
|
||||||
dormant = \
|
if not offline:
|
||||||
is_dormant(base_dir, nickname, domain, options_actor,
|
dormant = \
|
||||||
dormant_months)
|
is_dormant(base_dir, nickname, domain, options_actor,
|
||||||
|
dormant_months)
|
||||||
|
|
||||||
options_nickname = get_nickname_from_actor(options_actor)
|
options_nickname = get_nickname_from_actor(options_actor)
|
||||||
if not options_nickname:
|
if not options_nickname:
|
||||||
|
@ -291,6 +296,8 @@ def html_person_options(default_timeline: str,
|
||||||
handle_shown += ' ⌂'
|
handle_shown += ' ⌂'
|
||||||
if dormant:
|
if dormant:
|
||||||
handle_shown += ' 💤'
|
handle_shown += ' 💤'
|
||||||
|
if offline:
|
||||||
|
handle_shown += ' [' + translate['offline'].upper() + ']'
|
||||||
options_str += \
|
options_str += \
|
||||||
' <p class="optionsText">' + translate['Options for'] + \
|
' <p class="optionsText">' + translate['Options for'] + \
|
||||||
' @' + handle_shown + '</p>\n'
|
' @' + handle_shown + '</p>\n'
|
||||||
|
|
|
@ -3168,10 +3168,10 @@ def _individual_follow_as_html(signing_priv_key_pem: str,
|
||||||
display_name, False, translate)
|
display_name, False, translate)
|
||||||
title_str = display_name
|
title_str = display_name
|
||||||
|
|
||||||
if dormant:
|
|
||||||
title_str += ' 💤'
|
|
||||||
if offline:
|
if offline:
|
||||||
title_str += ' <b>[' + translate['offline'].upper() + ']</b>'
|
title_str += ' <b>[' + translate['offline'].upper() + ']</b>'
|
||||||
|
elif dormant:
|
||||||
|
title_str += ' 💤'
|
||||||
|
|
||||||
buttons_str = ''
|
buttons_str = ''
|
||||||
if authorized:
|
if authorized:
|
||||||
|
|
Loading…
Reference in New Issue