mirror of https://gitlab.com/bashrc2/epicyon
Merge branch 'main' of gitlab.com:bashrc2/epicyon
commit
8ef8ff33c7
16
daemon.py
16
daemon.py
|
|
@ -238,6 +238,7 @@ from categories import updateHashtagCategories
|
||||||
from languages import getActorLanguages
|
from languages import getActorLanguages
|
||||||
from languages import setActorLanguages
|
from languages import setActorLanguages
|
||||||
from like import updateLikesCollection
|
from like import updateLikesCollection
|
||||||
|
from utils import getNewPostEndpoints
|
||||||
from utils import malformedCiphertext
|
from utils import malformedCiphertext
|
||||||
from utils import hasActor
|
from utils import hasActor
|
||||||
from utils import setReplyIntervalHours
|
from utils import setReplyIntervalHours
|
||||||
|
|
@ -11893,12 +11894,9 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
isNewPostEndpoint = False
|
isNewPostEndpoint = False
|
||||||
if '/users/' in path and '/new' in path:
|
if '/users/' in path and '/new' in path:
|
||||||
# Various types of new post in the web interface
|
# Various types of new post in the web interface
|
||||||
newPostEnd = ('newpost', 'newblog', 'newunlisted',
|
newPostEndpoints = getNewPostEndpoints()
|
||||||
'newfollowers', 'newdm', 'newreminder',
|
for currPostType in newPostEndpoints:
|
||||||
'newreport', 'newquestion',
|
if path.endswith('/' + currPostType):
|
||||||
'newshare', 'newwanted')
|
|
||||||
for postType in newPostEnd:
|
|
||||||
if path.endswith('/' + postType):
|
|
||||||
isNewPostEndpoint = True
|
isNewPostEndpoint = True
|
||||||
break
|
break
|
||||||
if isNewPostEndpoint:
|
if isNewPostEndpoint:
|
||||||
|
|
@ -16699,10 +16697,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.debug)
|
self.server.debug)
|
||||||
|
|
||||||
# receive different types of post created by htmlNewPost
|
# receive different types of post created by htmlNewPost
|
||||||
postTypes = ("newpost", "newblog", "newunlisted", "newfollowers",
|
newPostEndpoints = getNewPostEndpoints()
|
||||||
"newdm", "newreport", "newshare", "newwanted",
|
for currPostType in newPostEndpoints:
|
||||||
"newquestion", "editblogpost", "newreminder")
|
|
||||||
for currPostType in postTypes:
|
|
||||||
if not authorized:
|
if not authorized:
|
||||||
if self.server.debug:
|
if self.server.debug:
|
||||||
print('POST was not authorized')
|
print('POST was not authorized')
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,8 @@
|
||||||
--calendar-horizontal-padding: 0;
|
--calendar-horizontal-padding: 0;
|
||||||
--calendar-cell-size: 1.5vw;
|
--calendar-cell-size: 1.5vw;
|
||||||
--calendar-cell-size-mobile: 1.5vw;
|
--calendar-cell-size-mobile: 1.5vw;
|
||||||
|
--font-size-calendar: 20px;
|
||||||
|
--font-size-calendar-mobile: 30px;
|
||||||
--font-size-calendar-header: 3rem;
|
--font-size-calendar-header: 3rem;
|
||||||
--font-size-calendar-day: 1rem;
|
--font-size-calendar-day: 1rem;
|
||||||
--font-size-calendar-cell: 2rem;
|
--font-size-calendar-cell: 2rem;
|
||||||
|
|
@ -248,6 +250,9 @@ tr:nth-child(even) > .calendar__day__cell:nth-child(even) {
|
||||||
.calendar__day__cell {
|
.calendar__day__cell {
|
||||||
padding: var(--calendar-cell-size) 0 var(--calendar-cell-size);
|
padding: var(--calendar-cell-size) 0 var(--calendar-cell-size);
|
||||||
}
|
}
|
||||||
|
body {
|
||||||
|
font-size: var(--font-size-calendar);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (max-width: 1000px) {
|
@media screen and (max-width: 1000px) {
|
||||||
|
|
@ -265,4 +270,7 @@ tr:nth-child(even) > .calendar__day__cell:nth-child(even) {
|
||||||
.calendar__day__cell {
|
.calendar__day__cell {
|
||||||
padding: var(--calendar-cell-size-mobile) 0 var(--calendar-cell-size-mobile);
|
padding: var(--calendar-cell-size-mobile) 0 var(--calendar-cell-size-mobile);
|
||||||
}
|
}
|
||||||
|
body {
|
||||||
|
font-size: var(--font-size-calendar-mobile);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -513,13 +513,6 @@ a:focus {
|
||||||
color: var(--button-text-hover);
|
color: var(--button-text-hover);
|
||||||
}
|
}
|
||||||
|
|
||||||
.containerNewPost {
|
|
||||||
border: var(--border-width) solid var(--border-color);
|
|
||||||
border-radius: var(--timeline-border-radius);
|
|
||||||
background-color: var(--main-bg-color);
|
|
||||||
margin: var(--vertical-between-posts);
|
|
||||||
}
|
|
||||||
|
|
||||||
.containerSubmitNewPost {
|
.containerSubmitNewPost {
|
||||||
border: 0;
|
border: 0;
|
||||||
background-color: var(--main-bg-color);
|
background-color: var(--main-bg-color);
|
||||||
|
|
@ -1058,6 +1051,16 @@ div.container {
|
||||||
padding-bottom: var(--container-padding-bottom);
|
padding-bottom: var(--container-padding-bottom);
|
||||||
margin: var(--vertical-between-posts);
|
margin: var(--vertical-between-posts);
|
||||||
}
|
}
|
||||||
|
.containerNewPost {
|
||||||
|
border: var(--border-width) solid var(--border-color);
|
||||||
|
background-color: var(--main-bg-color);
|
||||||
|
border-radius: var(--timeline-border-radius);
|
||||||
|
padding-left: var(--container-padding);
|
||||||
|
padding-right: var(--container-padding);
|
||||||
|
padding-top: var(--container-padding);
|
||||||
|
padding-bottom: var(--container-padding-bottom);
|
||||||
|
margin: var(--vertical-between-posts);
|
||||||
|
}
|
||||||
h3.linksHeader {
|
h3.linksHeader {
|
||||||
background-color: var(--column-left-header-background);
|
background-color: var(--column-left-header-background);
|
||||||
color: var(--column-left-header-color);
|
color: var(--column-left-header-color);
|
||||||
|
|
@ -1754,6 +1757,16 @@ div.container {
|
||||||
padding-bottom: var(--container-padding-bottom-mobile);
|
padding-bottom: var(--container-padding-bottom-mobile);
|
||||||
margin: var(--vertical-between-posts);
|
margin: var(--vertical-between-posts);
|
||||||
}
|
}
|
||||||
|
.containerNewPost {
|
||||||
|
border: var(--border-width) solid var(--border-color);
|
||||||
|
background-color: var(--main-bg-color);
|
||||||
|
border-radius: var(--timeline-border-radius);
|
||||||
|
padding-left: var(--container-padding);
|
||||||
|
padding-right: var(--container-padding);
|
||||||
|
padding-top: var(--container-padding);
|
||||||
|
padding-bottom: var(--container-padding-bottom-mobile);
|
||||||
|
margin: var(--vertical-between-posts);
|
||||||
|
}
|
||||||
h3.linksHeader {
|
h3.linksHeader {
|
||||||
background-color: var(--column-left-header-background);
|
background-color: var(--column-left-header-background);
|
||||||
color: var(--column-left-header-color);
|
color: var(--column-left-header-color);
|
||||||
|
|
|
||||||
|
|
@ -490,5 +490,6 @@
|
||||||
"Leave": "يترك",
|
"Leave": "يترك",
|
||||||
"System Monitor": "مراقب النظام",
|
"System Monitor": "مراقب النظام",
|
||||||
"Add content warnings for the following sites": "أضف تحذيرات المحتوى للمواقع التالية",
|
"Add content warnings for the following sites": "أضف تحذيرات المحتوى للمواقع التالية",
|
||||||
"Known Web Crawlers": "برامج زحف الويب المعروفة"
|
"Known Web Crawlers": "برامج زحف الويب المعروفة",
|
||||||
|
"Add to the calendar": "أضف إلى التقويم"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -490,5 +490,6 @@
|
||||||
"Leave": "Marxa",
|
"Leave": "Marxa",
|
||||||
"System Monitor": "Monitor del sistema",
|
"System Monitor": "Monitor del sistema",
|
||||||
"Add content warnings for the following sites": "Afegiu advertiments de contingut per als llocs següents",
|
"Add content warnings for the following sites": "Afegiu advertiments de contingut per als llocs següents",
|
||||||
"Known Web Crawlers": "Exploradors web coneguts"
|
"Known Web Crawlers": "Exploradors web coneguts",
|
||||||
|
"Add to the calendar": "Afegeix al calendari"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -490,5 +490,6 @@
|
||||||
"Leave": "Gadewch",
|
"Leave": "Gadewch",
|
||||||
"System Monitor": "Monitor System",
|
"System Monitor": "Monitor System",
|
||||||
"Add content warnings for the following sites": "Ychwanegwch rybuddion cynnwys ar gyfer y gwefannau canlynol",
|
"Add content warnings for the following sites": "Ychwanegwch rybuddion cynnwys ar gyfer y gwefannau canlynol",
|
||||||
"Known Web Crawlers": "Crawlers Gwe Hysbys"
|
"Known Web Crawlers": "Crawlers Gwe Hysbys",
|
||||||
|
"Add to the calendar": "Ychwanegwch at y calendr"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -490,5 +490,6 @@
|
||||||
"Leave": "Verlassen",
|
"Leave": "Verlassen",
|
||||||
"System Monitor": "Systemmonitor",
|
"System Monitor": "Systemmonitor",
|
||||||
"Add content warnings for the following sites": "Inhaltswarnungen für die folgenden Websites hinzufügen",
|
"Add content warnings for the following sites": "Inhaltswarnungen für die folgenden Websites hinzufügen",
|
||||||
"Known Web Crawlers": "Bekannte Web-Crawler"
|
"Known Web Crawlers": "Bekannte Web-Crawler",
|
||||||
|
"Add to the calendar": "Zum Kalender hinzufügen"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -490,5 +490,6 @@
|
||||||
"Leave": "Leave",
|
"Leave": "Leave",
|
||||||
"System Monitor": "System Monitor",
|
"System Monitor": "System Monitor",
|
||||||
"Add content warnings for the following sites": "Add content warnings for the following sites",
|
"Add content warnings for the following sites": "Add content warnings for the following sites",
|
||||||
"Known Web Crawlers": "Known Web Crawlers"
|
"Known Web Crawlers": "Known Web Crawlers",
|
||||||
|
"Add to the calendar": "Add to the calendar"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -490,5 +490,6 @@
|
||||||
"Leave": "Dejar",
|
"Leave": "Dejar",
|
||||||
"System Monitor": "Monitor del sistema",
|
"System Monitor": "Monitor del sistema",
|
||||||
"Add content warnings for the following sites": "Agregue advertencias de contenido para los siguientes sitios",
|
"Add content warnings for the following sites": "Agregue advertencias de contenido para los siguientes sitios",
|
||||||
"Known Web Crawlers": "Rastreadores web conocidos"
|
"Known Web Crawlers": "Rastreadores web conocidos",
|
||||||
|
"Add to the calendar": "Agregar al calendario"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -490,5 +490,6 @@
|
||||||
"Leave": "Laisser",
|
"Leave": "Laisser",
|
||||||
"System Monitor": "Moniteur système",
|
"System Monitor": "Moniteur système",
|
||||||
"Add content warnings for the following sites": "Ajouter des avertissements de contenu pour les sites suivants",
|
"Add content warnings for the following sites": "Ajouter des avertissements de contenu pour les sites suivants",
|
||||||
"Known Web Crawlers": "Crawlers Web connus"
|
"Known Web Crawlers": "Crawlers Web connus",
|
||||||
|
"Add to the calendar": "Ajouter au calendrier"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -490,5 +490,6 @@
|
||||||
"Leave": "Fág",
|
"Leave": "Fág",
|
||||||
"System Monitor": "Monatóir Córais",
|
"System Monitor": "Monatóir Córais",
|
||||||
"Add content warnings for the following sites": "Cuir rabhaidh ábhair leis na suíomhanna seo a leanas",
|
"Add content warnings for the following sites": "Cuir rabhaidh ábhair leis na suíomhanna seo a leanas",
|
||||||
"Known Web Crawlers": "Crawlers Gréasáin Aitheanta"
|
"Known Web Crawlers": "Crawlers Gréasáin Aitheanta",
|
||||||
|
"Add to the calendar": "Cuir leis an bhféilire"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -490,5 +490,6 @@
|
||||||
"Leave": "छोड़ना",
|
"Leave": "छोड़ना",
|
||||||
"System Monitor": "सिस्टम मॉनिटर",
|
"System Monitor": "सिस्टम मॉनिटर",
|
||||||
"Add content warnings for the following sites": "निम्नलिखित साइटों के लिए सामग्री चेतावनियाँ जोड़ें",
|
"Add content warnings for the following sites": "निम्नलिखित साइटों के लिए सामग्री चेतावनियाँ जोड़ें",
|
||||||
"Known Web Crawlers": "ज्ञात वेब क्रॉलर"
|
"Known Web Crawlers": "ज्ञात वेब क्रॉलर",
|
||||||
|
"Add to the calendar": "कैलेंडर में जोड़ें"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -490,5 +490,6 @@
|
||||||
"Leave": "Lasciare",
|
"Leave": "Lasciare",
|
||||||
"System Monitor": "Monitor di sistema",
|
"System Monitor": "Monitor di sistema",
|
||||||
"Add content warnings for the following sites": "Aggiungi avvisi sui contenuti per i seguenti siti",
|
"Add content warnings for the following sites": "Aggiungi avvisi sui contenuti per i seguenti siti",
|
||||||
"Known Web Crawlers": "Crawler Web conosciuti"
|
"Known Web Crawlers": "Crawler Web conosciuti",
|
||||||
|
"Add to the calendar": "Aggiungi al calendario"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -490,5 +490,6 @@
|
||||||
"Leave": "離れる",
|
"Leave": "離れる",
|
||||||
"System Monitor": "システムモニター",
|
"System Monitor": "システムモニター",
|
||||||
"Add content warnings for the following sites": "次のサイトのコンテンツ警告を追加します",
|
"Add content warnings for the following sites": "次のサイトのコンテンツ警告を追加します",
|
||||||
"Known Web Crawlers": "既知のWebクローラー"
|
"Known Web Crawlers": "既知のWebクローラー",
|
||||||
|
"Add to the calendar": "カレンダーに追加"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -490,5 +490,6 @@
|
||||||
"Leave": "Terikandin",
|
"Leave": "Terikandin",
|
||||||
"System Monitor": "System Monitor",
|
"System Monitor": "System Monitor",
|
||||||
"Add content warnings for the following sites": "Ji bo malperên jêrîn hişyariyên naverokê zêde bikin",
|
"Add content warnings for the following sites": "Ji bo malperên jêrîn hişyariyên naverokê zêde bikin",
|
||||||
"Known Web Crawlers": "Crawlerên Webê yên naskirî"
|
"Known Web Crawlers": "Crawlerên Webê yên naskirî",
|
||||||
|
"Add to the calendar": "Di salnameyê de zêde bike"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -486,5 +486,6 @@
|
||||||
"Leave": "Leave",
|
"Leave": "Leave",
|
||||||
"System Monitor": "System Monitor",
|
"System Monitor": "System Monitor",
|
||||||
"Add content warnings for the following sites": "Add content warnings for the following sites",
|
"Add content warnings for the following sites": "Add content warnings for the following sites",
|
||||||
"Known Web Crawlers": "Known Web Crawlers"
|
"Known Web Crawlers": "Known Web Crawlers",
|
||||||
|
"Add to the calendar": "Add to the calendar"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -490,5 +490,6 @@
|
||||||
"Leave": "Sair",
|
"Leave": "Sair",
|
||||||
"System Monitor": "Monitor de Sistema",
|
"System Monitor": "Monitor de Sistema",
|
||||||
"Add content warnings for the following sites": "Adicione avisos de conteúdo para os seguintes sites",
|
"Add content warnings for the following sites": "Adicione avisos de conteúdo para os seguintes sites",
|
||||||
"Known Web Crawlers": "Rastreadores da Web conhecidos"
|
"Known Web Crawlers": "Rastreadores da Web conhecidos",
|
||||||
|
"Add to the calendar": "Adicionar ao calendário"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -490,5 +490,6 @@
|
||||||
"Leave": "Оставлять",
|
"Leave": "Оставлять",
|
||||||
"System Monitor": "Системный монитор",
|
"System Monitor": "Системный монитор",
|
||||||
"Add content warnings for the following sites": "Добавить предупреждения о содержании для следующих сайтов",
|
"Add content warnings for the following sites": "Добавить предупреждения о содержании для следующих сайтов",
|
||||||
"Known Web Crawlers": "Известные веб-сканеры"
|
"Known Web Crawlers": "Известные веб-сканеры",
|
||||||
|
"Add to the calendar": "Добавить в календарь"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -490,5 +490,6 @@
|
||||||
"Leave": "Ondoka",
|
"Leave": "Ondoka",
|
||||||
"System Monitor": "Ufuatiliaji wa Mfumo",
|
"System Monitor": "Ufuatiliaji wa Mfumo",
|
||||||
"Add content warnings for the following sites": "Ongeza maonyo ya yaliyomo kwa wavuti zifuatazo",
|
"Add content warnings for the following sites": "Ongeza maonyo ya yaliyomo kwa wavuti zifuatazo",
|
||||||
"Known Web Crawlers": "Watambaji Wavuti Wanaojulikana"
|
"Known Web Crawlers": "Watambaji Wavuti Wanaojulikana",
|
||||||
|
"Add to the calendar": "Ongeza kwenye kalenda"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -490,5 +490,6 @@
|
||||||
"Leave": "离开",
|
"Leave": "离开",
|
||||||
"System Monitor": "系统监视器",
|
"System Monitor": "系统监视器",
|
||||||
"Add content warnings for the following sites": "为以下网站添加内容警告",
|
"Add content warnings for the following sites": "为以下网站添加内容警告",
|
||||||
"Known Web Crawlers": "已知的网络爬虫"
|
"Known Web Crawlers": "已知的网络爬虫",
|
||||||
|
"Add to the calendar": "添加到日历"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
10
utils.py
10
utils.py
|
|
@ -3145,3 +3145,13 @@ def hasObjectString(postJsonObject: {}, debug: bool) -> bool:
|
||||||
if debug:
|
if debug:
|
||||||
print('No object field within post ' + postJsonObject['id'])
|
print('No object field within post ' + postJsonObject['id'])
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
def getNewPostEndpoints() -> []:
|
||||||
|
"""Returns a list of endpoints for new posts
|
||||||
|
"""
|
||||||
|
return (
|
||||||
|
'newpost', 'newblog', 'newunlisted', 'newfollowers', 'newdm',
|
||||||
|
'newreminder', 'newreport', 'newquestion', 'newshare', 'newwanted',
|
||||||
|
'editblogpost'
|
||||||
|
)
|
||||||
|
|
|
||||||
|
|
@ -284,9 +284,10 @@ def htmlCalendar(personCache: {}, cssCache: {}, translate: {},
|
||||||
|
|
||||||
setCustomBackground(baseDir, 'calendar-background', 'calendar-background')
|
setCustomBackground(baseDir, 'calendar-background', 'calendar-background')
|
||||||
|
|
||||||
months = ('January', 'February', 'March', 'April',
|
months = (
|
||||||
'May', 'June', 'July', 'August', 'September',
|
'January', 'February', 'March', 'April', 'May', 'June',
|
||||||
'October', 'November', 'December')
|
'July', 'August', 'September', 'October', 'November', 'December'
|
||||||
|
)
|
||||||
monthName = translate[months[monthNumber - 1]]
|
monthName = translate[months[monthNumber - 1]]
|
||||||
|
|
||||||
if dayNumber:
|
if dayNumber:
|
||||||
|
|
@ -453,4 +454,12 @@ def htmlCalendar(personCache: {}, cssCache: {}, translate: {},
|
||||||
htmlKeyboardNavigation(textModeBanner, navLinks, navAccessKeys,
|
htmlKeyboardNavigation(textModeBanner, navLinks, navAccessKeys,
|
||||||
monthName)
|
monthName)
|
||||||
|
|
||||||
return headerStr + screenReaderCal + calendarStr + htmlFooter()
|
newEventStr = \
|
||||||
|
'<br><center>\n<p>\n' + \
|
||||||
|
'<a href="' + calActor + '/newreminder">➕ ' + \
|
||||||
|
translate['Add to the calendar'] + '</a>\n</p>\n</center>\n'
|
||||||
|
|
||||||
|
calStr = \
|
||||||
|
headerStr + screenReaderCal + calendarStr + newEventStr + htmlFooter()
|
||||||
|
|
||||||
|
return calStr
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ __status__ = "Production"
|
||||||
__module_group__ = "Web Interface"
|
__module_group__ = "Web Interface"
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
from utils import getNewPostEndpoints
|
||||||
from utils import isPublicPostFromUrl
|
from utils import isPublicPostFromUrl
|
||||||
from utils import getNicknameFromActor
|
from utils import getNicknameFromActor
|
||||||
from utils import getDomainFromActor
|
from utils import getDomainFromActor
|
||||||
|
|
@ -199,6 +200,24 @@ def htmlNewPost(cssCache: {}, mediaInstance: bool, translate: {},
|
||||||
"""
|
"""
|
||||||
replyStr = ''
|
replyStr = ''
|
||||||
|
|
||||||
|
isNewReminder = False
|
||||||
|
if path.endswith('/newreminder'):
|
||||||
|
isNewReminder = True
|
||||||
|
|
||||||
|
# the date and time
|
||||||
|
dateAndTimeStr = \
|
||||||
|
'<p><img loading="lazy" alt="" title="" ' + \
|
||||||
|
'class="emojicalendar" src="/' + \
|
||||||
|
'icons/calendar.png"/>\n'
|
||||||
|
# select a date and time for this post
|
||||||
|
dateAndTimeStr += '<label class="labels">' + \
|
||||||
|
translate['Date'] + ': </label>\n'
|
||||||
|
dateAndTimeStr += '<input type="date" name="eventDate">\n'
|
||||||
|
dateAndTimeStr += '<label class="labelsright">' + \
|
||||||
|
translate['Time'] + ': '
|
||||||
|
dateAndTimeStr += \
|
||||||
|
'<input type="time" name="eventTime"></label></p>\n'
|
||||||
|
|
||||||
showPublicOnDropdown = True
|
showPublicOnDropdown = True
|
||||||
messageBoxHeight = 400
|
messageBoxHeight = 400
|
||||||
|
|
||||||
|
|
@ -208,7 +227,7 @@ def htmlNewPost(cssCache: {}, mediaInstance: bool, translate: {},
|
||||||
|
|
||||||
if not path.endswith('/newshare') and not path.endswith('/newwanted'):
|
if not path.endswith('/newshare') and not path.endswith('/newwanted'):
|
||||||
if not path.endswith('/newreport'):
|
if not path.endswith('/newreport'):
|
||||||
if not inReplyTo or path.endswith('/newreminder'):
|
if not inReplyTo or isNewReminder:
|
||||||
newPostText = '<h1>' + \
|
newPostText = '<h1>' + \
|
||||||
translate['Write your post text below.'] + '</h1>\n'
|
translate['Write your post text below.'] + '</h1>\n'
|
||||||
else:
|
else:
|
||||||
|
|
@ -289,13 +308,12 @@ def htmlNewPost(cssCache: {}, mediaInstance: bool, translate: {},
|
||||||
|
|
||||||
if '?' in path:
|
if '?' in path:
|
||||||
path = path.split('?')[0]
|
path = path.split('?')[0]
|
||||||
pathBase = path.replace('/newreport', '').replace('/newpost', '')
|
newPostEndpoints = getNewPostEndpoints()
|
||||||
pathBase = pathBase.replace('/newblog', '').replace('/newshare', '')
|
pathBase = path
|
||||||
pathBase = pathBase.replace('/newunlisted', '').replace('/newwanted', '')
|
for currPostType in newPostEndpoints:
|
||||||
pathBase = pathBase.replace('/newreminder', '')
|
pathBase = pathBase.replace('/' + currPostType, '')
|
||||||
pathBase = pathBase.replace('/newfollowers', '').replace('/newdm', '')
|
|
||||||
|
|
||||||
newPostImageSection = ' <div class="container">'
|
newPostImageSection = ' <div class="container">\n'
|
||||||
newPostImageSection += \
|
newPostImageSection += \
|
||||||
editTextField(translate['Image description'], 'imageDescription', '')
|
editTextField(translate['Image description'], 'imageDescription', '')
|
||||||
|
|
||||||
|
|
@ -351,7 +369,7 @@ def htmlNewPost(cssCache: {}, mediaInstance: bool, translate: {},
|
||||||
scopeIcon = 'scope_dm.png'
|
scopeIcon = 'scope_dm.png'
|
||||||
scopeDescription = translate['DM']
|
scopeDescription = translate['DM']
|
||||||
endpoint = 'newdm'
|
endpoint = 'newdm'
|
||||||
elif path.endswith('/newreminder'):
|
elif isNewReminder:
|
||||||
scopeIcon = 'scope_reminder.png'
|
scopeIcon = 'scope_reminder.png'
|
||||||
scopeDescription = translate['Reminder']
|
scopeDescription = translate['Reminder']
|
||||||
endpoint = 'newreminder'
|
endpoint = 'newreminder'
|
||||||
|
|
@ -540,43 +558,37 @@ def htmlNewPost(cssCache: {}, mediaInstance: bool, translate: {},
|
||||||
endpoint != 'newwanted' and \
|
endpoint != 'newwanted' and \
|
||||||
endpoint != 'newreport' and \
|
endpoint != 'newreport' and \
|
||||||
endpoint != 'newquestion':
|
endpoint != 'newquestion':
|
||||||
dateAndLocation = \
|
|
||||||
'<div class="container">\n'
|
|
||||||
if category != 'accommodation':
|
|
||||||
dateAndLocation += \
|
|
||||||
'<p><input type="checkbox" class="profilecheckbox" ' + \
|
|
||||||
'name="commentsEnabled" checked><label class="labels"> ' + \
|
|
||||||
translate['Allow replies.'] + '</label></p>\n'
|
|
||||||
else:
|
|
||||||
dateAndLocation += \
|
|
||||||
'<input type="hidden" name="commentsEnabled" value="true">\n'
|
|
||||||
|
|
||||||
if endpoint == 'newpost':
|
if not isNewReminder:
|
||||||
dateAndLocation += \
|
dateAndLocation = \
|
||||||
'<p><input type="checkbox" class="profilecheckbox" ' + \
|
'<div class="container">\n'
|
||||||
'name="pinToProfile"><label class="labels"> ' + \
|
if category != 'accommodation':
|
||||||
translate['Pin this post to your profile.'] + '</label></p>\n'
|
dateAndLocation += \
|
||||||
|
'<p><input type="checkbox" class="profilecheckbox" ' + \
|
||||||
|
'name="commentsEnabled" ' + \
|
||||||
|
'checked><label class="labels"> ' + \
|
||||||
|
translate['Allow replies.'] + '</label></p>\n'
|
||||||
|
else:
|
||||||
|
dateAndLocation += \
|
||||||
|
'<input type="hidden" name="commentsEnabled" ' + \
|
||||||
|
'value="true">\n'
|
||||||
|
|
||||||
if not inReplyTo:
|
if endpoint == 'newpost':
|
||||||
dateAndLocation += \
|
dateAndLocation += \
|
||||||
'<p><input type="checkbox" class="profilecheckbox" ' + \
|
'<p><input type="checkbox" class="profilecheckbox" ' + \
|
||||||
'name="schedulePost"><label class="labels"> ' + \
|
'name="pinToProfile"><label class="labels"> ' + \
|
||||||
translate['This is a scheduled post.'] + '</label></p>\n'
|
translate['Pin this post to your profile.'] + \
|
||||||
|
'</label></p>\n'
|
||||||
|
|
||||||
dateAndLocation += \
|
if not inReplyTo:
|
||||||
'<p><img loading="lazy" alt="" title="" ' + \
|
dateAndLocation += \
|
||||||
'class="emojicalendar" src="/' + \
|
'<p><input type="checkbox" class="profilecheckbox" ' + \
|
||||||
'icons/calendar.png"/>\n'
|
'name="schedulePost"><label class="labels"> ' + \
|
||||||
# select a date and time for this post
|
translate['This is a scheduled post.'] + '</label></p>\n'
|
||||||
dateAndLocation += '<label class="labels">' + \
|
|
||||||
translate['Date'] + ': </label>\n'
|
dateAndLocation += dateAndTimeStr
|
||||||
dateAndLocation += '<input type="date" name="eventDate">\n'
|
dateAndLocation += '</div>\n'
|
||||||
dateAndLocation += '<label class="labelsright">' + \
|
|
||||||
translate['Time'] + ':'
|
|
||||||
dateAndLocation += \
|
|
||||||
'<input type="time" name="eventTime"></label></p>\n'
|
|
||||||
|
|
||||||
dateAndLocation += '</div>\n'
|
|
||||||
dateAndLocation += '<div class="container">\n'
|
dateAndLocation += '<div class="container">\n'
|
||||||
dateAndLocation += \
|
dateAndLocation += \
|
||||||
editTextField(translate['Location'], 'location', '')
|
editTextField(translate['Location'], 'location', '')
|
||||||
|
|
@ -730,6 +742,13 @@ def htmlNewPost(cssCache: {}, mediaInstance: bool, translate: {},
|
||||||
|
|
||||||
if not shareDescription:
|
if not shareDescription:
|
||||||
shareDescription = ''
|
shareDescription = ''
|
||||||
|
|
||||||
|
# for reminders show the date and time at the top
|
||||||
|
if isNewReminder:
|
||||||
|
newPostForm += '<div class="container">\n'
|
||||||
|
newPostForm += dateAndTimeStr
|
||||||
|
newPostForm += '</div>\n'
|
||||||
|
|
||||||
newPostForm += \
|
newPostForm += \
|
||||||
editTextField(placeholderSubject, 'subject', shareDescription)
|
editTextField(placeholderSubject, 'subject', shareDescription)
|
||||||
newPostForm += ''
|
newPostForm += ''
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue