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

merge-requests/30/head
Bob Mottram 2022-05-25 21:16:02 +01:00
commit 7179e63de3
29 changed files with 113 additions and 50 deletions

View File

@ -17081,7 +17081,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.domain_full, self.server.domain_full,
self.server.text_mode_banner, self.server.text_mode_banner,
access_keys, access_keys,
False, self.server.system_language) False, self.server.system_language,
self.server.default_timeline)
if msg: if msg:
msg = msg.encode('utf-8') msg = msg.encode('utf-8')
msglen = len(msg) msglen = len(msg)
@ -17123,7 +17124,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.text_mode_banner, self.server.text_mode_banner,
access_keys, access_keys,
True, True,
self.server.system_language) self.server.system_language,
self.server.default_timeline)
if msg: if msg:
msg = msg.encode('utf-8') msg = msg.encode('utf-8')
msglen = len(msg) msglen = len(msg)
@ -21002,6 +21004,7 @@ def run_daemon(preferred_podcast_formats: [],
'menuInbox': 'i', 'menuInbox': 'i',
'menuSearch': '/', 'menuSearch': '/',
'menuNewPost': 'n', 'menuNewPost': 'n',
'menuNewBlog': '0',
'menuCalendar': 'c', 'menuCalendar': 'c',
'menuDM': 'd', 'menuDM': 'd',
'menuReplies': 'r', 'menuReplies': 'r',

View File

@ -66,6 +66,14 @@ main {
flex-basis: 980px; flex-basis: 980px;
} }
.imageAnchor {
font-family: var(--calendar-header-font);
}
.imageAnchor:focus img{
border: 2px solid var(--focus-color);
}
a:visited{ a:visited{
color: var(--day-number); color: var(--day-number);
text-decoration: none; text-decoration: none;
@ -124,7 +132,7 @@ a:focus {
text-align: center; text-align: center;
padding: .75rem; padding: .75rem;
} }
.calendar__banner--month h1 { .calheader {
background-color: var(--title-background); background-color: var(--title-background);
color: var(--title-text); color: var(--title-text);
display: inline-block; display: inline-block;

View File

@ -412,6 +412,7 @@
"menuInbox": "صندوق الوارد", "menuInbox": "صندوق الوارد",
"menuSearch": "البحث / المتتالية", "menuSearch": "البحث / المتتالية",
"menuNewPost": "منشور جديد", "menuNewPost": "منشور جديد",
"menuNewBlog": "مشاركة مدونة جديدة",
"menuCalendar": "تقويم", "menuCalendar": "تقويم",
"menuDM": "رسالة مباشرة", "menuDM": "رسالة مباشرة",
"menuReplies": "الردود", "menuReplies": "الردود",

View File

@ -412,6 +412,7 @@
"menuInbox": "Capa inferior", "menuInbox": "Capa inferior",
"menuSearch": "Cerca / Segueix", "menuSearch": "Cerca / Segueix",
"menuNewPost": "Nou missatge", "menuNewPost": "Nou missatge",
"menuNewBlog": "Nova entrada al blog",
"menuCalendar": "Calendari", "menuCalendar": "Calendari",
"menuDM": "Missatges directes", "menuDM": "Missatges directes",
"menuReplies": "Resum", "menuReplies": "Resum",

View File

@ -412,6 +412,7 @@
"menuInbox": "Mewnflwch", "menuInbox": "Mewnflwch",
"menuSearch": "Chwilio / Dilyn", "menuSearch": "Chwilio / Dilyn",
"menuNewPost": "Swydd newydd", "menuNewPost": "Swydd newydd",
"menuNewBlog": "Post blog newydd",
"menuCalendar": "Galendr", "menuCalendar": "Galendr",
"menuDM": "Negeseuon Uniongyrchol", "menuDM": "Negeseuon Uniongyrchol",
"menuReplies": "Atebion", "menuReplies": "Atebion",

View File

@ -412,6 +412,7 @@
"menuInbox": "Inbox", "menuInbox": "Inbox",
"menuSearch": "Suche / Folgen", "menuSearch": "Suche / Folgen",
"menuNewPost": "Neuer Beitrag", "menuNewPost": "Neuer Beitrag",
"menuNewBlog": "Neuer Blogbeitrag",
"menuCalendar": "Kalender", "menuCalendar": "Kalender",
"menuDM": "Direkte Nachrichten", "menuDM": "Direkte Nachrichten",
"menuReplies": "Antworten", "menuReplies": "Antworten",

View File

@ -412,6 +412,7 @@
"menuInbox": "Inbox", "menuInbox": "Inbox",
"menuSearch": "Αναζήτηση/ακολουθήστε", "menuSearch": "Αναζήτηση/ακολουθήστε",
"menuNewPost": "Νέα ανάρτηση", "menuNewPost": "Νέα ανάρτηση",
"menuNewBlog": "Νέα ανάρτηση ιστολογίου",
"menuCalendar": "Ημερολόγιο", "menuCalendar": "Ημερολόγιο",
"menuDM": "Αμεσα μηνύματα", "menuDM": "Αμεσα μηνύματα",
"menuReplies": "Απαντήσεις", "menuReplies": "Απαντήσεις",

View File

@ -412,6 +412,7 @@
"menuInbox": "Inbox", "menuInbox": "Inbox",
"menuSearch": "Search/follow", "menuSearch": "Search/follow",
"menuNewPost": "New post", "menuNewPost": "New post",
"menuNewBlog": "New blog",
"menuCalendar": "Calendar", "menuCalendar": "Calendar",
"menuDM": "Direct Messages", "menuDM": "Direct Messages",
"menuReplies": "Replies", "menuReplies": "Replies",

View File

@ -412,6 +412,7 @@
"menuInbox": "Bandeja de entrada", "menuInbox": "Bandeja de entrada",
"menuSearch": "Búsqueda / Seguir", "menuSearch": "Búsqueda / Seguir",
"menuNewPost": "Nueva publicación", "menuNewPost": "Nueva publicación",
"menuNewBlog": "Nueva entrada de blog",
"menuCalendar": "Calendario", "menuCalendar": "Calendario",
"menuDM": "Mensajes directos", "menuDM": "Mensajes directos",
"menuReplies": "Respuestas", "menuReplies": "Respuestas",

View File

@ -412,6 +412,7 @@
"menuInbox": "Boîte de réception", "menuInbox": "Boîte de réception",
"menuSearch": "Rechercher / suivre", "menuSearch": "Rechercher / suivre",
"menuNewPost": "Nouveau poste", "menuNewPost": "Nouveau poste",
"menuNewBlog": "Nouvel article de blog",
"menuCalendar": "Calendrier", "menuCalendar": "Calendrier",
"menuDM": "Messages directs", "menuDM": "Messages directs",
"menuReplies": "réponses", "menuReplies": "réponses",

View File

@ -412,6 +412,7 @@
"menuInbox": "Bosca isteach", "menuInbox": "Bosca isteach",
"menuSearch": "Cuardaigh / Lean", "menuSearch": "Cuardaigh / Lean",
"menuNewPost": "Post nua", "menuNewPost": "Post nua",
"menuNewBlog": "Blagphost nua",
"menuCalendar": "Caileandar", "menuCalendar": "Caileandar",
"menuDM": "Teachtaireachtaí díreacha", "menuDM": "Teachtaireachtaí díreacha",
"menuReplies": "Freagraí", "menuReplies": "Freagraí",

View File

@ -412,6 +412,7 @@
"menuInbox": "इनबॉक्स", "menuInbox": "इनबॉक्स",
"menuSearch": "खोज / अनुसरण करें", "menuSearch": "खोज / अनुसरण करें",
"menuNewPost": "नई पोस्ट", "menuNewPost": "नई पोस्ट",
"menuNewBlog": "नया ब्लॉग पोस्ट",
"menuCalendar": "पंचांग", "menuCalendar": "पंचांग",
"menuDM": "सीधे संदेश", "menuDM": "सीधे संदेश",
"menuReplies": "जवाब", "menuReplies": "जवाब",

View File

@ -411,7 +411,8 @@
"menuProfile": "Visualizzazione del profilo", "menuProfile": "Visualizzazione del profilo",
"menuInbox": "Posta in arrivo", "menuInbox": "Posta in arrivo",
"menuSearch": "Cerca / Segui", "menuSearch": "Cerca / Segui",
"menuNewPost": "Nuovo post.", "menuNewPost": "Nuovo post",
"menuNewBlog": "Nuovo articolo sul blog",
"menuCalendar": "Calendario", "menuCalendar": "Calendario",
"menuDM": "Messaggi diretti", "menuDM": "Messaggi diretti",
"menuReplies": "Risposte", "menuReplies": "Risposte",

View File

@ -412,6 +412,7 @@
"menuInbox": "受信箱", "menuInbox": "受信箱",
"menuSearch": "検索/フォロー", "menuSearch": "検索/フォロー",
"menuNewPost": "新しい投稿", "menuNewPost": "新しい投稿",
"menuNewBlog": "新しいブログ投稿",
"menuCalendar": "カレンダー", "menuCalendar": "カレンダー",
"menuDM": "ダイレクトメッセージ", "menuDM": "ダイレクトメッセージ",
"menuReplies": "返信", "menuReplies": "返信",

View File

@ -412,6 +412,7 @@
"menuInbox": "받은 편지함", "menuInbox": "받은 편지함",
"menuSearch": "받은 편지함", "menuSearch": "받은 편지함",
"menuNewPost": "새로운 포스트", "menuNewPost": "새로운 포스트",
"menuNewBlog": "새 블로그 게시물",
"menuCalendar": "달력", "menuCalendar": "달력",
"menuDM": "쪽지", "menuDM": "쪽지",
"menuReplies": "답장", "menuReplies": "답장",

View File

@ -412,6 +412,7 @@
"menuInbox": "Inbott", "menuInbox": "Inbott",
"menuSearch": "Lêgerîn / bişopîne", "menuSearch": "Lêgerîn / bişopîne",
"menuNewPost": "Peyama nû", "menuNewPost": "Peyama nû",
"menuNewBlog": "Posta blogê ya nû",
"menuCalendar": "Salname", "menuCalendar": "Salname",
"menuDM": "Peyamên rasterast", "menuDM": "Peyamên rasterast",
"menuReplies": "Bersiv", "menuReplies": "Bersiv",

View File

@ -412,6 +412,7 @@
"menuInbox": "Postvak IN", "menuInbox": "Postvak IN",
"menuSearch": "Zoeken/volgen", "menuSearch": "Zoeken/volgen",
"menuNewPost": "Nieuw bericht", "menuNewPost": "Nieuw bericht",
"menuNewBlog": "Nieuwe blogpost",
"menuCalendar": "Kalender", "menuCalendar": "Kalender",
"menuDM": "Directe berichten", "menuDM": "Directe berichten",
"menuReplies": "Antwoorden", "menuReplies": "Antwoorden",

View File

@ -408,6 +408,7 @@
"menuInbox": "Inbox", "menuInbox": "Inbox",
"menuSearch": "Search/follow", "menuSearch": "Search/follow",
"menuNewPost": "New post", "menuNewPost": "New post",
"menuNewBlog": "New blog",
"menuCalendar": "Calendar", "menuCalendar": "Calendar",
"menuDM": "Direct Messages", "menuDM": "Direct Messages",
"menuReplies": "Replies", "menuReplies": "Replies",

View File

@ -412,6 +412,7 @@
"menuInbox": "W pudełku", "menuInbox": "W pudełku",
"menuSearch": "Szukaj/obserwuj", "menuSearch": "Szukaj/obserwuj",
"menuNewPost": "Nowy post", "menuNewPost": "Nowy post",
"menuNewBlog": "Nowy wpis na blogu",
"menuCalendar": "Kalendarz", "menuCalendar": "Kalendarz",
"menuDM": "Bezpośrednie wiadomości", "menuDM": "Bezpośrednie wiadomości",
"menuReplies": "Odpowiedzi", "menuReplies": "Odpowiedzi",

View File

@ -412,6 +412,7 @@
"menuInbox": "Caixa de entrada", "menuInbox": "Caixa de entrada",
"menuSearch": "Pesquisa / Siga", "menuSearch": "Pesquisa / Siga",
"menuNewPost": "Nova postagem", "menuNewPost": "Nova postagem",
"menuNewBlog": "Nova postagem no blog",
"menuCalendar": "Calendário", "menuCalendar": "Calendário",
"menuDM": "Mensagens diretas", "menuDM": "Mensagens diretas",
"menuReplies": "Respostas", "menuReplies": "Respostas",

View File

@ -412,6 +412,7 @@
"menuInbox": "Входящие", "menuInbox": "Входящие",
"menuSearch": "Поиск / следующее", "menuSearch": "Поиск / следующее",
"menuNewPost": "Новый пост", "menuNewPost": "Новый пост",
"menuNewBlog": "Новый пост в блоге",
"menuCalendar": "Календарь", "menuCalendar": "Календарь",
"menuDM": "Прямые сообщения", "menuDM": "Прямые сообщения",
"menuReplies": "Отвечает", "menuReplies": "Отвечает",

View File

@ -412,6 +412,7 @@
"menuInbox": "Kikasha", "menuInbox": "Kikasha",
"menuSearch": "Tafuta/Kufuata", "menuSearch": "Tafuta/Kufuata",
"menuNewPost": "Ujumbe mpya", "menuNewPost": "Ujumbe mpya",
"menuNewBlog": "Chapisho jipya la blogi",
"menuCalendar": "Kalenda", "menuCalendar": "Kalenda",
"menuDM": "Ujumbe wa moja kwa moja", "menuDM": "Ujumbe wa moja kwa moja",
"menuReplies": "Jibu", "menuReplies": "Jibu",

View File

@ -412,6 +412,7 @@
"menuInbox": "Gelen kutusu", "menuInbox": "Gelen kutusu",
"menuSearch": "Ara/takip et", "menuSearch": "Ara/takip et",
"menuNewPost": "Yeni posta", "menuNewPost": "Yeni posta",
"menuNewBlog": "Yeni blog yazısı",
"menuCalendar": "Takvim", "menuCalendar": "Takvim",
"menuDM": "Direkt Mesajlar", "menuDM": "Direkt Mesajlar",
"menuReplies": "Cevaplar", "menuReplies": "Cevaplar",

View File

@ -412,6 +412,7 @@
"menuInbox": "Вхідні", "menuInbox": "Вхідні",
"menuSearch": "Шукати/слідкувати", "menuSearch": "Шукати/слідкувати",
"menuNewPost": "Новий пост", "menuNewPost": "Новий пост",
"menuNewBlog": "Нова публікація в блозі",
"menuCalendar": "Календар", "menuCalendar": "Календар",
"menuDM": "Прямі повідомлення", "menuDM": "Прямі повідомлення",
"menuReplies": "Відповіді", "menuReplies": "Відповіді",

View File

@ -412,6 +412,7 @@
"menuInbox": "ינבאָקס", "menuInbox": "ינבאָקס",
"menuSearch": "זוכן / נאָכגיין", "menuSearch": "זוכן / נאָכגיין",
"menuNewPost": "ניו פּאָסטן", "menuNewPost": "ניו פּאָסטן",
"menuNewBlog": "ניו בלאָג פּאָסטן",
"menuCalendar": "קאַלענדאַר", "menuCalendar": "קאַלענדאַר",
"menuDM": "דירעקט אַרטיקלען", "menuDM": "דירעקט אַרטיקלען",
"menuReplies": "ענטפֿערס", "menuReplies": "ענטפֿערס",

View File

@ -412,6 +412,7 @@
"menuInbox": "收件箱", "menuInbox": "收件箱",
"menuSearch": "搜索/关注", "menuSearch": "搜索/关注",
"menuNewPost": "最新帖子", "menuNewPost": "最新帖子",
"menuNewBlog": "新博文",
"menuCalendar": "日历", "menuCalendar": "日历",
"menuDM": "直接留言", "menuDM": "直接留言",
"menuReplies": "答案", "menuReplies": "答案",

View File

@ -67,9 +67,9 @@ def html_calendar_delete_confirm(css_cache: {}, translate: {}, base_dir: str,
delete_post_str = \ delete_post_str = \
html_header_with_external_style(css_filename, instance_title, None) html_header_with_external_style(css_filename, instance_title, None)
delete_post_str += \ delete_post_str += \
'<center><h1>' + post_time + ' ' + str(year) + '/' + \ '<center>\n<h1>' + post_time + ' ' + str(year) + '/' + \
str(month_number) + \ str(month_number) + \
'/' + str(day_number) + '</h1></center>' '/' + str(day_number) + '</h1>\n</center>\n'
delete_post_str += '<center>' delete_post_str += '<center>'
delete_post_str += ' <p class="followText">' + \ delete_post_str += ' <p class="followText">' + \
translate['Delete this event'] + '</p>' translate['Delete this event'] + '</p>'
@ -128,19 +128,22 @@ def _html_calendar_day(person_cache: {}, css_cache: {}, translate: {},
instance_title = get_config_param(base_dir, 'instanceTitle') instance_title = get_config_param(base_dir, 'instanceTitle')
calendar_str = \ calendar_str = \
html_header_with_external_style(css_filename, instance_title, None) html_header_with_external_style(css_filename, instance_title, None)
calendar_str += '<main><table class="calendar">\n' calendar_str += '<main>\n'
calendar_str += '<caption class="calendar__banner--month">\n' # day header
calendar_str += \ calendar_str += \
' <a href="' + cal_actor + '/calendar?year=' + str(year) + \ ' <center>\n<p>\n<a href="' + cal_actor + \
'?month=' + str(month_number) + '">\n' '/calendar?year=' + str(year) + \
'?month=' + str(month_number) + '" tabindex="1" class="imageAnchor">\n'
datetime_str = str(year) + '-' + str(month_number) + '-' + str(day_number) datetime_str = str(year) + '-' + str(month_number) + '-' + str(day_number)
calendar_str += \ calendar_str += \
' <h1><time datetime="' + datetime_str + '">' + \ ' <label class="calheader">' + \
'<time datetime="' + datetime_str + '">' + \
str(day_number) + ' ' + month_name + \ str(day_number) + ' ' + month_name + \
'</time></h1></a><br><span class="year">' + str(year) + '</span>\n' '</time></label></a><br><span class="year">' + str(year) + '</span>\n'
calendar_str += '</caption>\n' calendar_str += '</p>\n</center>\n'
calendar_str += '<table class="calendar">\n'
# day events list
calendar_str += '<tbody>\n' calendar_str += '<tbody>\n'
if day_events: if day_events:
for event_post in day_events: for event_post in day_events:
event_time = None event_time = None
@ -281,12 +284,12 @@ def _html_calendar_day(person_cache: {}, css_cache: {}, translate: {},
delete_button_str + '</tr>\n' delete_button_str + '</tr>\n'
calendar_str += '</tbody>\n' calendar_str += '</tbody>\n'
calendar_str += '</table></main>\n' calendar_str += '</table>\n</main>\n'
# icalendar download link # icalendar download link
calendar_str += \ calendar_str += \
' <a href="' + path + '?ical=true" ' + \ ' <a href="' + path + '?ical=true" ' + \
'download="icalendar.ics">' + \ 'download="icalendar.ics" class="imageAnchor" tabindex="3">' + \
'<img class="ical" src="/icons/ical.png" ' + \ '<img class="ical" src="/icons/ical.png" ' + \
'title="iCalendar" alt="iCalendar" /></a>\n' 'title="iCalendar" alt="iCalendar" /></a>\n'
@ -299,7 +302,8 @@ def html_calendar(person_cache: {}, css_cache: {}, translate: {},
base_dir: str, path: str, base_dir: str, path: str,
http_prefix: str, domain_full: str, http_prefix: str, domain_full: str,
text_mode_banner: str, access_keys: {}, text_mode_banner: str, access_keys: {},
icalendar: bool, system_language: str) -> str: icalendar: bool, system_language: str,
default_timeline: str) -> str:
"""Show the calendar for a person """Show the calendar for a person
""" """
domain = remove_domain_port(domain_full) domain = remove_domain_port(domain_full)
@ -424,34 +428,41 @@ def html_calendar(person_cache: {}, css_cache: {}, translate: {},
html_header_with_external_style(css_filename, instance_title, None) html_header_with_external_style(css_filename, instance_title, None)
# the main graphical calendar as a table # the main graphical calendar as a table
calendar_str = '<main><table class="calendar">\n' calendar_str = '<main>\n<center>\n<p class="calendar__banner--month">\n'
calendar_str += '<caption class="calendar__banner--month">\n' # previous month
calendar_str += \ calendar_str += \
' <a href="' + cal_actor + '/calendar?year=' + str(prev_year) + \ ' <a href="' + cal_actor + '/calendar?year=' + str(prev_year) + \
'?month=' + str(prev_month_number) + '" ' + \ '?month=' + str(prev_month_number) + '" ' + \
'accesskey="' + access_keys['Page up'] + '">' 'accesskey="' + access_keys['Page up'] + \
'" tabindex="2" class="imageAnchor">'
calendar_str += \ calendar_str += \
' <img loading="lazy" decoding="async" ' + \ ' <img loading="lazy" decoding="async" ' + \
'alt="' + translate['Previous month'] + \ 'alt="' + translate['Previous month'] + \
'" title="' + translate['Previous month'] + '" src="/icons' + \ '" title="' + translate['Previous month'] + '" src="/icons' + \
'/prev.png" class="buttonprev"/></a>\n' '/prev.png" class="buttonprev"/></a>\n'
calendar_str += ' <a href="' + cal_actor + '/inbox" title="' # header
calendar_str += translate['Switch to timeline view'] + '" ' + \
'accesskey="' + access_keys['menuTimeline'] + '">'
calendar_str += \ calendar_str += \
' <h1><time datetime="' + \ ' <a href="' + cal_actor + '/' + default_timeline + '" title="'
calendar_str += translate['Switch to timeline view'] + '" ' + \
'accesskey="' + access_keys['menuTimeline'] + \
'" tabindex="1" class="imageAnchor">'
calendar_str += \
' <label class="calheader"><time datetime="' + \
str(year) + '-' + str(month_number) + '">' + month_name + \ str(year) + '-' + str(month_number) + '">' + month_name + \
'</time></h1></a>\n' '</time></label></a>\n'
# next month
calendar_str += \ calendar_str += \
' <a href="' + cal_actor + '/calendar?year=' + str(next_year) + \ ' <a href="' + cal_actor + '/calendar?year=' + str(next_year) + \
'?month=' + str(next_month_number) + '" ' + \ '?month=' + str(next_month_number) + '" ' + \
'accesskey="' + access_keys['Page down'] + '">' 'accesskey="' + access_keys['Page down'] + \
'" tabindex="2" class="imageAnchor">'
calendar_str += \ calendar_str += \
' <img loading="lazy" decoding="async" ' + \ ' <img loading="lazy" decoding="async" ' + \
'alt="' + translate['Next month'] + \ 'alt="' + translate['Next month'] + \
'" title="' + translate['Next month'] + '" src="/icons' + \ '" title="' + translate['Next month'] + '" src="/icons' + \
'/prev.png" class="buttonnext"/></a>\n' '/prev.png" class="buttonnext"/></a>\n'
calendar_str += '</caption>\n' # calendar table
calendar_str += '</p>\n</center>\n<table class="calendar">\n'
calendar_str += '<thead>\n' calendar_str += '<thead>\n'
calendar_str += '<tr>\n' calendar_str += '<tr>\n'
days = ('Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat') days = ('Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat')
@ -493,7 +504,7 @@ def html_calendar(person_cache: {}, css_cache: {}, translate: {},
str(year) + '-' + str(month_number) + '-' + \ str(year) + '-' + str(month_number) + '-' + \
str(day_of_month) str(day_of_month)
day_link = '<a href="' + url + '" ' + \ day_link = '<a href="' + url + '" ' + \
'title="' + day_description + '">' + \ 'title="' + day_description + '" tabindex="2">' + \
'<time datetime="' + datetime_str + '">' + \ '<time datetime="' + datetime_str + '">' + \
str(day_of_month) + '</time></a>' str(day_of_month) + '</time></a>'
# accessibility menu links # accessibility menu links
@ -528,7 +539,7 @@ def html_calendar(person_cache: {}, css_cache: {}, translate: {},
calendar_str += ' </tr>\n' calendar_str += ' </tr>\n'
calendar_str += '</tbody>\n' calendar_str += '</tbody>\n'
calendar_str += '</table></main>\n' calendar_str += '</table>\n</main>\n'
# end of the links used for accessibility # end of the links used for accessibility
next_month_str = \ next_month_str = \
@ -549,12 +560,12 @@ def html_calendar(person_cache: {}, css_cache: {}, translate: {},
new_event_str = \ new_event_str = \
'<br><center>\n<p>\n' + \ '<br><center>\n<p>\n' + \
'<a href="' + cal_actor + '/newreminder"> ' + \ '<a href="' + cal_actor + '/newreminder" tabindex="2"> ' + \
translate['Add to the calendar'] + '</a>\n</p>\n</center>\n' translate['Add to the calendar'] + '</a>\n</p>\n</center>\n'
calendar_icon_str = \ calendar_icon_str = \
' <a href="' + path + '?ical=true" ' + \ ' <a href="' + path + '?ical=true" ' + \
'download="icalendar.ics">' + \ 'download="icalendar.ics" class="imageAnchor" tabindex="3">' + \
'<img class="ical" src="/icons/ical.png" ' + \ '<img class="ical" src="/icons/ical.png" ' + \
'title="iCalendar" alt="iCalendar" /></a>\n' 'title="iCalendar" alt="iCalendar" /></a>\n'

View File

@ -77,7 +77,7 @@ def get_right_column_content(base_dir: str, nickname: str, domain_full: str,
' <a href="' + \ ' <a href="' + \
'/users/' + nickname + '/newblog?nodropdown" ' + \ '/users/' + nickname + '/newblog?nodropdown" ' + \
'title="' + title_str + '" ' + \ 'title="' + title_str + '" ' + \
'accesskey="' + access_keys['menuNewPost'] + '">' + \ 'accesskey="' + access_keys['menuNewBlog'] + '">' + \
'<button class="publishbtn" tabindex="4">' + \ '<button class="publishbtn" tabindex="4">' + \
translate['Publish'] + '</button></a>\n' translate['Publish'] + '</button></a>\n'
else: else:
@ -183,7 +183,7 @@ def get_right_column_content(base_dir: str, nickname: str, domain_full: str,
html_str += \ html_str += \
' <a href="' + \ ' <a href="' + \
'/users/' + nickname + '/newblog?nodropdown" ' + \ '/users/' + nickname + '/newblog?nodropdown" ' + \
'accesskey="' + access_keys['menuNewPost'] + \ 'accesskey="' + access_keys['menuNewBlog'] + \
'" class="imageAnchor" tabindex="4">' + \ '" class="imageAnchor" tabindex="4">' + \
'<img class="' + edit_image_class + \ '<img class="' + edit_image_class + \
'" loading="lazy" decoding="async" alt="' + \ '" loading="lazy" decoding="async" alt="' + \

View File

@ -99,7 +99,8 @@ def _get_help_for_timeline(base_dir: str, box_name: str) -> str:
def _html_timeline_new_post(manually_approve_followers: bool, def _html_timeline_new_post(manually_approve_followers: bool,
box_name: str, icons_as_buttons: bool, box_name: str, icons_as_buttons: bool,
users_path: str, translate: {}) -> str: users_path: str, translate: {},
access_keys: {}) -> str:
"""Returns html for the new post button """Returns html for the new post button
""" """
new_post_button_str = '' new_post_button_str = ''
@ -107,8 +108,9 @@ def _html_timeline_new_post(manually_approve_followers: bool,
if not icons_as_buttons: if not icons_as_buttons:
new_post_button_str += \ new_post_button_str += \
'<a class="imageAnchor" href="' + users_path + \ '<a class="imageAnchor" href="' + users_path + \
'/newdm?nodropdown" tabindex="3"><img loading="lazy" ' + \ '/newdm?nodropdown" tabindex="3" accesskey="' + \
'decoding="async" src="/' + \ access_keys['menuNewPost'] + '">' + \
'<img loading="lazy" decoding="async" src="/' + \
'icons/newpost.png" title="' + \ 'icons/newpost.png" title="' + \
translate['Create a new DM'] + \ translate['Create a new DM'] + \
'" alt="| ' + translate['Create a new DM'] + \ '" alt="| ' + translate['Create a new DM'] + \
@ -116,14 +118,16 @@ def _html_timeline_new_post(manually_approve_followers: bool,
else: else:
new_post_button_str += \ new_post_button_str += \
'<a href="' + users_path + \ '<a href="' + users_path + \
'/newdm?nodropdown" tabindex="3">' + \ '/newdm?nodropdown" tabindex="3" accesskey="' + \
access_keys['menuNewPost'] + '">' + \
'<button class="button"><span>' + \ '<button class="button"><span>' + \
translate['Post'] + ' </span></button></a>' translate['Post'] + ' </span></button></a>'
elif box_name in ('tlblogs', 'tlnews', 'tlfeatures'): elif box_name in ('tlblogs', 'tlnews', 'tlfeatures'):
if not icons_as_buttons: if not icons_as_buttons:
new_post_button_str += \ new_post_button_str += \
'<a class="imageAnchor" href="' + users_path + \ '<a class="imageAnchor" href="' + users_path + \
'/newblog" tabindex="3">' + \ '/newblog" tabindex="3" accesskey="' + \
access_keys['menuNewPost'] + '">' + \
'<img loading="lazy" decoding="async" src="/' + \ '<img loading="lazy" decoding="async" src="/' + \
'icons/newpost.png" title="' + \ 'icons/newpost.png" title="' + \
translate['Create a new post'] + '" alt="| ' + \ translate['Create a new post'] + '" alt="| ' + \
@ -131,14 +135,17 @@ def _html_timeline_new_post(manually_approve_followers: bool,
'" class="timelineicon"/></a>\n' '" class="timelineicon"/></a>\n'
else: else:
new_post_button_str += \ new_post_button_str += \
'<a href="' + users_path + '/newblog" tabindex="3">' + \ '<a href="' + users_path + \
'/newblog" tabindex="3" accesskey="' + \
access_keys['menuNewPost'] + '">' + \
'<button class="button"><span>' + \ '<button class="button"><span>' + \
translate['Post'] + '</span></button></a>' translate['Post'] + '</span></button></a>'
elif box_name == 'tlshares': elif box_name == 'tlshares':
if not icons_as_buttons: if not icons_as_buttons:
new_post_button_str += \ new_post_button_str += \
'<a class="imageAnchor" href="' + users_path + \ '<a class="imageAnchor" href="' + users_path + \
'/newshare?nodropdown" tabindex="3">' + \ '/newshare?nodropdown" tabindex="3" accesskey="' + \
access_keys['menuNewPost'] + '">' + \
'<img loading="lazy" decoding="async" src="/' + \ '<img loading="lazy" decoding="async" src="/' + \
'icons/newpost.png" title="' + \ 'icons/newpost.png" title="' + \
translate['Create a new shared item'] + '" alt="| ' + \ translate['Create a new shared item'] + '" alt="| ' + \
@ -147,14 +154,16 @@ def _html_timeline_new_post(manually_approve_followers: bool,
else: else:
new_post_button_str += \ new_post_button_str += \
'<a href="' + users_path + \ '<a href="' + users_path + \
'/newshare?nodropdown" tabindex="3">' + \ '/newshare?nodropdown" tabindex="3" accesskey="' + \
access_keys['menuNewPost'] + '">' + \
'<button class="button"><span>' + \ '<button class="button"><span>' + \
translate['Post'] + '</span></button></a>' translate['Post'] + '</span></button></a>'
elif box_name == 'tlwanted': elif box_name == 'tlwanted':
if not icons_as_buttons: if not icons_as_buttons:
new_post_button_str += \ new_post_button_str += \
'<a class="imageAnchor" href="' + users_path + \ '<a class="imageAnchor" href="' + users_path + \
'/newwanted?nodropdown" tabindex="3">' + \ '/newwanted?nodropdown" tabindex="3" accesskey="' + \
access_keys['menuNewPost'] + '">' + \
'<img loading="lazy" decoding="async" src="/' + \ '<img loading="lazy" decoding="async" src="/' + \
'icons/newpost.png" title="' + \ 'icons/newpost.png" title="' + \
translate['Create a new wanted item'] + '" alt="| ' + \ translate['Create a new wanted item'] + '" alt="| ' + \
@ -163,7 +172,8 @@ def _html_timeline_new_post(manually_approve_followers: bool,
else: else:
new_post_button_str += \ new_post_button_str += \
'<a href="' + users_path + \ '<a href="' + users_path + \
'/newwanted?nodropdown" tabindex="3">' + \ '/newwanted?nodropdown" tabindex="3" accesskey="' + \
access_keys['menuNewPost'] + '">' + \
'<button class="button"><span>' + \ '<button class="button"><span>' + \
translate['Post'] + '</span></button></a>' translate['Post'] + '</span></button></a>'
else: else:
@ -186,7 +196,8 @@ def _html_timeline_new_post(manually_approve_followers: bool,
if not icons_as_buttons: if not icons_as_buttons:
new_post_button_str += \ new_post_button_str += \
'<a class="imageAnchor" href="' + users_path + \ '<a class="imageAnchor" href="' + users_path + \
'/newfollowers" tabindex="3">' + \ '/newfollowers" tabindex="3" accesskey="' + \
access_keys['menuNewPost'] + '">' + \
'<img loading="lazy" decoding="async" src="/' + \ '<img loading="lazy" decoding="async" src="/' + \
'icons/newpost.png" title="' + \ 'icons/newpost.png" title="' + \
translate['Create a new post'] + \ translate['Create a new post'] + \
@ -195,7 +206,8 @@ def _html_timeline_new_post(manually_approve_followers: bool,
else: else:
new_post_button_str += \ new_post_button_str += \
'<a href="' + users_path + \ '<a href="' + users_path + \
'/newfollowers" tabindex="3">' + \ '/newfollowers" tabindex="3" accesskey="' + \
access_keys['menuNewPost'] + '">' + \
'<button class="button"><span>' + \ '<button class="button"><span>' + \
translate['Post'] + '</span></button></a>' translate['Post'] + '</span></button></a>'
return new_post_button_str return new_post_button_str
@ -737,7 +749,8 @@ def html_timeline(css_cache: {}, default_timeline: str,
# what screen to go to when a new post is created # what screen to go to when a new post is created
new_post_button_str += \ new_post_button_str += \
_html_timeline_new_post(manually_approve_followers, box_name, _html_timeline_new_post(manually_approve_followers, box_name,
icons_as_buttons, users_path, translate) icons_as_buttons, users_path, translate,
access_keys)
# keyboard navigation # keyboard navigation
tl_str += \ tl_str += \
@ -894,7 +907,8 @@ def html_timeline(css_cache: {}, default_timeline: str,
' <center>\n' + \ ' <center>\n' + \
' <a href="' + users_path + '/' + box_name + \ ' <a href="' + users_path + '/' + box_name + \
'?page=' + str(page_number - 1) + \ '?page=' + str(page_number - 1) + \
'" accesskey="' + access_keys['Page up'] + '">' + \ '" accesskey="' + access_keys['Page up'] + '" ' + \
'class="imageAnchor" tabindex="9">' + \
'<img loading="lazy" decoding="async" class="pageicon" src="/' + \ '<img loading="lazy" decoding="async" class="pageicon" src="/' + \
'icons/pageup.png" title="' + \ 'icons/pageup.png" title="' + \
translate['Page up'] + '" alt="' + \ translate['Page up'] + '" alt="' + \
@ -1006,7 +1020,8 @@ def html_timeline(css_cache: {}, default_timeline: str,
' <center>\n' + \ ' <center>\n' + \
' <a href="' + users_path + '/' + box_name + '?page=' + \ ' <a href="' + users_path + '/' + box_name + '?page=' + \
str(page_number + 1) + \ str(page_number + 1) + \
'" accesskey="' + access_keys['Page down'] + '">' + \ '" accesskey="' + access_keys['Page down'] + '" ' + \
'class="imageAnchor" tabindex="9">' + \
'<img loading="lazy" decoding="async" class="pageicon" src="/' + \ '<img loading="lazy" decoding="async" class="pageicon" src="/' + \
'icons/pagedown.png" title="' + \ 'icons/pagedown.png" title="' + \
translate['Page down'] + '" alt="' + \ translate['Page down'] + '" alt="' + \
@ -1135,7 +1150,8 @@ def _html_shares_timeline(translate: {}, page_number: int, items_per_page: int,
' <center>\n' + \ ' <center>\n' + \
' <a href="' + actor + '/tl' + sharesFileType + '?page=' + \ ' <a href="' + actor + '/tl' + sharesFileType + '?page=' + \
str(page_number - 1) + \ str(page_number - 1) + \
'"><img loading="lazy" decoding="async" ' + \ '" class="imageAnchor" tabindex="9">' + \
'<img loading="lazy" decoding="async" ' + \
'class="pageicon" src="/' + \ 'class="pageicon" src="/' + \
'icons/pageup.png" title="' + translate['Page up'] + \ 'icons/pageup.png" title="' + translate['Page up'] + \
'" alt="' + translate['Page up'] + '"></a>\n' + \ '" alt="' + translate['Page up'] + '"></a>\n' + \
@ -1176,7 +1192,8 @@ def _html_shares_timeline(translate: {}, page_number: int, items_per_page: int,
' <center>\n' + \ ' <center>\n' + \
' <a href="' + actor + '/tl' + sharesFileType + '?page=' + \ ' <a href="' + actor + '/tl' + sharesFileType + '?page=' + \
str(page_number + 1) + \ str(page_number + 1) + \
'"><img loading="lazy" decoding="async" ' + \ '" class="imageAnchor" tabindex="9">' + \
'<img loading="lazy" decoding="async" ' + \
'class="pageicon" src="/' + \ 'class="pageicon" src="/' + \
'icons/pagedown.png" title="' + translate['Page down'] + \ 'icons/pagedown.png" title="' + translate['Page down'] + \
'" alt="' + translate['Page down'] + '"></a>\n' + \ '" alt="' + translate['Page down'] + '"></a>\n' + \