Merge branch 'main' of gitlab.com:bashrc2/epicyon

merge-requests/30/head
Bob Mottram 2022-06-03 22:23:25 +01:00
commit ae81b9a9c9
28 changed files with 119 additions and 58 deletions

View File

@ -7965,7 +7965,6 @@ class PubServer(BaseHTTPRequestHandler):
msg = \ msg = \
html_person_options(self.server.default_timeline, html_person_options(self.server.default_timeline,
self.server.css_cache,
self.server.translate, self.server.translate,
base_dir, domain, base_dir, domain,
domain_full, domain_full,
@ -7988,7 +7987,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.text_mode_banner, self.server.text_mode_banner,
self.server.news_instance, self.server.news_instance,
authorized, authorized,
access_keys, is_group) access_keys, is_group,
self.server.theme_name)
if msg: if msg:
msg = msg.encode('utf-8') msg = msg.encode('utf-8')
msglen = len(msg) msglen = len(msg)
@ -14607,8 +14607,7 @@ class PubServer(BaseHTTPRequestHandler):
if '?' in post_day: if '?' in post_day:
post_day = post_day.split('?')[0] post_day = post_day.split('?')[0]
# show the confirmation screen screen # show the confirmation screen screen
msg = html_calendar_delete_confirm(self.server.css_cache, msg = html_calendar_delete_confirm(translate,
translate,
base_dir, path, base_dir, path,
http_prefix, http_prefix,
domain_full, domain_full,

View File

@ -1,6 +1,9 @@
@charset "UTF-8"; @charset "UTF-8";
:root { :root {
--banner-height: 20vh;
--banner-height-mobile: 10vh;
--banner-height-tiny: 10vh;
--avatar-rounding: 10%; --avatar-rounding: 10%;
--options-bg-color: #282c37; --options-bg-color: #282c37;
--options-link-bg-color: transparent; --options-link-bg-color: transparent;
@ -151,6 +154,12 @@ a:focus {
} }
@media screen and (min-width: 400px) { @media screen and (min-width: 400px) {
.timeline-banner {
vertical-align: top;
object-fit: cover;
width: 100%;
max-height: var(--banner-height);
}
textarea { textarea {
font-family: Arial, Helvetica, sans-serif; font-family: Arial, Helvetica, sans-serif;
font-size: var(--font-size4); font-size: var(--font-size4);
@ -228,6 +237,12 @@ a:focus {
} }
@media screen and (max-width: 1000px) { @media screen and (max-width: 1000px) {
.timeline-banner {
vertical-align: top;
object-fit: cover;
width: 98vw;
max-height: var(--banner-height-mobile);
}
textarea { textarea {
font-family: Arial, Helvetica, sans-serif; font-family: Arial, Helvetica, sans-serif;
font-size: var(--font-size); font-size: var(--font-size);
@ -305,6 +320,12 @@ a:focus {
} }
@media screen and (max-width: 480px) { @media screen and (max-width: 480px) {
.timeline-banner {
vertical-align: top;
object-fit: cover;
width: 98vw;
max-height: var(--banner-height-tiny);
}
textarea { textarea {
font-family: Arial, Helvetica, sans-serif; font-family: Arial, Helvetica, sans-serif;
font-size: var(--font-size2); font-size: var(--font-size2);

View File

@ -559,5 +559,6 @@
"View Larger Map": "عرض خريطة أكبر", "View Larger Map": "عرض خريطة أكبر",
"Start Time": "وقت البدء", "Start Time": "وقت البدء",
"End Time": "وقت النهاية", "End Time": "وقت النهاية",
"Switch to calendar view": "قم بالتبديل إلى عرض التقويم" "Switch to calendar view": "قم بالتبديل إلى عرض التقويم",
"Save": "يحفظ"
} }

View File

@ -559,5 +559,6 @@
"View Larger Map": "Veure mapa més gran", "View Larger Map": "Veure mapa més gran",
"Start Time": "L'hora d'inici", "Start Time": "L'hora d'inici",
"End Time": "Temps esgotat", "End Time": "Temps esgotat",
"Switch to calendar view": "Canvia a la vista del calendari" "Switch to calendar view": "Canvia a la vista del calendari",
"Save": "Desa"
} }

View File

@ -559,5 +559,6 @@
"View Larger Map": "Gweld Map Mwy", "View Larger Map": "Gweld Map Mwy",
"Start Time": "Amser Dechrau", "Start Time": "Amser Dechrau",
"End Time": "Amser Gorffen", "End Time": "Amser Gorffen",
"Switch to calendar view": "Newid i wedd calendr" "Switch to calendar view": "Newid i wedd calendr",
"Save": "Arbed"
} }

View File

@ -559,5 +559,6 @@
"View Larger Map": "größere Karte ansehen", "View Larger Map": "größere Karte ansehen",
"Start Time": "Startzeit", "Start Time": "Startzeit",
"End Time": "Endzeit", "End Time": "Endzeit",
"Switch to calendar view": "Zur Kalenderansicht wechseln" "Switch to calendar view": "Zur Kalenderansicht wechseln",
"Save": "Speichern"
} }

View File

@ -559,5 +559,6 @@
"View Larger Map": "Δείτε Μεγαλύτερο Χάρτη", "View Larger Map": "Δείτε Μεγαλύτερο Χάρτη",
"Start Time": "Ωρα έναρξης", "Start Time": "Ωρα έναρξης",
"End Time": "Τέλος χρόνου", "End Time": "Τέλος χρόνου",
"Switch to calendar view": "Μετάβαση σε προβολή ημερολογίου" "Switch to calendar view": "Μετάβαση σε προβολή ημερολογίου",
"Save": "Αποθηκεύσετε"
} }

View File

@ -559,5 +559,6 @@
"View Larger Map": "View Larger Map", "View Larger Map": "View Larger Map",
"Start Time": "Start Time", "Start Time": "Start Time",
"End Time": "End Time", "End Time": "End Time",
"Switch to calendar view": "Switch to calendar view" "Switch to calendar view": "Switch to calendar view",
"Save": "Save"
} }

View File

@ -559,5 +559,6 @@
"View Larger Map": "Ver mapa más grande", "View Larger Map": "Ver mapa más grande",
"Start Time": "Hora de inicio", "Start Time": "Hora de inicio",
"End Time": "Hora de finalización", "End Time": "Hora de finalización",
"Switch to calendar view": "Cambiar a vista de calendario" "Switch to calendar view": "Cambiar a vista de calendario",
"Save": "Ahorrar"
} }

