mirror of https://gitlab.com/bashrc2/epicyon
Merge branch 'main' of gitlab.com:bashrc2/epicyon
commit
707c3a58c5
45
daemon.py
45
daemon.py
|
@ -3975,18 +3975,33 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
|
|
||||||
if fields.get('editedLinks'):
|
if fields.get('editedLinks'):
|
||||||
linksStr = fields['editedLinks']
|
linksStr = fields['editedLinks']
|
||||||
|
if fields.get('newColLink'):
|
||||||
|
if linksStr:
|
||||||
|
if not linksStr.endswith('\n'):
|
||||||
|
linksStr += '\n'
|
||||||
|
linksStr += fields['newColLink'] + '\n'
|
||||||
try:
|
try:
|
||||||
with open(linksFilename, 'w+') as linksFile:
|
with open(linksFilename, 'w+') as linksFile:
|
||||||
linksFile.write(linksStr)
|
linksFile.write(linksStr)
|
||||||
except OSError:
|
except OSError:
|
||||||
print('EX: _linksUpdate unable to write ' + linksFilename)
|
print('EX: _linksUpdate unable to write ' + linksFilename)
|
||||||
else:
|
else:
|
||||||
if os.path.isfile(linksFilename):
|
if fields.get('newColLink'):
|
||||||
|
# the text area is empty but there is a new link added
|
||||||
|
linksStr = fields['newColLink'] + '\n'
|
||||||
try:
|
try:
|
||||||
os.remove(linksFilename)
|
with open(linksFilename, 'w+') as linksFile:
|
||||||
|
linksFile.write(linksStr)
|
||||||
except OSError:
|
except OSError:
|
||||||
print('EX: _linksUpdate unable to delete ' +
|
print('EX: _linksUpdate unable to write ' +
|
||||||
linksFilename)
|
linksFilename)
|
||||||
|
else:
|
||||||
|
if os.path.isfile(linksFilename):
|
||||||
|
try:
|
||||||
|
os.remove(linksFilename)
|
||||||
|
except OSError:
|
||||||
|
print('EX: _linksUpdate unable to delete ' +
|
||||||
|
linksFilename)
|
||||||
|
|
||||||
adminNickname = \
|
adminNickname = \
|
||||||
getConfigParam(baseDir, 'admin')
|
getConfigParam(baseDir, 'admin')
|
||||||
|
@ -4199,18 +4214,34 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
extractTextFieldsInPOST(postBytes, boundary, debug)
|
extractTextFieldsInPOST(postBytes, boundary, debug)
|
||||||
if fields.get('editedNewswire'):
|
if fields.get('editedNewswire'):
|
||||||
newswireStr = fields['editedNewswire']
|
newswireStr = fields['editedNewswire']
|
||||||
|
# append a new newswire entry
|
||||||
|
if fields.get('newNewswireFeed'):
|
||||||
|
if newswireStr:
|
||||||
|
if not newswireStr.endswith('\n'):
|
||||||
|
newswireStr += '\n'
|
||||||
|
newswireStr += fields['newNewswireFeed'] + '\n'
|
||||||
try:
|
try:
|
||||||
with open(newswireFilename, 'w+') as newswireFile:
|
with open(newswireFilename, 'w+') as newswireFile:
|
||||||
newswireFile.write(newswireStr)
|
newswireFile.write(newswireStr)
|
||||||
except OSError:
|
except OSError:
|
||||||
print('EX: unable to write ' + newswireFilename)
|
print('EX: unable to write ' + newswireFilename)
|
||||||
else:
|
else:
|
||||||
if os.path.isfile(newswireFilename):
|
if fields.get('newNewswireFeed'):
|
||||||
|
# the text area is empty but there is a new feed added
|
||||||
|
newswireStr = fields['newNewswireFeed'] + '\n'
|
||||||
try:
|
try:
|
||||||
os.remove(newswireFilename)
|
with open(newswireFilename, 'w+') as newswireFile:
|
||||||
|
newswireFile.write(newswireStr)
|
||||||
except OSError:
|
except OSError:
|
||||||
print('EX: _newswireUpdate unable to delete ' +
|
print('EX: unable to write ' + newswireFilename)
|
||||||
newswireFilename)
|
else:
|
||||||
|
# text area has been cleared and there is no new feed
|
||||||
|
if os.path.isfile(newswireFilename):
|
||||||
|
try:
|
||||||
|
os.remove(newswireFilename)
|
||||||
|
except OSError:
|
||||||
|
print('EX: _newswireUpdate unable to delete ' +
|
||||||
|
newswireFilename)
|
||||||
|
|
||||||
# save filtered words list for the newswire
|
# save filtered words list for the newswire
|
||||||
filterNewswireFilename = \
|
filterNewswireFilename = \
|
||||||
|
|
|
@ -496,5 +496,7 @@
|
||||||
"Reaction by": "رد فعل",
|
"Reaction by": "رد فعل",
|
||||||
"Notify on emoji reactions": "يخطر على ردود الفعل الرموز التعبيرية",
|
"Notify on emoji reactions": "يخطر على ردود الفعل الرموز التعبيرية",
|
||||||
"Select reaction": "حدد رد الفعل",
|
"Select reaction": "حدد رد الفعل",
|
||||||
"Don't show the Reaction button": "لا تظهر زر رد الفعل"
|
"Don't show the Reaction button": "لا تظهر زر رد الفعل",
|
||||||
|
"New feed URL": "موجز جديد URL",
|
||||||
|
"New link title and URL": "عنوان الارتباط الجديد وعنوان URL"
|
||||||
}
|
}
|
||||||
|
|
|
@ -496,5 +496,7 @@
|
||||||
"Reaction by": "Reacció de",
|
"Reaction by": "Reacció de",
|
||||||
"Notify on emoji reactions": "Notificar sobre les reaccions dels emojis",
|
"Notify on emoji reactions": "Notificar sobre les reaccions dels emojis",
|
||||||
"Select reaction": "Seleccioneu la reacció",
|
"Select reaction": "Seleccioneu la reacció",
|
||||||
"Don't show the Reaction button": "No mostris el botó de reacció"
|
"Don't show the Reaction button": "No mostris el botó de reacció",
|
||||||
|
"New feed URL": "URL de feed nou",
|
||||||
|
"New link title and URL": "Títol i URL de l'enllaç nous"
|
||||||
}
|
}
|
||||||
|
|
|
@ -496,5 +496,7 @@
|
||||||
"Reaction by": "Ymateb gan",
|
"Reaction by": "Ymateb gan",
|
||||||
"Notify on emoji reactions": "Hysbysu ar ymatebion emoji",
|
"Notify on emoji reactions": "Hysbysu ar ymatebion emoji",
|
||||||
"Select reaction": "Dewiswch adwaith",
|
"Select reaction": "Dewiswch adwaith",
|
||||||
"Don't show the Reaction button": "Peidiwch â dangos y botwm Adwaith"
|
"Don't show the Reaction button": "Peidiwch â dangos y botwm Adwaith",
|
||||||
|
"New feed URL": "URL porthiant newydd",
|
||||||
|
"New link title and URL": "Teitl dolen ac URL newydd"
|
||||||
}
|
}
|
||||||
|
|
|
@ -496,5 +496,7 @@
|
||||||
"Reaction by": "Reaktion von",
|
"Reaction by": "Reaktion von",
|
||||||
"Notify on emoji reactions": "Bei Emoji-Reaktionen benachrichtigen",
|
"Notify on emoji reactions": "Bei Emoji-Reaktionen benachrichtigen",
|
||||||
"Select reaction": "Reaktion auswählen",
|
"Select reaction": "Reaktion auswählen",
|
||||||
"Don't show the Reaction button": "Reaktionstaste nicht anzeigen"
|
"Don't show the Reaction button": "Reaktionstaste nicht anzeigen",
|
||||||
|
"New feed URL": "Neue Feed-URL",
|
||||||
|
"New link title and URL": "Neuer Linktitel und URL"
|
||||||
}
|
}
|
||||||
|
|
|
@ -496,5 +496,7 @@
|
||||||
"Reaction by": "Reaction by",
|
"Reaction by": "Reaction by",
|
||||||
"Notify on emoji reactions": "Notify on emoji reactions",
|
"Notify on emoji reactions": "Notify on emoji reactions",
|
||||||
"Select reaction": "Select reaction",
|
"Select reaction": "Select reaction",
|
||||||
"Don't show the Reaction button": "Don't show the Reaction button"
|
"Don't show the Reaction button": "Don't show the Reaction button",
|
||||||
|
"New feed URL": "New feed URL",
|
||||||
|
"New link title and URL": "New link title and URL"
|
||||||
}
|
}
|
||||||
|
|
|
@ -496,5 +496,7 @@
|
||||||
"Reaction by": "Reacción de",
|
"Reaction by": "Reacción de",
|
||||||
"Notify on emoji reactions": "Notificar sobre reacciones emoji",
|
"Notify on emoji reactions": "Notificar sobre reacciones emoji",
|
||||||
"Select reaction": "Seleccionar reacción",
|
"Select reaction": "Seleccionar reacción",
|
||||||
"Don't show the Reaction button": "No mostrar el botón de reacción"
|
"Don't show the Reaction button": "No mostrar el botón de reacción",
|
||||||
|
"New feed URL": "URL de nuevo feed",
|
||||||
|
"New link title and URL": "Nuevo título de enlace y URL"
|
||||||
}
|
}
|
||||||
|
|
|
@ -496,5 +496,7 @@
|
||||||
"Reaction by": "Réaction par",
|
"Reaction by": "Réaction par",
|
||||||
"Notify on emoji reactions": "Avertir sur les réactions emoji",
|
"Notify on emoji reactions": "Avertir sur les réactions emoji",
|
||||||
"Select reaction": "Sélectionnez la réaction",
|
"Select reaction": "Sélectionnez la réaction",
|
||||||
"Don't show the Reaction button": "Ne pas afficher le bouton Réaction"
|
"Don't show the Reaction button": "Ne pas afficher le bouton Réaction",
|
||||||
|
"New feed URL": "Nouvelle URL de flux",
|
||||||
|
"New link title and URL": "Nouveau titre et URL du lien"
|
||||||
}
|
}
|
||||||
|
|
|
@ -496,5 +496,7 @@
|
||||||
"Reaction by": "Imoibriú le",
|
"Reaction by": "Imoibriú le",
|
||||||
"Notify on emoji reactions": "Fógra a thabhairt faoi imoibrithe emoji",
|
"Notify on emoji reactions": "Fógra a thabhairt faoi imoibrithe emoji",
|
||||||
"Select reaction": "Roghnaigh imoibriú",
|
"Select reaction": "Roghnaigh imoibriú",
|
||||||
"Don't show the Reaction button": "Ná taispeáin an cnaipe Imoibriú"
|
"Don't show the Reaction button": "Ná taispeáin an cnaipe Imoibriú",
|
||||||
|
"New feed URL": "URL beathaithe nua",
|
||||||
|
"New link title and URL": "Teideal nasc nua agus URL"
|
||||||
}
|
}
|
||||||
|
|
|
@ -496,5 +496,7 @@
|
||||||
"Reaction by": "द्वारा प्रतिक्रिया",
|
"Reaction by": "द्वारा प्रतिक्रिया",
|
||||||
"Notify on emoji reactions": "इमोजी प्रतिक्रियाओं पर सूचित करें",
|
"Notify on emoji reactions": "इमोजी प्रतिक्रियाओं पर सूचित करें",
|
||||||
"Select reaction": "प्रतिक्रिया का चयन करें",
|
"Select reaction": "प्रतिक्रिया का चयन करें",
|
||||||
"Don't show the Reaction button": "प्रतिक्रिया बटन न दिखाएं"
|
"Don't show the Reaction button": "प्रतिक्रिया बटन न दिखाएं",
|
||||||
|
"New feed URL": "नया फ़ीड URL",
|
||||||
|
"New link title and URL": "नया लिंक शीर्षक और URL"
|
||||||
}
|
}
|
||||||
|
|
|
@ -496,5 +496,7 @@
|
||||||
"Reaction by": "Reazione di",
|
"Reaction by": "Reazione di",
|
||||||
"Notify on emoji reactions": "Notifica sulle reazioni emoji",
|
"Notify on emoji reactions": "Notifica sulle reazioni emoji",
|
||||||
"Select reaction": "Seleziona reazione",
|
"Select reaction": "Seleziona reazione",
|
||||||
"Don't show the Reaction button": "Non mostrare il pulsante Reazione"
|
"Don't show the Reaction button": "Non mostrare il pulsante Reazione",
|
||||||
|
"New feed URL": "Nuovo URL del feed",
|
||||||
|
"New link title and URL": "Nuovo titolo e URL del collegamento"
|
||||||
}
|
}
|
||||||
|
|
|
@ -496,5 +496,7 @@
|
||||||
"Reaction by": "による反応",
|
"Reaction by": "による反応",
|
||||||
"Notify on emoji reactions": "絵文字の反応を通知する",
|
"Notify on emoji reactions": "絵文字の反応を通知する",
|
||||||
"Select reaction": "反応を選択",
|
"Select reaction": "反応を選択",
|
||||||
"Don't show the Reaction button": "反応ボタンを表示しない"
|
"Don't show the Reaction button": "反応ボタンを表示しない",
|
||||||
|
"New feed URL": "新しいフィードURL",
|
||||||
|
"New link title and URL": "新しいリンクのタイトルとURL"
|
||||||
}
|
}
|
||||||
|
|
|
@ -496,5 +496,7 @@
|
||||||
"Reaction by": "Reaction by",
|
"Reaction by": "Reaction by",
|
||||||
"Notify on emoji reactions": "Li ser reaksiyonên emoji agahdar bikin",
|
"Notify on emoji reactions": "Li ser reaksiyonên emoji agahdar bikin",
|
||||||
"Select reaction": "Reaksiyonê hilbijêrin",
|
"Select reaction": "Reaksiyonê hilbijêrin",
|
||||||
"Don't show the Reaction button": "Bişkoka Reaksiyonê nîşan nede"
|
"Don't show the Reaction button": "Bişkoka Reaksiyonê nîşan nede",
|
||||||
|
"New feed URL": "URL-ya feed nû",
|
||||||
|
"New link title and URL": "Sernav û URL-ya girêdana nû"
|
||||||
}
|
}
|
||||||
|
|
|
@ -492,5 +492,7 @@
|
||||||
"Reaction by": "Reaction by",
|
"Reaction by": "Reaction by",
|
||||||
"Notify on emoji reactions": "Notify on emoji reactions",
|
"Notify on emoji reactions": "Notify on emoji reactions",
|
||||||
"Select reaction": "Select reaction",
|
"Select reaction": "Select reaction",
|
||||||
"Don't show the Reaction button": "Don't show the Reaction button"
|
"Don't show the Reaction button": "Don't show the Reaction button",
|
||||||
|
"New feed URL": "New feed URL",
|
||||||
|
"New link title and URL": "New link title and URL"
|
||||||
}
|
}
|
||||||
|
|
|
@ -496,5 +496,7 @@
|
||||||
"Reaction by": "Reazione di",
|
"Reaction by": "Reazione di",
|
||||||
"Notify on emoji reactions": "Notificar sobre reações de emoji",
|
"Notify on emoji reactions": "Notificar sobre reações de emoji",
|
||||||
"Select reaction": "Selecione a reação",
|
"Select reaction": "Selecione a reação",
|
||||||
"Don't show the Reaction button": "Não mostrar o botão de reação"
|
"Don't show the Reaction button": "Não mostrar o botão de reação",
|
||||||
|
"New feed URL": "Novo URL de feed",
|
||||||
|
"New link title and URL": "Novo título e URL do link"
|
||||||
}
|
}
|
||||||
|
|
|
@ -496,5 +496,7 @@
|
||||||
"Reaction by": "Реакция со стороны",
|
"Reaction by": "Реакция со стороны",
|
||||||
"Notify on emoji reactions": "Уведомлять о реакции на смайлики",
|
"Notify on emoji reactions": "Уведомлять о реакции на смайлики",
|
||||||
"Select reaction": "Выберите реакцию",
|
"Select reaction": "Выберите реакцию",
|
||||||
"Don't show the Reaction button": "Не показывать кнопку реакции"
|
"Don't show the Reaction button": "Не показывать кнопку реакции",
|
||||||
|
"New feed URL": "URL нового канала",
|
||||||
|
"New link title and URL": "Новое название ссылки и URL"
|
||||||
}
|
}
|
||||||
|
|
|
@ -496,5 +496,7 @@
|
||||||
"Reaction by": "Majibu kwa",
|
"Reaction by": "Majibu kwa",
|
||||||
"Notify on emoji reactions": "Arifu kuhusu maitikio ya emoji",
|
"Notify on emoji reactions": "Arifu kuhusu maitikio ya emoji",
|
||||||
"Select reaction": "Chagua majibu",
|
"Select reaction": "Chagua majibu",
|
||||||
"Don't show the Reaction button": "Usionyeshe kitufe cha Majibu"
|
"Don't show the Reaction button": "Usionyeshe kitufe cha Majibu",
|
||||||
|
"New feed URL": "URL mpya ya mipasho",
|
||||||
|
"New link title and URL": "Kichwa kipya cha kiungo na URL"
|
||||||
}
|
}
|
||||||
|
|
|
@ -496,5 +496,7 @@
|
||||||
"Reaction by": "反应由",
|
"Reaction by": "反应由",
|
||||||
"Notify on emoji reactions": "通知表情符号反应",
|
"Notify on emoji reactions": "通知表情符号反应",
|
||||||
"Select reaction": "选择反应",
|
"Select reaction": "选择反应",
|
||||||
"Don't show the Reaction button": "不显示“反应”按钮"
|
"Don't show the Reaction button": "不显示“反应”按钮",
|
||||||
|
"New feed URL": "新供稿网址",
|
||||||
|
"New link title and URL": "新链接标题和 URL"
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,7 @@ from webapp_utils import headerButtonsFrontScreen
|
||||||
from webapp_utils import htmlHeaderWithExternalStyle
|
from webapp_utils import htmlHeaderWithExternalStyle
|
||||||
from webapp_utils import htmlFooter
|
from webapp_utils import htmlFooter
|
||||||
from webapp_utils import getBannerFile
|
from webapp_utils import getBannerFile
|
||||||
|
from webapp_utils import editTextField
|
||||||
from shares import shareCategoryIcon
|
from shares import shareCategoryIcon
|
||||||
|
|
||||||
|
|
||||||
|
@ -474,6 +475,8 @@ def htmlEditLinks(cssCache: {}, translate: {}, baseDir: str, path: str,
|
||||||
' ' + \
|
' ' + \
|
||||||
translate['One link per line. Description followed by the link.'] + \
|
translate['One link per line. Description followed by the link.'] + \
|
||||||
'<br>'
|
'<br>'
|
||||||
|
newColLinkStr = translate['New link title and URL']
|
||||||
|
editLinksForm += editTextField(None, 'newColLink', '', newColLinkStr)
|
||||||
editLinksForm += \
|
editLinksForm += \
|
||||||
' <textarea id="message" name="editedLinks" ' + \
|
' <textarea id="message" name="editedLinks" ' + \
|
||||||
'style="height:80vh" spellcheck="false">' + linksStr + '</textarea>'
|
'style="height:80vh" spellcheck="false">' + linksStr + '</textarea>'
|
||||||
|
|
|
@ -28,6 +28,7 @@ from webapp_utils import htmlFooter
|
||||||
from webapp_utils import getBannerFile
|
from webapp_utils import getBannerFile
|
||||||
from webapp_utils import htmlPostSeparator
|
from webapp_utils import htmlPostSeparator
|
||||||
from webapp_utils import headerButtonsFrontScreen
|
from webapp_utils import headerButtonsFrontScreen
|
||||||
|
from webapp_utils import editTextField
|
||||||
|
|
||||||
|
|
||||||
def _votesIndicator(totalVotes: int, positiveVoting: bool) -> str:
|
def _votesIndicator(totalVotes: int, positiveVoting: bool) -> str:
|
||||||
|
@ -588,6 +589,8 @@ def htmlEditNewswire(cssCache: {}, translate: {}, baseDir: str, path: str,
|
||||||
' ' + \
|
' ' + \
|
||||||
translate['Add RSS feed links below.'] + \
|
translate['Add RSS feed links below.'] + \
|
||||||
'<br>'
|
'<br>'
|
||||||
|
newFeedStr = translate['New feed URL']
|
||||||
|
editNewswireForm += editTextField(None, 'newNewswireFeed', '', newFeedStr)
|
||||||
editNewswireForm += \
|
editNewswireForm += \
|
||||||
' <textarea id="message" name="editedNewswire" ' + \
|
' <textarea id="message" name="editedNewswire" ' + \
|
||||||
'style="height:80vh" spellcheck="false">' + \
|
'style="height:80vh" spellcheck="false">' + \
|
||||||
|
|
|
@ -1325,10 +1325,14 @@ def editTextField(label: str, name: str, value: str = "",
|
||||||
requiredStr = ''
|
requiredStr = ''
|
||||||
if required:
|
if required:
|
||||||
requiredStr = ' required'
|
requiredStr = ' required'
|
||||||
return \
|
textFieldStr = ''
|
||||||
'<label class="labels">' + label + '</label><br>\n' + \
|
if label:
|
||||||
|
textFieldStr = \
|
||||||
|
'<label class="labels">' + label + '</label><br>\n'
|
||||||
|
textFieldStr += \
|
||||||
' <input type="text" name="' + name + '" value="' + \
|
' <input type="text" name="' + name + '" value="' + \
|
||||||
value + '"' + placeholderStr + requiredStr + '>\n'
|
value + '"' + placeholderStr + requiredStr + '>\n'
|
||||||
|
return textFieldStr
|
||||||
|
|
||||||
|
|
||||||
def editNumberField(label: str, name: str, value: int,
|
def editNumberField(label: str, name: str, value: int,
|
||||||
|
|
Loading…
Reference in New Issue