forked from indymedia/epicyon
Option to show icons as buttons
parent
6d8f36ca82
commit
8934a25123
39
daemon.py
39
daemon.py
|
@ -6462,7 +6462,8 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
self.server.newswire,
|
||||
self.server.positiveVoting,
|
||||
self.server.showPublishAsIcon,
|
||||
fullWidthTimelineButtonHeader)
|
||||
fullWidthTimelineButtonHeader,
|
||||
self.server.iconsAsButtons)
|
||||
if GETstartTime:
|
||||
self._benchmarkGETtimings(GETstartTime, GETtimings,
|
||||
'show status done',
|
||||
|
@ -6580,7 +6581,8 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
self.server.newswire,
|
||||
self.server.positiveVoting,
|
||||
self.server.showPublishAsIcon,
|
||||
fullWidthTimelineButtonHeader)
|
||||
fullWidthTimelineButtonHeader,
|
||||
self.server.iconsAsButtons)
|
||||
msg = msg.encode('utf-8')
|
||||
self._set_headers('text/html', len(msg),
|
||||
cookie, callingDomain)
|
||||
|
@ -6691,7 +6693,8 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
self.server.newswire,
|
||||
self.server.positiveVoting,
|
||||
self.server.showPublishAsIcon,
|
||||
fullWidthTimelineButtonHeader)
|
||||
fullWidthTimelineButtonHeader,
|
||||
self.server.iconsAsButtons)
|
||||
msg = msg.encode('utf-8')
|
||||
self._set_headers('text/html', len(msg),
|
||||
cookie, callingDomain)
|
||||
|
@ -6802,7 +6805,8 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
self.server.newswire,
|
||||
self.server.positiveVoting,
|
||||
self.server.showPublishAsIcon,
|
||||
fullWidthTimelineButtonHeader)
|
||||
fullWidthTimelineButtonHeader,
|
||||
self.server.iconsAsButtons)
|
||||
msg = msg.encode('utf-8')
|
||||
self._set_headers('text/html', len(msg),
|
||||
cookie, callingDomain)
|
||||
|
@ -6913,7 +6917,8 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
self.server.newswire,
|
||||
self.server.positiveVoting,
|
||||
self.server.showPublishAsIcon,
|
||||
fullWidthTimelineButtonHeader)
|
||||
fullWidthTimelineButtonHeader,
|
||||
self.server.iconsAsButtons)
|
||||
msg = msg.encode('utf-8')
|
||||
self._set_headers('text/html', len(msg),
|
||||
cookie, callingDomain)
|
||||
|
@ -7033,7 +7038,8 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
moderator, editor,
|
||||
self.server.positiveVoting,
|
||||
self.server.showPublishAsIcon,
|
||||
fullWidthTimelineButtonHeader)
|
||||
fullWidthTimelineButtonHeader,
|
||||
self.server.iconsAsButtons)
|
||||
msg = msg.encode('utf-8')
|
||||
self._set_headers('text/html', len(msg),
|
||||
cookie, callingDomain)
|
||||
|
@ -7112,7 +7118,8 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
self.server.newswire,
|
||||
self.server.positiveVoting,
|
||||
self.server.showPublishAsIcon,
|
||||
self.server.fullWidthTimelineButtonHeader)
|
||||
self.server.fullWidthTimelineButtonHeader,
|
||||
self.server.iconsAsButtons)
|
||||
msg = msg.encode('utf-8')
|
||||
self._set_headers('text/html', len(msg),
|
||||
cookie, callingDomain)
|
||||
|
@ -7207,7 +7214,8 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
self.server.newswire,
|
||||
self.server.positiveVoting,
|
||||
self.server.showPublishAsIcon,
|
||||
fullWidthTimelineButtonHeader)
|
||||
fullWidthTimelineButtonHeader,
|
||||
self.server.iconsAsButtons)
|
||||
msg = msg.encode('utf-8')
|
||||
self._set_headers('text/html', len(msg),
|
||||
cookie, callingDomain)
|
||||
|
@ -7321,7 +7329,8 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
self.server.newswire,
|
||||
self.server.positiveVoting,
|
||||
self.server.showPublishAsIcon,
|
||||
fullWidthTimelineButtonHeader)
|
||||
fullWidthTimelineButtonHeader,
|
||||
self.server.iconsAsButtons)
|
||||
msg = msg.encode('utf-8')
|
||||
self._set_headers('text/html', len(msg),
|
||||
cookie, callingDomain)
|
||||
|
@ -7427,7 +7436,8 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
self.server.newswire,
|
||||
self.server.positiveVoting,
|
||||
self.server.showPublishAsIcon,
|
||||
fullWidthTimelineButtonHeader)
|
||||
fullWidthTimelineButtonHeader,
|
||||
self.server.iconsAsButtons)
|
||||
msg = msg.encode('utf-8')
|
||||
self._set_headers('text/html', len(msg),
|
||||
cookie, callingDomain)
|
||||
|
@ -7523,7 +7533,8 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
self.server.newswire,
|
||||
self.server.positiveVoting,
|
||||
self.server.showPublishAsIcon,
|
||||
fullWidthTimelineButtonHeader)
|
||||
fullWidthTimelineButtonHeader,
|
||||
self.server.iconsAsButtons)
|
||||
msg = msg.encode('utf-8')
|
||||
self._set_headers('text/html', len(msg),
|
||||
cookie, callingDomain)
|
||||
|
@ -12039,7 +12050,8 @@ def loadTokens(baseDir: str, tokensDict: {}, tokensLookup: {}) -> None:
|
|||
tokensLookup[token] = nickname
|
||||
|
||||
|
||||
def runDaemon(fullWidthTimelineButtonHeader: bool,
|
||||
def runDaemon(iconsAsButtons: bool,
|
||||
fullWidthTimelineButtonHeader: bool,
|
||||
showPublishAsIcon: bool,
|
||||
maxFollowers: int,
|
||||
allowNewsFollowers: bool,
|
||||
|
@ -12204,6 +12216,9 @@ def runDaemon(fullWidthTimelineButtonHeader: bool,
|
|||
# calendar, etc as the full width of the screen or not
|
||||
httpd.fullWidthTimelineButtonHeader = fullWidthTimelineButtonHeader
|
||||
|
||||
# whether to show icons in the header (eg calendar) as buttons
|
||||
httpd.iconsAsButtons = iconsAsButtons
|
||||
|
||||
if registration == 'open':
|
||||
httpd.registration = True
|
||||
else:
|
||||
|
|
13
epicyon.py
13
epicyon.py
|
@ -227,6 +227,11 @@ parser.add_argument("--allowNewsFollowers",
|
|||
type=str2bool, nargs='?',
|
||||
const=True, default=False,
|
||||
help="Whether to allow the news account to be followed")
|
||||
parser.add_argument("--iconsAsButtons",
|
||||
dest='iconsAsButtons',
|
||||
type=str2bool, nargs='?',
|
||||
const=True, default=False,
|
||||
help="Show header icons as buttons")
|
||||
parser.add_argument("--noapproval", type=str2bool, nargs='?',
|
||||
const=True, default=False,
|
||||
help="Allow followers without approval")
|
||||
|
@ -2003,6 +2008,11 @@ showPublishAsIcon = \
|
|||
if showPublishAsIcon is not None:
|
||||
args.showPublishAsIcon = bool(showPublishAsIcon)
|
||||
|
||||
iconsAsButtons = \
|
||||
getConfigParam(baseDir, 'iconsAsButtons')
|
||||
if iconsAsButtons is not None:
|
||||
args.iconsAsButtons = bool(iconsAsButtons)
|
||||
|
||||
fullWidthTimelineButtonHeader = \
|
||||
getConfigParam(baseDir, 'fullWidthTimelineButtonHeader')
|
||||
if fullWidthTimelineButtonHeader is not None:
|
||||
|
@ -2021,7 +2031,8 @@ if setTheme(baseDir, themeName, domain):
|
|||
print('Theme set to ' + themeName)
|
||||
|
||||
if __name__ == "__main__":
|
||||
runDaemon(args.fullWidthTimelineButtonHeader,
|
||||
runDaemon(args.iconsAsButtons,
|
||||
args.fullWidthTimelineButtonHeader,
|
||||
args.showPublishAsIcon,
|
||||
args.maxFollowers,
|
||||
args.allowNewsFollowers,
|
||||
|
|
6
tests.py
6
tests.py
|
@ -291,7 +291,7 @@ def createServerAlice(path: str, domain: str, port: int,
|
|||
onionDomain = None
|
||||
i2pDomain = None
|
||||
print('Server running: Alice')
|
||||
runDaemon(False, True, 10, False, 0, 100, 1024, 5, False,
|
||||
runDaemon(False, False, True, 10, False, 0, 100, 1024, 5, False,
|
||||
0, False, 1, False, False, False,
|
||||
5, True, True, 'en', __version__,
|
||||
"instanceId", False, path, domain,
|
||||
|
@ -355,7 +355,7 @@ def createServerBob(path: str, domain: str, port: int,
|
|||
onionDomain = None
|
||||
i2pDomain = None
|
||||
print('Server running: Bob')
|
||||
runDaemon(False, True, 10, False, 0, 100, 1024, 5, False, 0,
|
||||
runDaemon(False, False, True, 10, False, 0, 100, 1024, 5, False, 0,
|
||||
False, 1, False, False, False,
|
||||
5, True, True, 'en', __version__,
|
||||
"instanceId", False, path, domain,
|
||||
|
@ -393,7 +393,7 @@ def createServerEve(path: str, domain: str, port: int, federationList: [],
|
|||
onionDomain = None
|
||||
i2pDomain = None
|
||||
print('Server running: Eve')
|
||||
runDaemon(False, True, 10, False, 0, 100, 1024, 5, False, 0,
|
||||
runDaemon(False, False, True, 10, False, 0, 100, 1024, 5, False, 0,
|
||||
False, 1, False, False, False,
|
||||
5, True, True, 'en', __version__,
|
||||
"instanceId", False, path, domain,
|
||||
|
|
28
theme.py
28
theme.py
|
@ -54,6 +54,20 @@ def setNewswirePublishAsIcon(baseDir: str, useIcon: bool) -> bool:
|
|||
return saveJson(configJson, configFilename)
|
||||
|
||||
|
||||
def setIconsAsButtons(baseDir: str, useButtons: bool) -> bool:
|
||||
"""Whether to show icons in the header (inbox, outbox, etc)
|
||||
as buttons
|
||||
"""
|
||||
configFilename = baseDir + '/config.json'
|
||||
if not os.path.isfile(configFilename):
|
||||
return False
|
||||
configJson = loadJson(configFilename, 0)
|
||||
if not configJson:
|
||||
return False
|
||||
configJson['iconsAsButtons'] = useButtons
|
||||
return saveJson(configJson, configFilename)
|
||||
|
||||
|
||||
def setFullWidthTimelineButtonHeader(baseDir: str, fullWidth: bool) -> bool:
|
||||
"""Shows the timeline button header containing inbox, outbox,
|
||||
calendar, etc as full width
|
||||
|
@ -261,6 +275,7 @@ def setThemeDefault(baseDir: str):
|
|||
setThemeInConfig(baseDir, name)
|
||||
setNewswirePublishAsIcon(baseDir, True)
|
||||
setFullWidthTimelineButtonHeader(baseDir, False)
|
||||
setIconsAsButtons(baseDir, False)
|
||||
bgParams = {
|
||||
"login": "jpg",
|
||||
"follow": "jpg",
|
||||
|
@ -279,6 +294,7 @@ def setThemeIndymediaClassic(baseDir: str):
|
|||
setThemeInConfig(baseDir, name)
|
||||
setNewswirePublishAsIcon(baseDir, False)
|
||||
setFullWidthTimelineButtonHeader(baseDir, True)
|
||||
setIconsAsButtons(baseDir, False)
|
||||
bgParams = {
|
||||
"login": "jpg",
|
||||
"follow": "jpg",
|
||||
|
@ -360,6 +376,7 @@ def setThemeBlue(baseDir: str):
|
|||
setThemeInConfig(baseDir, name)
|
||||
setNewswirePublishAsIcon(baseDir, True)
|
||||
setFullWidthTimelineButtonHeader(baseDir, False)
|
||||
setIconsAsButtons(baseDir, False)
|
||||
themeParams = {
|
||||
"newswire-date-color": "blue",
|
||||
"font-size-header": "22px",
|
||||
|
@ -399,6 +416,7 @@ def setThemeNight(baseDir: str):
|
|||
setThemeInConfig(baseDir, name)
|
||||
setNewswirePublishAsIcon(baseDir, True)
|
||||
setFullWidthTimelineButtonHeader(baseDir, False)
|
||||
setIconsAsButtons(baseDir, False)
|
||||
fontStr = \
|
||||
"url('./fonts/solidaric.woff2') format('woff2')"
|
||||
fontStrItalic = \
|
||||
|
@ -459,6 +477,7 @@ def setThemeStarlight(baseDir: str):
|
|||
setThemeInConfig(baseDir, name)
|
||||
setNewswirePublishAsIcon(baseDir, True)
|
||||
setFullWidthTimelineButtonHeader(baseDir, False)
|
||||
setIconsAsButtons(baseDir, False)
|
||||
themeParams = {
|
||||
"column-left-image-width-mobile": "40vw",
|
||||
"line-spacing-newswire": "120%",
|
||||
|
@ -528,6 +547,7 @@ def setThemeHenge(baseDir: str):
|
|||
setThemeInConfig(baseDir, name)
|
||||
setNewswirePublishAsIcon(baseDir, True)
|
||||
setFullWidthTimelineButtonHeader(baseDir, False)
|
||||
setIconsAsButtons(baseDir, False)
|
||||
themeParams = {
|
||||
"column-left-image-width-mobile": "40vw",
|
||||
"column-right-image-width-mobile": "40vw",
|
||||
|
@ -592,6 +612,7 @@ def setThemeZen(baseDir: str):
|
|||
setThemeInConfig(baseDir, name)
|
||||
setNewswirePublishAsIcon(baseDir, True)
|
||||
setFullWidthTimelineButtonHeader(baseDir, False)
|
||||
setIconsAsButtons(baseDir, False)
|
||||
themeParams = {
|
||||
"main-bg-color": "#5c4e41",
|
||||
"column-left-color": "#5c4e41",
|
||||
|
@ -652,6 +673,7 @@ def setThemeHighVis(baseDir: str):
|
|||
setThemeFromDict(baseDir, name, themeParams, bgParams)
|
||||
setNewswirePublishAsIcon(baseDir, True)
|
||||
setFullWidthTimelineButtonHeader(baseDir, False)
|
||||
setIconsAsButtons(baseDir, False)
|
||||
|
||||
|
||||
def setThemeLCD(baseDir: str):
|
||||
|
@ -732,6 +754,7 @@ def setThemeLCD(baseDir: str):
|
|||
setThemeFromDict(baseDir, name, themeParams, bgParams)
|
||||
setNewswirePublishAsIcon(baseDir, True)
|
||||
setFullWidthTimelineButtonHeader(baseDir, False)
|
||||
setIconsAsButtons(baseDir, False)
|
||||
|
||||
|
||||
def setThemePurple(baseDir: str):
|
||||
|
@ -795,6 +818,7 @@ def setThemePurple(baseDir: str):
|
|||
setThemeFromDict(baseDir, name, themeParams, bgParams)
|
||||
setNewswirePublishAsIcon(baseDir, True)
|
||||
setFullWidthTimelineButtonHeader(baseDir, False)
|
||||
setIconsAsButtons(baseDir, False)
|
||||
|
||||
|
||||
def setThemeHacker(baseDir: str):
|
||||
|
@ -855,6 +879,7 @@ def setThemeHacker(baseDir: str):
|
|||
setThemeFromDict(baseDir, name, themeParams, bgParams)
|
||||
setNewswirePublishAsIcon(baseDir, True)
|
||||
setFullWidthTimelineButtonHeader(baseDir, False)
|
||||
setIconsAsButtons(baseDir, False)
|
||||
|
||||
|
||||
def setThemeLight(baseDir: str):
|
||||
|
@ -916,6 +941,7 @@ def setThemeLight(baseDir: str):
|
|||
setThemeFromDict(baseDir, name, themeParams, bgParams)
|
||||
setNewswirePublishAsIcon(baseDir, True)
|
||||
setFullWidthTimelineButtonHeader(baseDir, False)
|
||||
setIconsAsButtons(baseDir, False)
|
||||
|
||||
|
||||
def setThemeIndymediaModern(baseDir: str):
|
||||
|
@ -1002,6 +1028,7 @@ def setThemeIndymediaModern(baseDir: str):
|
|||
setThemeFromDict(baseDir, name, themeParams, bgParams)
|
||||
setNewswirePublishAsIcon(baseDir, False)
|
||||
setFullWidthTimelineButtonHeader(baseDir, True)
|
||||
setIconsAsButtons(baseDir, True)
|
||||
|
||||
|
||||
def setThemeSolidaric(baseDir: str):
|
||||
|
@ -1069,6 +1096,7 @@ def setThemeSolidaric(baseDir: str):
|
|||
setThemeFromDict(baseDir, name, themeParams, bgParams)
|
||||
setNewswirePublishAsIcon(baseDir, True)
|
||||
setFullWidthTimelineButtonHeader(baseDir, False)
|
||||
setIconsAsButtons(baseDir, False)
|
||||
|
||||
|
||||
def setThemeImages(baseDir: str, name: str) -> None:
|
||||
|
|
|
@ -315,5 +315,9 @@
|
|||
"Publish": "ينشر",
|
||||
"Publish a news article": "انشر مقالة إخبارية",
|
||||
"News tagging rules": "قواعد وسم الأخبار",
|
||||
"See instructions": "انظر التعليمات"
|
||||
"See instructions": "انظر التعليمات",
|
||||
"Search": "بحث",
|
||||
"Expand": "وسعت",
|
||||
"Newswire": "نيوزواير",
|
||||
"Links": "الروابط"
|
||||
}
|
||||
|
|
|
@ -315,5 +315,9 @@
|
|||
"Publish": "Publica",
|
||||
"Publish a news article": "Publicar un article de notícies",
|
||||
"News tagging rules": "Regles d'etiquetatge de notícies",
|
||||
"See instructions": "Consulteu les instruccions"
|
||||
"See instructions": "Consulteu les instruccions",
|
||||
"Search": "Cerca",
|
||||
"Expand": "Amplia",
|
||||
"Newswire": "Newswire",
|
||||
"Links": "Enllaços"
|
||||
}
|
||||
|
|
|
@ -315,5 +315,9 @@
|
|||
"Publish": "Cyhoeddi",
|
||||
"Publish a news article": "Cyhoeddi erthygl newyddion",
|
||||
"News tagging rules": "Rheolau tagio newyddion",
|
||||
"See instructions": "Gweler y cyfarwyddiadau"
|
||||
"See instructions": "Gweler y cyfarwyddiadau",
|
||||
"Search": "Chwilio",
|
||||
"Expand": "Ehangu",
|
||||
"Newswire": "Newswire",
|
||||
"Links": "Dolenni"
|
||||
}
|
||||
|
|
|
@ -315,5 +315,9 @@
|
|||
"Publish": "Veröffentlichen",
|
||||
"Publish a news article": "Veröffentlichen Sie einen Nachrichtenartikel",
|
||||
"News tagging rules": "Regeln für das Markieren von Nachrichten",
|
||||
"See instructions": "Siehe Anweisungen"
|
||||
"See instructions": "Siehe Anweisungen",
|
||||
"Search": "Suche",
|
||||
"Expand": "Erweitern",
|
||||
"Newswire": "Newswire",
|
||||
"Links": "Links"
|
||||
}
|
||||
|
|
|
@ -315,5 +315,9 @@
|
|||
"Publish": "Publish",
|
||||
"Publish a news article": "Publish a news article",
|
||||
"News tagging rules": "News tagging rules",
|
||||
"See instructions": "See instructions"
|
||||
"See instructions": "See instructions",
|
||||
"Search": "Search",
|
||||
"Expand": "Expand",
|
||||
"Newswire": "Newswire",
|
||||
"Links": "Links"
|
||||
}
|
||||
|
|
|
@ -315,5 +315,9 @@
|
|||
"Publish": "Publicar",
|
||||
"Publish a news article": "Publica un artículo de noticias",
|
||||
"News tagging rules": "Reglas de etiquetado de noticias",
|
||||
"See instructions": "Vea las instrucciones"
|
||||
"See instructions": "Vea las instrucciones",
|
||||
"Search": "Buscar",
|
||||
"Expand": "Expandir",
|
||||
"Newswire": "Newswire",
|
||||
"Links": "Enlaces"
|
||||
}
|
||||
|
|
|
@ -315,5 +315,9 @@
|
|||
"Publish": "Publier",
|
||||
"Publish a news article": "Publier un article de presse",
|
||||
"News tagging rules": "Règles de marquage des actualités",
|
||||
"See instructions": "Voir les instructions"
|
||||
"See instructions": "Voir les instructions",
|
||||
"Search": "Chercher",
|
||||
"Expand": "Développer",
|
||||
"Newswire": "Newswire",
|
||||
"Links": "Liens"
|
||||
}
|
||||
|
|
|
@ -315,5 +315,9 @@
|
|||
"Publish": "Fhoilsiú",
|
||||
"Publish a news article": "Foilsigh alt nuachta",
|
||||
"News tagging rules": "Rialacha clibeála nuachta",
|
||||
"See instructions": "Féach na treoracha"
|
||||
"See instructions": "Féach na treoracha",
|
||||
"Search": "Cuardaigh",
|
||||
"Expand": "Leathnaigh",
|
||||
"Newswire": "Newswire",
|
||||
"Links": "Naisc"
|
||||
}
|
||||
|
|
|
@ -315,5 +315,9 @@
|
|||
"Publish": "प्रकाशित करना",
|
||||
"Publish a news article": "एक समाचार लेख प्रकाशित करें",
|
||||
"News tagging rules": "समाचार टैगिंग नियम",
|
||||
"See instructions": "निर्देश देखें"
|
||||
"See instructions": "निर्देश देखें",
|
||||
"Search": "खोज",
|
||||
"Expand": "विस्तार",
|
||||
"Newswire": "न्यूज़वायर",
|
||||
"Links": "लिंक"
|
||||
}
|
||||
|
|
|
@ -315,5 +315,9 @@
|
|||
"Publish": "Pubblicare",
|
||||
"Publish a news article": "Pubblica un articolo di notizie",
|
||||
"News tagging rules": "Regole di tagging delle notizie",
|
||||
"See instructions": "Vedere le istruzioni"
|
||||
"See instructions": "Vedere le istruzioni",
|
||||
"Search": "Ricerca",
|
||||
"Expand": "Espandere",
|
||||
"Newswire": "Newswire",
|
||||
"Links": "Collegamenti"
|
||||
}
|
||||
|
|
|
@ -315,5 +315,9 @@
|
|||
"Publish": "公開する",
|
||||
"Publish a news article": "ニュース記事を公開する",
|
||||
"News tagging rules": "ニュースのタグ付けルール",
|
||||
"See instructions": "手順を参照してください"
|
||||
"See instructions": "手順を参照してください",
|
||||
"Search": "探す",
|
||||
"Expand": "展開",
|
||||
"Newswire": "Newswire",
|
||||
"Links": "リンク"
|
||||
}
|
||||
|
|
|
@ -311,5 +311,9 @@
|
|||
"Publish": "Publish",
|
||||
"Publish a news article": "Publish a news article",
|
||||
"News tagging rules": "News tagging rules",
|
||||
"See instructions": "See instructions"
|
||||
"See instructions": "See instructions",
|
||||
"Search": "Search",
|
||||
"Expand": "Expand",
|
||||
"Newswire": "Newswire",
|
||||
"Links": "Links"
|
||||
}
|
||||
|
|
|
@ -315,5 +315,9 @@
|
|||
"Publish": "Publicar",
|
||||
"Publish a news article": "Publique um artigo de notícias",
|
||||
"News tagging rules": "Regras de marcação de notícias",
|
||||
"See instructions": "Veja as instruções"
|
||||
"See instructions": "Veja as instruções",
|
||||
"Search": "Pesquisa",
|
||||
"Expand": "Expandir",
|
||||
"Newswire": "Newswire",
|
||||
"Links": "Links"
|
||||
}
|
||||
|
|
|
@ -315,5 +315,9 @@
|
|||
"Publish": "Публиковать",
|
||||
"Publish a news article": "Опубликовать новостную статью",
|
||||
"News tagging rules": "Правила тегирования новостей",
|
||||
"See instructions": "См. Инструкции"
|
||||
"See instructions": "См. Инструкции",
|
||||
"Search": "Поиск",
|
||||
"Expand": "Развернуть",
|
||||
"Newswire": "Лента новостей",
|
||||
"Links": "Ссылки"
|
||||
}
|
||||
|
|
|
@ -315,5 +315,9 @@
|
|||
"Publish": "发布",
|
||||
"Publish a news article": "发布新闻文章",
|
||||
"News tagging rules": "新闻标记规则",
|
||||
"See instructions": "见说明"
|
||||
"See instructions": "见说明",
|
||||
"Search": "搜索",
|
||||
"Expand": "扩大",
|
||||
"Newswire": "新闻专线",
|
||||
"Links": "链接"
|
||||
}
|
||||
|
|
180
webinterface.py
180
webinterface.py
|
@ -5944,7 +5944,8 @@ def getTimelineButtonHeader(defaultTimeline: str,
|
|||
newCalendarEvent: bool,
|
||||
calendarPath: str,
|
||||
calendarImage: str,
|
||||
followApprovals: str) -> str:
|
||||
followApprovals: str,
|
||||
iconsAsButtons: bool) -> str:
|
||||
"""Returns the header at the top of the timeline, containing
|
||||
buttons for inbox, outbox, search, calendar, etc
|
||||
"""
|
||||
|
@ -6073,13 +6074,20 @@ def getTimelineButtonHeader(defaultTimeline: str,
|
|||
'/calendar"><button class="buttonevent">' + \
|
||||
translate['Happening This Week'] + '</button></a>\n'
|
||||
|
||||
# the search button
|
||||
tlStr += \
|
||||
' <a class="imageAnchor" href="' + usersPath + \
|
||||
'/search"><img loading="lazy" src="/' + \
|
||||
iconsDir + '/search.png" title="' + \
|
||||
translate['Search and follow'] + '" alt="| ' + \
|
||||
translate['Search and follow'] + '" class="timelineicon"/></a>\n'
|
||||
if not iconsAsButtons:
|
||||
# the search button
|
||||
tlStr += \
|
||||
' <a class="imageAnchor" href="' + usersPath + \
|
||||
'/search"><img loading="lazy" src="/' + \
|
||||
iconsDir + '/search.png" title="' + \
|
||||
translate['Search and follow'] + '" alt="| ' + \
|
||||
translate['Search and follow'] + '" class="timelineicon"/></a>\n'
|
||||
else:
|
||||
tlStr += \
|
||||
' <a href="' + usersPath + \
|
||||
'/search"><button class="button">' + \
|
||||
'<span>' + translate['Search'] + \
|
||||
'</span></button></a>\n'
|
||||
|
||||
# benchmark 5
|
||||
timeDiff = int((time.time() - timelineStartTime) * 1000)
|
||||
|
@ -6091,37 +6099,68 @@ def getTimelineButtonHeader(defaultTimeline: str,
|
|||
if newCalendarEvent:
|
||||
# indicate that the calendar icon is highlighted
|
||||
calendarAltText = '*' + calendarAltText + '*'
|
||||
tlStr += \
|
||||
' <a class="imageAnchor" href="' + usersPath + calendarPath + \
|
||||
'"><img loading="lazy" src="/' + iconsDir + '/' + \
|
||||
calendarImage + '" title="' + translate['Calendar'] + \
|
||||
'" alt="| ' + calendarAltText + '" class="timelineicon"/></a>\n'
|
||||
if not iconsAsButtons:
|
||||
tlStr += \
|
||||
' <a class="imageAnchor" href="' + \
|
||||
usersPath + calendarPath + \
|
||||
'"><img loading="lazy" src="/' + iconsDir + '/' + \
|
||||
calendarImage + '" title="' + translate['Calendar'] + \
|
||||
'" alt="| ' + calendarAltText + \
|
||||
'" class="timelineicon"/></a>\n'
|
||||
else:
|
||||
tlStr += \
|
||||
' <a href="' + usersPath + calendarPath + \
|
||||
'"><button class="button">' + \
|
||||
'<span>' + translate['Calendar'] + \
|
||||
'</span></button></a>\n'
|
||||
|
||||
# the show/hide button, for a simpler header appearance
|
||||
tlStr += \
|
||||
' <a class="imageAnchor" href="' + usersPath + '/minimal' + \
|
||||
'"><img loading="lazy" src="/' + iconsDir + \
|
||||
'/showhide.png" title="' + translate['Show/Hide Buttons'] + \
|
||||
'" alt="| ' + translate['Show/Hide Buttons'] + \
|
||||
'" class="timelineicon"/></a>\n'
|
||||
if not iconsAsButtons:
|
||||
tlStr += \
|
||||
' <a class="imageAnchor" href="' + \
|
||||
usersPath + '/minimal' + \
|
||||
'"><img loading="lazy" src="/' + iconsDir + \
|
||||
'/showhide.png" title="' + translate['Show/Hide Buttons'] + \
|
||||
'" alt="| ' + translate['Show/Hide Buttons'] + \
|
||||
'" class="timelineicon"/></a>\n'
|
||||
else:
|
||||
tlStr += \
|
||||
' <a href="' + usersPath + '/minimal' + \
|
||||
'"><button class="button">' + \
|
||||
'<span>' + translate['Expand'] + \
|
||||
'</span></button></a>\n'
|
||||
|
||||
# the newswire button to show right column links
|
||||
tlStr += \
|
||||
' <a class="imageAnchorMobile" href="' + \
|
||||
usersPath + '/newswiremobile">' + \
|
||||
'<img loading="lazy" src="/' + iconsDir + \
|
||||
'/newswire.png" title="' + translate['News'] + \
|
||||
'" alt="| ' + translate['News'] + \
|
||||
'" class="timelineicon"/></a>\n'
|
||||
if not iconsAsButtons:
|
||||
tlStr += \
|
||||
' <a class="imageAnchorMobile" href="' + \
|
||||
usersPath + '/newswiremobile">' + \
|
||||
'<img loading="lazy" src="/' + iconsDir + \
|
||||
'/newswire.png" title="' + translate['News'] + \
|
||||
'" alt="| ' + translate['News'] + \
|
||||
'" class="timelineicon"/></a>\n'
|
||||
else:
|
||||
tlStr += \
|
||||
' <a href="' + usersPath + '/newswiremobile' + \
|
||||
'"><button class="button">' + \
|
||||
'<span>' + translate['Newswire'] + \
|
||||
'</span></button></a>\n'
|
||||
|
||||
# the links button to show left column links
|
||||
tlStr += \
|
||||
' <a class="imageAnchorMobile" href="' + \
|
||||
usersPath + '/linksmobile">' + \
|
||||
'<img loading="lazy" src="/' + iconsDir + \
|
||||
'/links.png" title="' + translate['Edit Links'] + \
|
||||
'" alt="| ' + translate['Edit Links'] + \
|
||||
'" class="timelineicon"/></a>\n'
|
||||
if not iconsAsButtons:
|
||||
tlStr += \
|
||||
' <a class="imageAnchorMobile" href="' + \
|
||||
usersPath + '/linksmobile">' + \
|
||||
'<img loading="lazy" src="/' + iconsDir + \
|
||||
'/links.png" title="' + translate['Edit Links'] + \
|
||||
'" alt="| ' + translate['Edit Links'] + \
|
||||
'" class="timelineicon"/></a>\n'
|
||||
else:
|
||||
tlStr += \
|
||||
' <a href="' + usersPath + '/linksmobile' + \
|
||||
'"><button class="button">' + \
|
||||
'<span>' + translate['Links'] + \
|
||||
'</span></button></a>\n'
|
||||
|
||||
tlStr += followApprovals
|
||||
# end of the button header with inbox, outbox, etc
|
||||
|
@ -6145,7 +6184,8 @@ def htmlTimeline(defaultTimeline: str,
|
|||
editor: bool,
|
||||
positiveVoting: bool,
|
||||
showPublishAsIcon: bool,
|
||||
fullWidthTimelineButtonHeader: bool) -> str:
|
||||
fullWidthTimelineButtonHeader: bool,
|
||||
iconsAsButtons: bool) -> str:
|
||||
"""Show the timeline as html
|
||||
"""
|
||||
timelineStartTime = time.time()
|
||||
|
@ -6430,7 +6470,8 @@ def htmlTimeline(defaultTimeline: str,
|
|||
newPostButtonStr, baseDir, nickname,
|
||||
domain, iconsDir, timelineStartTime,
|
||||
newCalendarEvent, calendarPath,
|
||||
calendarImage, followApprovals)
|
||||
calendarImage, followApprovals,
|
||||
iconsAsButtons)
|
||||
|
||||
# start the timeline
|
||||
tlStr += '<table class="timeline">\n'
|
||||
|
@ -6469,7 +6510,8 @@ def htmlTimeline(defaultTimeline: str,
|
|||
newPostButtonStr, baseDir, nickname,
|
||||
domain, iconsDir, timelineStartTime,
|
||||
newCalendarEvent, calendarPath,
|
||||
calendarImage, followApprovals)
|
||||
calendarImage, followApprovals,
|
||||
iconsAsButtons)
|
||||
|
||||
# second row of buttons for moderator actions
|
||||
if moderator and boxName == 'moderation':
|
||||
|
@ -6682,7 +6724,8 @@ def htmlShares(defaultTimeline: str,
|
|||
showPublishedDateOnly: bool,
|
||||
newswire: {}, positiveVoting: bool,
|
||||
showPublishAsIcon: bool,
|
||||
fullWidthTimelineButtonHeader: bool) -> str:
|
||||
fullWidthTimelineButtonHeader: bool,
|
||||
iconsAsButtons: bool) -> str:
|
||||
"""Show the shares timeline as html
|
||||
"""
|
||||
manuallyApproveFollowers = \
|
||||
|
@ -6698,7 +6741,8 @@ def htmlShares(defaultTimeline: str,
|
|||
showPublishedDateOnly,
|
||||
newswire, False, False,
|
||||
positiveVoting, showPublishAsIcon,
|
||||
fullWidthTimelineButtonHeader)
|
||||
fullWidthTimelineButtonHeader,
|
||||
iconsAsButtons)
|
||||
|
||||
|
||||
def htmlInbox(defaultTimeline: str,
|
||||
|
@ -6712,7 +6756,8 @@ def htmlInbox(defaultTimeline: str,
|
|||
showPublishedDateOnly: bool,
|
||||
newswire: {}, positiveVoting: bool,
|
||||
showPublishAsIcon: bool,
|
||||
fullWidthTimelineButtonHeader: bool) -> str:
|
||||
fullWidthTimelineButtonHeader: bool,
|
||||
iconsAsButtons: bool) -> str:
|
||||
"""Show the inbox as html
|
||||
"""
|
||||
manuallyApproveFollowers = \
|
||||
|
@ -6728,7 +6773,8 @@ def htmlInbox(defaultTimeline: str,
|
|||
showPublishedDateOnly,
|
||||
newswire, False, False,
|
||||
positiveVoting, showPublishAsIcon,
|
||||
fullWidthTimelineButtonHeader)
|
||||
fullWidthTimelineButtonHeader,
|
||||
iconsAsButtons)
|
||||
|
||||
|
||||
def htmlBookmarks(defaultTimeline: str,
|
||||
|
@ -6742,7 +6788,8 @@ def htmlBookmarks(defaultTimeline: str,
|
|||
showPublishedDateOnly: bool,
|
||||
newswire: {}, positiveVoting: bool,
|
||||
showPublishAsIcon: bool,
|
||||
fullWidthTimelineButtonHeader: bool) -> str:
|
||||
fullWidthTimelineButtonHeader: bool,
|
||||
iconsAsButtons: bool) -> str:
|
||||
"""Show the bookmarks as html
|
||||
"""
|
||||
manuallyApproveFollowers = \
|
||||
|
@ -6758,7 +6805,8 @@ def htmlBookmarks(defaultTimeline: str,
|
|||
showPublishedDateOnly,
|
||||
newswire, False, False,
|
||||
positiveVoting, showPublishAsIcon,
|
||||
fullWidthTimelineButtonHeader)
|
||||
fullWidthTimelineButtonHeader,
|
||||
iconsAsButtons)
|
||||
|
||||
|
||||
def htmlEvents(defaultTimeline: str,
|
||||
|
@ -6772,7 +6820,8 @@ def htmlEvents(defaultTimeline: str,
|
|||
showPublishedDateOnly: bool,
|
||||
newswire: {}, positiveVoting: bool,
|
||||
showPublishAsIcon: bool,
|
||||
fullWidthTimelineButtonHeader: bool) -> str:
|
||||
fullWidthTimelineButtonHeader: bool,
|
||||
iconsAsButtons: bool) -> str:
|
||||
"""Show the events as html
|
||||
"""
|
||||
manuallyApproveFollowers = \
|
||||
|
@ -6788,7 +6837,8 @@ def htmlEvents(defaultTimeline: str,
|
|||
showPublishedDateOnly,
|
||||
newswire, False, False,
|
||||
positiveVoting, showPublishAsIcon,
|
||||
fullWidthTimelineButtonHeader)
|
||||
fullWidthTimelineButtonHeader,
|
||||
iconsAsButtons)
|
||||
|
||||
|
||||
def htmlInboxDMs(defaultTimeline: str,
|
||||
|
@ -6802,7 +6852,8 @@ def htmlInboxDMs(defaultTimeline: str,
|
|||
showPublishedDateOnly: bool,
|
||||
newswire: {}, positiveVoting: bool,
|
||||
showPublishAsIcon: bool,
|
||||
fullWidthTimelineButtonHeader: bool) -> str:
|
||||
fullWidthTimelineButtonHeader: bool,
|
||||
iconsAsButtons: bool) -> str:
|
||||
"""Show the DM timeline as html
|
||||
"""
|
||||
return htmlTimeline(defaultTimeline, recentPostsCache, maxRecentPosts,
|
||||
|
@ -6813,7 +6864,8 @@ def htmlInboxDMs(defaultTimeline: str,
|
|||
YTReplacementDomain, showPublishedDateOnly,
|
||||
newswire, False, False, positiveVoting,
|
||||
showPublishAsIcon,
|
||||
fullWidthTimelineButtonHeader)
|
||||
fullWidthTimelineButtonHeader,
|
||||
iconsAsButtons)
|
||||
|
||||
|
||||
def htmlInboxReplies(defaultTimeline: str,
|
||||
|
@ -6827,7 +6879,8 @@ def htmlInboxReplies(defaultTimeline: str,
|
|||
showPublishedDateOnly: bool,
|
||||
newswire: {}, positiveVoting: bool,
|
||||
showPublishAsIcon: bool,
|
||||
fullWidthTimelineButtonHeader: bool) -> str:
|
||||
fullWidthTimelineButtonHeader: bool,
|
||||
iconsAsButtons: bool) -> str:
|
||||
"""Show the replies timeline as html
|
||||
"""
|
||||
return htmlTimeline(defaultTimeline, recentPostsCache, maxRecentPosts,
|
||||
|
@ -6839,7 +6892,8 @@ def htmlInboxReplies(defaultTimeline: str,
|
|||
showPublishedDateOnly,
|
||||
newswire, False, False,
|
||||
positiveVoting, showPublishAsIcon,
|
||||
fullWidthTimelineButtonHeader)
|
||||
fullWidthTimelineButtonHeader,
|
||||
iconsAsButtons)
|
||||
|
||||
|
||||
def htmlInboxMedia(defaultTimeline: str,
|
||||
|
@ -6853,7 +6907,8 @@ def htmlInboxMedia(defaultTimeline: str,
|
|||
showPublishedDateOnly: bool,
|
||||
newswire: {}, positiveVoting: bool,
|
||||
showPublishAsIcon: bool,
|
||||
fullWidthTimelineButtonHeader: bool) -> str:
|
||||
fullWidthTimelineButtonHeader: bool,
|
||||
iconsAsButtons: bool) -> str:
|
||||
"""Show the media timeline as html
|
||||
"""
|
||||
return htmlTimeline(defaultTimeline, recentPostsCache, maxRecentPosts,
|
||||
|
@ -6865,7 +6920,8 @@ def htmlInboxMedia(defaultTimeline: str,
|
|||
showPublishedDateOnly,
|
||||
newswire, False, False,
|
||||
positiveVoting, showPublishAsIcon,
|
||||
fullWidthTimelineButtonHeader)
|
||||
fullWidthTimelineButtonHeader,
|
||||
iconsAsButtons)
|
||||
|
||||
|
||||
def htmlInboxBlogs(defaultTimeline: str,
|
||||
|
@ -6879,7 +6935,8 @@ def htmlInboxBlogs(defaultTimeline: str,
|
|||
showPublishedDateOnly: bool,
|
||||
newswire: {}, positiveVoting: bool,
|
||||
showPublishAsIcon: bool,
|
||||
fullWidthTimelineButtonHeader: bool) -> str:
|
||||
fullWidthTimelineButtonHeader: bool,
|
||||
iconsAsButtons: bool) -> str:
|
||||
"""Show the blogs timeline as html
|
||||
"""
|
||||
return htmlTimeline(defaultTimeline, recentPostsCache, maxRecentPosts,
|
||||
|
@ -6891,7 +6948,8 @@ def htmlInboxBlogs(defaultTimeline: str,
|
|||
showPublishedDateOnly,
|
||||
newswire, False, False,
|
||||
positiveVoting, showPublishAsIcon,
|
||||
fullWidthTimelineButtonHeader)
|
||||
fullWidthTimelineButtonHeader,
|
||||
iconsAsButtons)
|
||||
|
||||
|
||||
def htmlInboxNews(defaultTimeline: str,
|
||||
|
@ -6905,7 +6963,8 @@ def htmlInboxNews(defaultTimeline: str,
|
|||
showPublishedDateOnly: bool,
|
||||
newswire: {}, moderator: bool, editor: bool,
|
||||
positiveVoting: bool, showPublishAsIcon: bool,
|
||||
fullWidthTimelineButtonHeader: bool) -> str:
|
||||
fullWidthTimelineButtonHeader: bool,
|
||||
iconsAsButtons: bool) -> str:
|
||||
"""Show the news timeline as html
|
||||
"""
|
||||
return htmlTimeline(defaultTimeline, recentPostsCache, maxRecentPosts,
|
||||
|
@ -6917,7 +6976,8 @@ def htmlInboxNews(defaultTimeline: str,
|
|||
showPublishedDateOnly,
|
||||
newswire, moderator, editor,
|
||||
positiveVoting, showPublishAsIcon,
|
||||
fullWidthTimelineButtonHeader)
|
||||
fullWidthTimelineButtonHeader,
|
||||
iconsAsButtons)
|
||||
|
||||
|
||||
def htmlModeration(defaultTimeline: str,
|
||||
|
@ -6931,7 +6991,8 @@ def htmlModeration(defaultTimeline: str,
|
|||
showPublishedDateOnly: bool,
|
||||
newswire: {}, positiveVoting: bool,
|
||||
showPublishAsIcon: bool,
|
||||
fullWidthTimelineButtonHeader: bool) -> str:
|
||||
fullWidthTimelineButtonHeader: bool,
|
||||
iconsAsButtons: bool) -> str:
|
||||
"""Show the moderation feed as html
|
||||
"""
|
||||
return htmlTimeline(defaultTimeline, recentPostsCache, maxRecentPosts,
|
||||
|
@ -6941,7 +7002,8 @@ def htmlModeration(defaultTimeline: str,
|
|||
allowDeletion, httpPrefix, projectVersion, True, False,
|
||||
YTReplacementDomain, showPublishedDateOnly,
|
||||
newswire, False, False, positiveVoting,
|
||||
showPublishAsIcon, fullWidthTimelineButtonHeader)
|
||||
showPublishAsIcon, fullWidthTimelineButtonHeader,
|
||||
iconsAsButtons)
|
||||
|
||||
|
||||
def htmlOutbox(defaultTimeline: str,
|
||||
|
@ -6955,7 +7017,8 @@ def htmlOutbox(defaultTimeline: str,
|
|||
showPublishedDateOnly: bool,
|
||||
newswire: {}, positiveVoting: bool,
|
||||
showPublishAsIcon: bool,
|
||||
fullWidthTimelineButtonHeader: bool) -> str:
|
||||
fullWidthTimelineButtonHeader: bool,
|
||||
iconsAsButtons: bool) -> str:
|
||||
"""Show the Outbox as html
|
||||
"""
|
||||
manuallyApproveFollowers = \
|
||||
|
@ -6968,7 +7031,8 @@ def htmlOutbox(defaultTimeline: str,
|
|||
manuallyApproveFollowers, minimal,
|
||||
YTReplacementDomain, showPublishedDateOnly,
|
||||
newswire, False, False, positiveVoting,
|
||||
showPublishAsIcon, fullWidthTimelineButtonHeader)
|
||||
showPublishAsIcon, fullWidthTimelineButtonHeader,
|
||||
iconsAsButtons)
|
||||
|
||||
|
||||
def htmlIndividualPost(recentPostsCache: {}, maxRecentPosts: int,
|
||||
|
|
Loading…
Reference in New Issue