View File

@ -559,5 +559,6 @@
"View Larger Map": "Agrandir le plan", "View Larger Map": "Agrandir le plan",
"Start Time": "Heure de début", "Start Time": "Heure de début",
"End Time": "Heure de fin", "End Time": "Heure de fin",
"Switch to calendar view": "Basculer vers la vue calendrier" "Switch to calendar view": "Basculer vers la vue calendrier",
"Save": "Sauvegarder"
} }

View File

@ -559,5 +559,6 @@
"View Larger Map": "Féach ar Léarscáil Níos Mó", "View Larger Map": "Féach ar Léarscáil Níos Mó",
"Start Time": "Am Tosaigh", "Start Time": "Am Tosaigh",
"End Time": "Am Deiridh", "End Time": "Am Deiridh",
"Switch to calendar view": "Athraigh go hamharc féilire" "Switch to calendar view": "Athraigh go hamharc féilire",
"Save": "Sábháil"
} }

View File

@ -559,5 +559,6 @@
"View Larger Map": "बड़ा नक्शा देखें", "View Larger Map": "बड़ा नक्शा देखें",
"Start Time": "समय शुरू", "Start Time": "समय शुरू",
"End Time": "अंत समय", "End Time": "अंत समय",
"Switch to calendar view": "कैलेंडर दृश्य पर स्विच करें" "Switch to calendar view": "कैलेंडर दृश्य पर स्विच करें",
"Save": "बचाना"
} }

View File

@ -559,5 +559,6 @@
"View Larger Map": "Visualizza mappa più grande", "View Larger Map": "Visualizza mappa più grande",
"Start Time": "Ora di inizio", "Start Time": "Ora di inizio",
"End Time": "Tempo scaduto", "End Time": "Tempo scaduto",
"Switch to calendar view": "Passa alla visualizzazione del calendario" "Switch to calendar view": "Passa alla visualizzazione del calendario",
"Save": "Salva"
} }

View File

@ -559,5 +559,6 @@
"View Larger Map": "大きな地図を見る", "View Larger Map": "大きな地図を見る",
"Start Time": "始まる時間", "Start Time": "始まる時間",
"End Time": "終了時間", "End Time": "終了時間",
"Switch to calendar view": "カレンダービューに切り替えます" "Switch to calendar view": "カレンダービューに切り替えます",
"Save": "保存"
} }

View File

@ -559,5 +559,6 @@
"View Larger Map": "큰 지도 보기", "View Larger Map": "큰 지도 보기",
"Start Time": "시작 시간", "Start Time": "시작 시간",
"End Time": "종료 시간", "End Time": "종료 시간",
"Switch to calendar view": "캘린더 보기로 전환" "Switch to calendar view": "캘린더 보기로 전환",
"Save": "구하다"
} }

View File

@ -559,5 +559,6 @@
"View Larger Map": "Nexşeya Mezin bibînin", "View Larger Map": "Nexşeya Mezin bibînin",
"Start Time": "Demjimêra Destpêkê", "Start Time": "Demjimêra Destpêkê",
"End Time": "Dema Dawî", "End Time": "Dema Dawî",
"Switch to calendar view": "Biguherîne bo dîtina salnameyê" "Switch to calendar view": "Biguherîne bo dîtina salnameyê",
"Save": "Rizgarkirin"
} }

View File

@ -559,5 +559,6 @@
"View Larger Map": "zie grotere kaart", "View Larger Map": "zie grotere kaart",
"Start Time": "Starttijd", "Start Time": "Starttijd",
"End Time": "Eindtijd", "End Time": "Eindtijd",
"Switch to calendar view": "Overschakelen naar kalenderweergave" "Switch to calendar view": "Overschakelen naar kalenderweergave",
"Save": "Opslaan"
} }

View File

@ -555,5 +555,6 @@
"View Larger Map": "View Larger Map", "View Larger Map": "View Larger Map",
"Start Time": "Start Time", "Start Time": "Start Time",
"End Time": "End Time", "End Time": "End Time",
"Switch to calendar view": "Switch to calendar view" "Switch to calendar view": "Switch to calendar view",
"Save": "Save"
} }

View File

@ -559,5 +559,6 @@
"View Larger Map": "Wyświetl Większą Mapę", "View Larger Map": "Wyświetl Większą Mapę",
"Start Time": "Czas rozpoczęcia", "Start Time": "Czas rozpoczęcia",
"End Time": "Koniec czasu", "End Time": "Koniec czasu",
"Switch to calendar view": "Przełącz na widok kalendarza" "Switch to calendar view": "Przełącz na widok kalendarza",
"Save": "Ratować"
} }

View File

@ -559,5 +559,6 @@
"View Larger Map": "ver o mapa maior", "View Larger Map": "ver o mapa maior",
"Start Time": "Hora de início", "Start Time": "Hora de início",
"End Time": "Fim do tempo", "End Time": "Fim do tempo",
"Switch to calendar view": "Mudar para a vista de calendário" "Switch to calendar view": "Mudar para a vista de calendário",
"Save": "Salvar"
} }

View File

@ -559,5 +559,6 @@
"View Larger Map": "Посмотреть увеличенную карту", "View Larger Map": "Посмотреть увеличенную карту",
"Start Time": "Время начала", "Start Time": "Время начала",
"End Time": "Время окончания", "End Time": "Время окончания",
"Switch to calendar view": "Переключиться на представление календаря" "Switch to calendar view": "Переключиться на представление календаря",
"Save": "Сохранять"
} }

View File

@ -559,5 +559,6 @@
"View Larger Map": "Tazama Ramani Kubwa", "View Larger Map": "Tazama Ramani Kubwa",
"Start Time": "Wakati wa Kuanza", "Start Time": "Wakati wa Kuanza",
"End Time": "Wakati wa Mwisho", "End Time": "Wakati wa Mwisho",
"Switch to calendar view": "Badili hadi mwonekano wa kalenda" "Switch to calendar view": "Badili hadi mwonekano wa kalenda",
"Save": "Hifadhi"
} }

View File

@ -559,5 +559,6 @@
"View Larger Map": "Daha Büyük Haritayı Görüntüle", "View Larger Map": "Daha Büyük Haritayı Görüntüle",
"Start Time": "Başlangıç saati", "Start Time": "Başlangıç saati",
"End Time": "Bitiş zamanı", "End Time": "Bitiş zamanı",
"Switch to calendar view": "Takvim görünümüne geç" "Switch to calendar view": "Takvim görünümüne geç",
"Save": "Kaydetmek"
} }

View File

@ -559,5 +559,6 @@
"View Larger Map": "Переглянути більшу карту", "View Larger Map": "Переглянути більшу карту",
"Start Time": "Час початку", "Start Time": "Час початку",
"End Time": "Час закінчення", "End Time": "Час закінчення",
"Switch to calendar view": "Перейти до перегляду календаря" "Switch to calendar view": "Перейти до перегляду календаря",
"Save": "Зберегти"
} }

View File

@ -559,5 +559,6 @@
"View Larger Map": "View גרעסערע מאַפּע", "View Larger Map": "View גרעסערע מאַפּע",
"Start Time": "אָנהייב צייט", "Start Time": "אָנהייב צייט",
"End Time": "סוף צייט", "End Time": "סוף צייט",
"Switch to calendar view": "באַשטימען צו די קאַלענדאַר מיינונג" "Switch to calendar view": "באַשטימען צו די קאַלענדאַר מיינונג",
"Save": "היט"
} }

View File

@ -559,5 +559,6 @@
"View Larger Map": "查看更大的地图", "View Larger Map": "查看更大的地图",
"Start Time": "开始时间", "Start Time": "开始时间",
"End Time": "时间结束", "End Time": "时间结束",
"Switch to calendar view": "切换到日历视图" "Switch to calendar view": "切换到日历视图",
"Save": "节省"
} }

View File

@ -35,7 +35,7 @@ from webapp_utils import html_keyboard_navigation
from maps import html_open_street_map from maps import html_open_street_map
def html_calendar_delete_confirm(css_cache: {}, translate: {}, base_dir: str, def html_calendar_delete_confirm(translate: {}, base_dir: str,
path: str, http_prefix: str, path: str, http_prefix: str,
domain_full: str, post_id: str, domain_full: str, post_id: str,
post_time: str, post_time: str,
@ -512,7 +512,7 @@ def html_calendar(person_cache: {}, css_cache: {}, translate: {},
nav_links = {} nav_links = {}
timeline_link_str = html_hide_from_screen_reader('🏠') + ' ' + \ timeline_link_str = html_hide_from_screen_reader('🏠') + ' ' + \
translate['Switch to timeline view'] translate['Switch to timeline view']
nav_links[timeline_link_str] = cal_actor + '/inbox' nav_links[timeline_link_str] = cal_actor + '/' + default_timeline
day_of_month = 0 day_of_month = 0
dow = week_day_of_month_start(month_number, year) dow = week_day_of_month_start(month_number, year)

View File

@ -29,10 +29,12 @@ from webapp_utils import html_header_with_external_style
from webapp_utils import html_footer from webapp_utils import html_footer
from webapp_utils import get_broken_link_substitute from webapp_utils import get_broken_link_substitute
from webapp_utils import html_keyboard_navigation from webapp_utils import html_keyboard_navigation
from webapp_utils import get_banner_file
from webapp_utils import html_hide_from_screen_reader
def html_person_options(default_timeline: str, def html_person_options(default_timeline: str,
css_cache: {}, translate: {}, base_dir: str, translate: {}, base_dir: str,
domain: str, domain_full: str, domain: str, domain_full: str,
origin_path_str: str, origin_path_str: str,
options_actor: str, options_actor: str,
@ -61,7 +63,8 @@ def html_person_options(default_timeline: str,
news_instance: bool, news_instance: bool,
authorized: bool, authorized: bool,
access_keys: {}, access_keys: {},
is_group: bool) -> str: is_group: bool,
theme: str) -> str:
"""Show options for a person: view/follow/block/report """Show options for a person: view/follow/block/report
""" """
options_domain, options_port = get_domain_from_actor(options_actor) options_domain, options_port = get_domain_from_actor(options_actor)
@ -136,8 +139,39 @@ def html_person_options(default_timeline: str,
options_str = \ options_str = \
html_header_with_external_style(css_filename, instance_title, None) html_header_with_external_style(css_filename, instance_title, None)
options_str += html_keyboard_navigation(text_mode_banner, {}, {}) # show banner
options_str += '<br><br>\n' banner_file, _ = \
get_banner_file(base_dir, nickname, domain, theme)
back_path = '/'
if nickname:
back_path = '/users/' + nickname + '/' + default_timeline
if 'moderation' in back_to_path:
back_path = '/users/' + nickname + '/moderation'
if authorized and origin_path_str == '/users/' + nickname:
banner_link = back_path
else:
banner_link = origin_path_str
options_str += \
'<header>\n<a href="' + banner_link + \
'" title="' + translate['Switch to timeline view'] + '" alt="' + \
translate['Switch to timeline view'] + '" ' + \
'tabindex="1" accesskey="' + access_keys['menuTimeline'] + '">\n'
options_str += \
'<img loading="lazy" decoding="async" ' + \
'class="timeline-banner" alt="" ' + \
'src="/users/' + nickname + '/' + banner_file + '" /></a>\n' + \
'</header>\n<br><br>\n'
nav_links = {}
timeline_link_str = html_hide_from_screen_reader('🏠') + ' ' + \
translate['Switch to timeline view']
nav_links[timeline_link_str] = \
'/users/' + nickname + '/' + default_timeline
nav_access_keys = {
}
options_str += \
html_keyboard_navigation(text_mode_banner, nav_links, nav_access_keys)
options_str += '<div class="options">\n' options_str += '<div class="options">\n'
options_str += ' <div class="optionsAvatar">\n' options_str += ' <div class="optionsAvatar">\n'
options_str += ' <center>\n' options_str += ' <center>\n'
@ -272,7 +306,7 @@ def html_person_options(default_timeline: str,
'accesskey="' + access_keys['enterPetname'] + '">\n' \ 'accesskey="' + access_keys['enterPetname'] + '">\n' \
' <button type="submit" class="buttonsmall" ' + \ ' <button type="submit" class="buttonsmall" ' + \
'name="submitPetname">' + \ 'name="submitPetname">' + \
translate['Publish'] + '</button><br>\n' translate['Save'] + '</button><br>\n'
# Notify when a post arrives from this person # Notify when a post arrives from this person
if is_following_actor(base_dir, nickname, domain, options_actor): if is_following_actor(base_dir, nickname, domain, options_actor):
@ -282,7 +316,7 @@ def html_person_options(default_timeline: str,
translate['Notify me when this account posts'] + \ translate['Notify me when this account posts'] + \
'\n <button type="submit" class="buttonsmall" ' + \ '\n <button type="submit" class="buttonsmall" ' + \
'name="submitNotifyOnPost">' + \ 'name="submitNotifyOnPost">' + \
translate['Publish'] + '</button><br>\n' translate['Save'] + '</button><br>\n'
if not notify_when_person_posts(base_dir, nickname, domain, if not notify_when_person_posts(base_dir, nickname, domain,
options_nickname, options_nickname,
options_domain_full): options_domain_full):
@ -295,7 +329,7 @@ def html_person_options(default_timeline: str,
translate['Receive calendar events from this account'] + \ translate['Receive calendar events from this account'] + \
'\n <button type="submit" class="buttonsmall" ' + \ '\n <button type="submit" class="buttonsmall" ' + \
'name="submitOnCalendar">' + \ 'name="submitOnCalendar">' + \
translate['Publish'] + '</button><br>\n' translate['Save'] + '</button><br>\n'
if not receiving_calendar_events(base_dir, nickname, domain, if not receiving_calendar_events(base_dir, nickname, domain,
options_nickname, options_nickname,
options_domain_full): options_domain_full):
@ -320,7 +354,7 @@ def html_person_options(default_timeline: str,
translate['Allow news posts'] + \ translate['Allow news posts'] + \
'\n <button type="submit" class="buttonsmall" ' + \ '\n <button type="submit" class="buttonsmall" ' + \
'name="submitPostToNews">' + \ 'name="submitPostToNews">' + \
translate['Publish'] + '</button><br>\n' translate['Save'] + '</button><br>\n'
if os.path.isfile(newswire_blocked_filename): if os.path.isfile(newswire_blocked_filename):
checkbox_str = checkbox_str.replace(' checked>', '>') checkbox_str = checkbox_str.replace(' checked>', '>')
else: else:
@ -340,7 +374,7 @@ def html_person_options(default_timeline: str,
translate['News posts are moderated'] + \ translate['News posts are moderated'] + \
'\n <button type="submit" class="buttonsmall" ' + \ '\n <button type="submit" class="buttonsmall" ' + \
'name="submitModNewsPosts">' + \ 'name="submitModNewsPosts">' + \
translate['Publish'] + '</button><br>\n' translate['Save'] + '</button><br>\n'
if not os.path.isfile(moderated_filename): if not os.path.isfile(moderated_filename):
checkbox_str = checkbox_str.replace(' checked>', '>') checkbox_str = checkbox_str.replace(' checked>', '>')
options_str += checkbox_str options_str += checkbox_str
@ -358,30 +392,13 @@ def html_person_options(default_timeline: str,
translate['Featured writer'] + \ translate['Featured writer'] + \
'\n <button type="submit" class="buttonsmall" ' + \ '\n <button type="submit" class="buttonsmall" ' + \
'name="submitPostToFeatures">' + \ 'name="submitPostToFeatures">' + \
translate['Publish'] + '</button><br>\n' translate['Save'] + '</button><br>\n'
if not is_featured_writer(base_dir, options_nickname, if not is_featured_writer(base_dir, options_nickname,
options_domain): options_domain):
checkbox_str = checkbox_str.replace(' checked>', '>') checkbox_str = checkbox_str.replace(' checked>', '>')
options_str += checkbox_str options_str += checkbox_str
options_str += options_link_str options_str += options_link_str
back_path = '/'
if nickname:
back_path = '/users/' + nickname + '/' + default_timeline
if 'moderation' in back_to_path:
back_path = '/users/' + nickname + '/moderation'
if authorized and origin_path_str == '/users/' + nickname:
options_str += \
' <a href="' + back_path + '"><button type="button" ' + \
'class="buttonIcon" name="submitBack" ' + \
'accesskey="' + access_keys['menuTimeline'] + '">' + \
translate['Go Back'] + '</button></a>\n'
else:
options_str += \
' <a href="' + origin_path_str + '"><button type="button" ' + \
'class="buttonIcon" name="submitBack" accesskey="' + \
access_keys['menuTimeline'] + '">' + translate['Go Back'] + \
'</button></a>\n'
if authorized: if authorized:
options_str += \ options_str += \
' <button type="submit" class="button" ' + \ ' <button type="submit" class="button" ' + \
@ -434,7 +451,7 @@ def html_person_options(default_timeline: str,
' <br><br>' + translate['Notes'] + ': \n' ' <br><br>' + translate['Notes'] + ': \n'
options_str += ' <button type="submit" class="buttonsmall" ' + \ options_str += ' <button type="submit" class="buttonsmall" ' + \
'name="submitPersonNotes">' + \ 'name="submitPersonNotes">' + \
translate['Publish'] + '</button><br>\n' translate['Save'] + '</button><br>\n'
options_str += \ options_str += \
' <textarea id="message" ' + \ ' <textarea id="message" ' + \
'name="optionnotes" style="height:400px" spellcheck="true" ' + \ 'name="optionnotes" style="height:400px" spellcheck="true" ' + \