Theme designer screen
31
daemon.py
|
@ -154,6 +154,7 @@ from blog import htmlBlogPage
|
||||||
from blog import htmlBlogPost
|
from blog import htmlBlogPost
|
||||||
from blog import htmlEditBlog
|
from blog import htmlEditBlog
|
||||||
from blog import getBlogAddress
|
from blog import getBlogAddress
|
||||||
|
from webapp_themeDesigner import htmlThemeDesigner
|
||||||
from webapp_minimalbutton import setMinimal
|
from webapp_minimalbutton import setMinimal
|
||||||
from webapp_minimalbutton import isMinimal
|
from webapp_minimalbutton import isMinimal
|
||||||
from webapp_utils import getAvatarImageUrl
|
from webapp_utils import getAvatarImageUrl
|
||||||
|
@ -10849,6 +10850,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
currNickname = currNickname.split('/')[0]
|
currNickname = currNickname.split('/')[0]
|
||||||
moderator = isModerator(baseDir, currNickname)
|
moderator = isModerator(baseDir, currNickname)
|
||||||
editor = isEditor(baseDir, currNickname)
|
editor = isEditor(baseDir, currNickname)
|
||||||
|
artist = isArtist(baseDir, currNickname)
|
||||||
fullWidthTimelineButtonHeader = \
|
fullWidthTimelineButtonHeader = \
|
||||||
self.server.fullWidthTimelineButtonHeader
|
self.server.fullWidthTimelineButtonHeader
|
||||||
minimalNick = isMinimal(baseDir, domain, nickname)
|
minimalNick = isMinimal(baseDir, domain, nickname)
|
||||||
|
@ -10881,7 +10883,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.twitterReplacementDomain,
|
self.server.twitterReplacementDomain,
|
||||||
self.server.showPublishedDateOnly,
|
self.server.showPublishedDateOnly,
|
||||||
self.server.newswire,
|
self.server.newswire,
|
||||||
moderator, editor,
|
moderator, editor, artist,
|
||||||
self.server.positiveVoting,
|
self.server.positiveVoting,
|
||||||
self.server.showPublishAsIcon,
|
self.server.showPublishAsIcon,
|
||||||
fullWidthTimelineButtonHeader,
|
fullWidthTimelineButtonHeader,
|
||||||
|
@ -14363,6 +14365,32 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.debug)
|
self.server.debug)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if htmlGET and usersInPath and authorized and \
|
||||||
|
self.path.endswith('/themedesigner'):
|
||||||
|
nickname = self.path.split('/users/')[1]
|
||||||
|
if '/' in nickname:
|
||||||
|
nickname = nickname.split('/')[0]
|
||||||
|
|
||||||
|
if not isArtist(self.server.baseDir, nickname):
|
||||||
|
self._403()
|
||||||
|
return
|
||||||
|
|
||||||
|
msg = \
|
||||||
|
htmlThemeDesigner(self.server.cssCache,
|
||||||
|
self.server.baseDir,
|
||||||
|
nickname, self.server.domain,
|
||||||
|
self.server.translate,
|
||||||
|
self.server.defaultTimeline,
|
||||||
|
self.server.themeName)
|
||||||
|
msg = msg.encode('utf-8')
|
||||||
|
msglen = len(msg)
|
||||||
|
self._login_headers('text/html', msglen, callingDomain)
|
||||||
|
self._write(msg)
|
||||||
|
fitnessPerformance(GETstartTime, self.server.fitness,
|
||||||
|
'_GET', 'show theme designer screen',
|
||||||
|
self.server.debug)
|
||||||
|
return
|
||||||
|
|
||||||
fitnessPerformance(GETstartTime, self.server.fitness,
|
fitnessPerformance(GETstartTime, self.server.fitness,
|
||||||
'_GET', 'show about screen done',
|
'_GET', 'show about screen done',
|
||||||
self.server.debug)
|
self.server.debug)
|
||||||
|
@ -18330,6 +18358,7 @@ def runDaemon(contentLicenseUrl: str,
|
||||||
'enterNotes': 'n',
|
'enterNotes': 'n',
|
||||||
'menuTimeline': 't',
|
'menuTimeline': 't',
|
||||||
'menuEdit': 'e',
|
'menuEdit': 'e',
|
||||||
|
'menuThemeDesigner': 'z',
|
||||||
'menuProfile': 'p',
|
'menuProfile': 'p',
|
||||||
'menuInbox': 'i',
|
'menuInbox': 'i',
|
||||||
'menuSearch': '/',
|
'menuSearch': '/',
|
||||||
|
|
After Width: | Height: | Size: 9.5 KiB |
After Width: | Height: | Size: 9.5 KiB |
After Width: | Height: | Size: 9.5 KiB |
After Width: | Height: | Size: 9.8 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 8.6 KiB |
After Width: | Height: | Size: 9.5 KiB |
After Width: | Height: | Size: 7.7 KiB |
After Width: | Height: | Size: 9.5 KiB |
After Width: | Height: | Size: 9.7 KiB |
After Width: | Height: | Size: 7.5 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 9.4 KiB |
|
@ -498,5 +498,6 @@
|
||||||
"Select reaction": "حدد رد الفعل",
|
"Select reaction": "حدد رد الفعل",
|
||||||
"Don't show the Reaction button": "لا تظهر زر رد الفعل",
|
"Don't show the Reaction button": "لا تظهر زر رد الفعل",
|
||||||
"New feed URL": "موجز جديد URL",
|
"New feed URL": "موجز جديد URL",
|
||||||
"New link title and URL": "عنوان الارتباط الجديد وعنوان URL"
|
"New link title and URL": "عنوان الارتباط الجديد وعنوان URL",
|
||||||
|
"Theme Designer": "مصمم المظهر"
|
||||||
}
|
}
|
||||||
|
|
|
@ -498,5 +498,6 @@
|
||||||
"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 feed URL": "URL de feed nou",
|
||||||
"New link title and URL": "Títol i URL de l'enllaç nous"
|
"New link title and URL": "Títol i URL de l'enllaç nous",
|
||||||
|
"Theme Designer": "Dissenyador temàtic"
|
||||||
}
|
}
|
||||||
|
|
|
@ -498,5 +498,6 @@
|
||||||
"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 feed URL": "URL porthiant newydd",
|
||||||
"New link title and URL": "Teitl dolen ac URL newydd"
|
"New link title and URL": "Teitl dolen ac URL newydd",
|
||||||
|
"Theme Designer": "Dylunydd Thema"
|
||||||
}
|
}
|
||||||
|
|
|
@ -498,5 +498,6 @@
|
||||||
"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 feed URL": "Neue Feed-URL",
|
||||||
"New link title and URL": "Neuer Linktitel und URL"
|
"New link title and URL": "Neuer Linktitel und URL",
|
||||||
|
"Theme Designer": "Themendesigner"
|
||||||
}
|
}
|
||||||
|
|
|
@ -498,5 +498,6 @@
|
||||||
"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 feed URL": "New feed URL",
|
||||||
"New link title and URL": "New link title and URL"
|
"New link title and URL": "New link title and URL",
|
||||||
|
"Theme Designer": "Theme Designer"
|
||||||
}
|
}
|
||||||
|
|
|
@ -498,5 +498,6 @@
|
||||||
"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 feed URL": "URL de nuevo feed",
|
||||||
"New link title and URL": "Nuevo título de enlace y URL"
|
"New link title and URL": "Nuevo título de enlace y URL",
|
||||||
|
"Theme Designer": "Diseñadora de temas"
|
||||||
}
|
}
|
||||||
|
|
|
@ -498,5 +498,6 @@
|
||||||
"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 feed URL": "Nouvelle URL de flux",
|
||||||
"New link title and URL": "Nouveau titre et URL du lien"
|
"New link title and URL": "Nouveau titre et URL du lien",
|
||||||
|
"Theme Designer": "Concepteur de thème"
|
||||||
}
|
}
|
||||||
|
|
|
@ -498,5 +498,6 @@
|
||||||
"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 feed URL": "URL beathaithe nua",
|
||||||
"New link title and URL": "Teideal nasc nua agus URL"
|
"New link title and URL": "Teideal nasc nua agus URL",
|
||||||
|
"Theme Designer": "Dearthóir Téama"
|
||||||
}
|
}
|
||||||
|
|
|
@ -498,5 +498,6 @@
|
||||||
"Select reaction": "प्रतिक्रिया का चयन करें",
|
"Select reaction": "प्रतिक्रिया का चयन करें",
|
||||||
"Don't show the Reaction button": "प्रतिक्रिया बटन न दिखाएं",
|
"Don't show the Reaction button": "प्रतिक्रिया बटन न दिखाएं",
|
||||||
"New feed URL": "नया फ़ीड URL",
|
"New feed URL": "नया फ़ीड URL",
|
||||||
"New link title and URL": "नया लिंक शीर्षक और URL"
|
"New link title and URL": "नया लिंक शीर्षक और URL",
|
||||||
|
"Theme Designer": "थीम डिजाइनर"
|
||||||
}
|
}
|
||||||
|
|
|
@ -498,5 +498,6 @@
|
||||||
"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 feed URL": "Nuovo URL del feed",
|
||||||
"New link title and URL": "Nuovo titolo e URL del collegamento"
|
"New link title and URL": "Nuovo titolo e URL del collegamento",
|
||||||
|
"Theme Designer": "Progettista di temi"
|
||||||
}
|
}
|
||||||
|
|
|
@ -498,5 +498,6 @@
|
||||||
"Select reaction": "反応を選択",
|
"Select reaction": "反応を選択",
|
||||||
"Don't show the Reaction button": "反応ボタンを表示しない",
|
"Don't show the Reaction button": "反応ボタンを表示しない",
|
||||||
"New feed URL": "新しいフィードURL",
|
"New feed URL": "新しいフィードURL",
|
||||||
"New link title and URL": "新しいリンクのタイトルとURL"
|
"New link title and URL": "新しいリンクのタイトルとURL",
|
||||||
|
"Theme Designer": "テーマデザイナー"
|
||||||
}
|
}
|
||||||
|
|
|
@ -498,5 +498,6 @@
|
||||||
"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 feed URL": "URL-ya feed nû",
|
||||||
"New link title and URL": "Sernav û URL-ya girêdana nû"
|
"New link title and URL": "Sernav û URL-ya girêdana nû",
|
||||||
|
"Theme Designer": "Theme Designer"
|
||||||
}
|
}
|
||||||
|
|
|
@ -494,5 +494,6 @@
|
||||||
"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 feed URL": "New feed URL",
|
||||||
"New link title and URL": "New link title and URL"
|
"New link title and URL": "New link title and URL",
|
||||||
|
"Theme Designer": "Theme Designer"
|
||||||
}
|
}
|
||||||
|
|
|
@ -498,5 +498,6 @@
|
||||||
"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 feed URL": "Novo URL de feed",
|
||||||
"New link title and URL": "Novo título e URL do link"
|
"New link title and URL": "Novo título e URL do link",
|
||||||
|
"Theme Designer": "Designer de Tema"
|
||||||
}
|
}
|
||||||
|
|
|
@ -498,5 +498,6 @@
|
||||||
"Select reaction": "Выберите реакцию",
|
"Select reaction": "Выберите реакцию",
|
||||||
"Don't show the Reaction button": "Не показывать кнопку реакции",
|
"Don't show the Reaction button": "Не показывать кнопку реакции",
|
||||||
"New feed URL": "URL нового канала",
|
"New feed URL": "URL нового канала",
|
||||||
"New link title and URL": "Новое название ссылки и URL"
|
"New link title and URL": "Новое название ссылки и URL",
|
||||||
|
"Theme Designer": "Дизайнер тем"
|
||||||
}
|
}
|
||||||
|
|
|
@ -498,5 +498,6 @@
|
||||||
"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 feed URL": "URL mpya ya mipasho",
|
||||||
"New link title and URL": "Kichwa kipya cha kiungo na URL"
|
"New link title and URL": "Kichwa kipya cha kiungo na URL",
|
||||||
|
"Theme Designer": "Mbuni wa Mandhari"
|
||||||
}
|
}
|
||||||
|
|
|
@ -498,5 +498,6 @@
|
||||||
"Select reaction": "选择反应",
|
"Select reaction": "选择反应",
|
||||||
"Don't show the Reaction button": "不显示“反应”按钮",
|
"Don't show the Reaction button": "不显示“反应”按钮",
|
||||||
"New feed URL": "新供稿网址",
|
"New feed URL": "新供稿网址",
|
||||||
"New link title and URL": "新链接标题和 URL"
|
"New link title and URL": "新链接标题和 URL",
|
||||||
|
"Theme Designer": "主题设计师"
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,7 @@ import os
|
||||||
from utils import getConfigParam
|
from utils import getConfigParam
|
||||||
from utils import getNicknameFromActor
|
from utils import getNicknameFromActor
|
||||||
from utils import isEditor
|
from utils import isEditor
|
||||||
|
from utils import isArtist
|
||||||
from utils import removeDomainPort
|
from utils import removeDomainPort
|
||||||
from utils import localActorUrl
|
from utils import localActorUrl
|
||||||
from webapp_utils import sharesTimelineJson
|
from webapp_utils import sharesTimelineJson
|
||||||
|
@ -113,7 +114,7 @@ def _getLeftColumnWanted(baseDir: str,
|
||||||
|
|
||||||
def getLeftColumnContent(baseDir: str, nickname: str, domainFull: str,
|
def getLeftColumnContent(baseDir: str, nickname: str, domainFull: str,
|
||||||
httpPrefix: str, translate: {},
|
httpPrefix: str, translate: {},
|
||||||
editor: bool,
|
editor: bool, artist: bool,
|
||||||
showBackButton: bool, timelinePath: str,
|
showBackButton: bool, timelinePath: str,
|
||||||
rssIconAtTop: bool, showHeaderImage: bool,
|
rssIconAtTop: bool, showHeaderImage: bool,
|
||||||
frontPage: bool, theme: str,
|
frontPage: bool, theme: str,
|
||||||
|
@ -154,6 +155,7 @@ def getLeftColumnContent(baseDir: str, nickname: str, domainFull: str,
|
||||||
htmlStr += '\n <center>\n'
|
htmlStr += '\n <center>\n'
|
||||||
|
|
||||||
htmlStr += ' <div class="leftColIcons">\n'
|
htmlStr += ' <div class="leftColIcons">\n'
|
||||||
|
|
||||||
if editor:
|
if editor:
|
||||||
# show the edit icon
|
# show the edit icon
|
||||||
htmlStr += \
|
htmlStr += \
|
||||||
|
@ -163,6 +165,15 @@ def getLeftColumnContent(baseDir: str, nickname: str, domainFull: str,
|
||||||
translate['Edit Links'] + ' | " title="' + \
|
translate['Edit Links'] + ' | " title="' + \
|
||||||
translate['Edit Links'] + '" src="/icons/edit.png" /></a>\n'
|
translate['Edit Links'] + '" src="/icons/edit.png" /></a>\n'
|
||||||
|
|
||||||
|
if artist:
|
||||||
|
# show the theme designer icon
|
||||||
|
htmlStr += \
|
||||||
|
' <a href="/users/' + nickname + '/themedesigner" ' + \
|
||||||
|
'accesskey="' + accessKeys['menuThemeDesigner'] + '">' + \
|
||||||
|
'<img class="' + editImageClass + '" loading="lazy" alt="' + \
|
||||||
|
translate['Theme Designer'] + ' | " title="' + \
|
||||||
|
translate['Theme Designer'] + '" src="/icons/theme.png" /></a>\n'
|
||||||
|
|
||||||
# RSS icon
|
# RSS icon
|
||||||
if nickname != 'news':
|
if nickname != 'news':
|
||||||
# rss feed for this account
|
# rss feed for this account
|
||||||
|
@ -358,8 +369,10 @@ def htmlLinksMobile(cssCache: {}, baseDir: str,
|
||||||
# is the user a site editor?
|
# is the user a site editor?
|
||||||
if nickname == 'news':
|
if nickname == 'news':
|
||||||
editor = False
|
editor = False
|
||||||
|
artist = False
|
||||||
else:
|
else:
|
||||||
editor = isEditor(baseDir, nickname)
|
editor = isEditor(baseDir, nickname)
|
||||||
|
artist = isArtist(baseDir, nickname)
|
||||||
|
|
||||||
domain = removeDomainPort(domainFull)
|
domain = removeDomainPort(domainFull)
|
||||||
|
|
||||||
|
@ -383,7 +396,7 @@ def htmlLinksMobile(cssCache: {}, baseDir: str,
|
||||||
htmlStr += \
|
htmlStr += \
|
||||||
getLeftColumnContent(baseDir, nickname, domainFull,
|
getLeftColumnContent(baseDir, nickname, domainFull,
|
||||||
httpPrefix, translate,
|
httpPrefix, translate,
|
||||||
editor,
|
editor, artist,
|
||||||
False, timelinePath,
|
False, timelinePath,
|
||||||
rssIconAtTop, False, False,
|
rssIconAtTop, False, False,
|
||||||
theme, accessKeys,
|
theme, accessKeys,
|
||||||
|
|
|
@ -155,7 +155,8 @@ def htmlFrontScreen(signingPrivateKeyPem: str,
|
||||||
profileHeaderStr += \
|
profileHeaderStr += \
|
||||||
getLeftColumnContent(baseDir, 'news', domainFull,
|
getLeftColumnContent(baseDir, 'news', domainFull,
|
||||||
httpPrefix, translate,
|
httpPrefix, translate,
|
||||||
False, False, None, rssIconAtTop, True,
|
False, False,
|
||||||
|
False, None, rssIconAtTop, True,
|
||||||
True, theme, accessKeys,
|
True, theme, accessKeys,
|
||||||
sharedItemsFederatedDomains)
|
sharedItemsFederatedDomains)
|
||||||
profileHeaderStr += \
|
profileHeaderStr += \
|
||||||
|
|
|
@ -66,7 +66,7 @@ def htmlModeration(cssCache: {}, defaultTimeline: str,
|
||||||
YTReplacementDomain,
|
YTReplacementDomain,
|
||||||
twitterReplacementDomain,
|
twitterReplacementDomain,
|
||||||
showPublishedDateOnly,
|
showPublishedDateOnly,
|
||||||
newswire, False, False, positiveVoting,
|
newswire, False, False, False, positiveVoting,
|
||||||
showPublishAsIcon, fullWidthTimelineButtonHeader,
|
showPublishAsIcon, fullWidthTimelineButtonHeader,
|
||||||
iconsAsButtons, rssIconAtTop, publishButtonAtTop,
|
iconsAsButtons, rssIconAtTop, publishButtonAtTop,
|
||||||
authorized, moderationActionStr, theme,
|
authorized, moderationActionStr, theme,
|
||||||
|
|
|
@ -878,6 +878,10 @@ def htmlProfile(signingPrivateKeyPem: str,
|
||||||
menuSkills: userPathStr + '/skills#timeline',
|
menuSkills: userPathStr + '/skills#timeline',
|
||||||
menuLogout: '/logout'
|
menuLogout: '/logout'
|
||||||
}
|
}
|
||||||
|
if isArtist(baseDir, nickname):
|
||||||
|
menuThemeDesigner = \
|
||||||
|
htmlHideFromScreenReader('🎨') + ' ' + translate['Theme Designer']
|
||||||
|
navLinks[menuThemeDesigner] = userPathStr + '/themedesigner'
|
||||||
navAccessKeys = {}
|
navAccessKeys = {}
|
||||||
for variableName, key in accessKeys.items():
|
for variableName, key in accessKeys.items():
|
||||||
if not locals().get(variableName):
|
if not locals().get(variableName):
|
||||||
|
|
|
@ -0,0 +1,61 @@
|
||||||
|
__filename__ = "webapp_themeDesigner.py"
|
||||||
|
__author__ = "Bob Mottram"
|
||||||
|
__license__ = "AGPL3+"
|
||||||
|
__version__ = "1.2.0"
|
||||||
|
__maintainer__ = "Bob Mottram"
|
||||||
|
__email__ = "bob@libreserver.org"
|
||||||
|
__status__ = "Production"
|
||||||
|
__module_group__ = "Web Interface"
|
||||||
|
|
||||||
|
import os
|
||||||
|
from utils import loadJson
|
||||||
|
from utils import getConfigParam
|
||||||
|
from utils import acctDir
|
||||||
|
from webapp_utils import htmlHeaderWithExternalStyle
|
||||||
|
from webapp_utils import htmlFooter
|
||||||
|
|
||||||
|
|
||||||
|
def htmlThemeDesigner(cssCache: {}, baseDir: str,
|
||||||
|
nickname: str, domain: str,
|
||||||
|
translate: {}, defaultTimeline: str,
|
||||||
|
themeName: str) -> str:
|
||||||
|
"""Edit theme settings
|
||||||
|
"""
|
||||||
|
themeFilename = \
|
||||||
|
acctDir(baseDir, nickname, domain) + '/theme/' + \
|
||||||
|
themeName + '/theme.json'
|
||||||
|
themeJson = {}
|
||||||
|
if os.path.isfile(themeFilename):
|
||||||
|
themeJson = loadJson(themeFilename)
|
||||||
|
|
||||||
|
themeForm = ''
|
||||||
|
cssFilename = baseDir + '/epicyon-profile.css'
|
||||||
|
if os.path.isfile(baseDir + '/epicyon.css'):
|
||||||
|
cssFilename = baseDir + '/epicyon.css'
|
||||||
|
|
||||||
|
instanceTitle = \
|
||||||
|
getConfigParam(baseDir, 'instanceTitle')
|
||||||
|
themeForm = \
|
||||||
|
htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
|
||||||
|
themeForm += '<div class="container">\n'
|
||||||
|
|
||||||
|
themeForm += \
|
||||||
|
' <h1>' + translate['Theme Designer'] + '</h1>\n'
|
||||||
|
|
||||||
|
themeForm += ' <form method="POST" action="' + \
|
||||||
|
'/users/' + nickname + '/changeThemeSettings">\n'
|
||||||
|
|
||||||
|
for variableName, value in themeJson.items():
|
||||||
|
if variableName.endswith('-color') or \
|
||||||
|
variableName.endswith('-text'):
|
||||||
|
themeForm += \
|
||||||
|
'<p><label class="labels">' + \
|
||||||
|
variableName.replace('-', ' ') + '</label>'
|
||||||
|
themeForm += \
|
||||||
|
'<input type="color" name="themeSetting_' + \
|
||||||
|
variableName + '" value="' + str(value) + '"></p>'
|
||||||
|
|
||||||
|
themeForm += ' </form>\n'
|
||||||
|
themeForm += '</div>\n'
|
||||||
|
themeForm += htmlFooter()
|
||||||
|
return themeForm
|
|
@ -430,7 +430,7 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
|
||||||
twitterReplacementDomain: str,
|
twitterReplacementDomain: str,
|
||||||
showPublishedDateOnly: bool,
|
showPublishedDateOnly: bool,
|
||||||
newswire: {}, moderator: bool,
|
newswire: {}, moderator: bool,
|
||||||
editor: bool,
|
editor: bool, artist: bool,
|
||||||
positiveVoting: bool,
|
positiveVoting: bool,
|
||||||
showPublishAsIcon: bool,
|
showPublishAsIcon: bool,
|
||||||
fullWidthTimelineButtonHeader: bool,
|
fullWidthTimelineButtonHeader: bool,
|
||||||
|
@ -744,7 +744,7 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
|
||||||
leftColumnStr = \
|
leftColumnStr = \
|
||||||
getLeftColumnContent(baseDir, nickname, domainFull,
|
getLeftColumnContent(baseDir, nickname, domainFull,
|
||||||
httpPrefix, translate,
|
httpPrefix, translate,
|
||||||
editor, False, None, rssIconAtTop,
|
editor, artist, False, None, rssIconAtTop,
|
||||||
True, False, theme, accessKeys,
|
True, False, theme, accessKeys,
|
||||||
sharedItemsFederatedDomains)
|
sharedItemsFederatedDomains)
|
||||||
tlStr += ' <td valign="top" class="col-left" ' + \
|
tlStr += ' <td valign="top" class="col-left" ' + \
|
||||||
|
@ -1159,7 +1159,7 @@ def htmlShares(cssCache: {}, defaultTimeline: str,
|
||||||
YTReplacementDomain,
|
YTReplacementDomain,
|
||||||
twitterReplacementDomain,
|
twitterReplacementDomain,
|
||||||
showPublishedDateOnly,
|
showPublishedDateOnly,
|
||||||
newswire, False, False,
|
newswire, False, False, False,
|
||||||
positiveVoting, showPublishAsIcon,
|
positiveVoting, showPublishAsIcon,
|
||||||
fullWidthTimelineButtonHeader,
|
fullWidthTimelineButtonHeader,
|
||||||
iconsAsButtons, rssIconAtTop, publishButtonAtTop,
|
iconsAsButtons, rssIconAtTop, publishButtonAtTop,
|
||||||
|
@ -1213,7 +1213,7 @@ def htmlWanted(cssCache: {}, defaultTimeline: str,
|
||||||
YTReplacementDomain,
|
YTReplacementDomain,
|
||||||
twitterReplacementDomain,
|
twitterReplacementDomain,
|
||||||
showPublishedDateOnly,
|
showPublishedDateOnly,
|
||||||
newswire, False, False,
|
newswire, False, False, False,
|
||||||
positiveVoting, showPublishAsIcon,
|
positiveVoting, showPublishAsIcon,
|
||||||
fullWidthTimelineButtonHeader,
|
fullWidthTimelineButtonHeader,
|
||||||
iconsAsButtons, rssIconAtTop, publishButtonAtTop,
|
iconsAsButtons, rssIconAtTop, publishButtonAtTop,
|
||||||
|
@ -1268,7 +1268,7 @@ def htmlInbox(cssCache: {}, defaultTimeline: str,
|
||||||
YTReplacementDomain,
|
YTReplacementDomain,
|
||||||
twitterReplacementDomain,
|
twitterReplacementDomain,
|
||||||
showPublishedDateOnly,
|
showPublishedDateOnly,
|
||||||
newswire, False, False,
|
newswire, False, False, False,
|
||||||
positiveVoting, showPublishAsIcon,
|
positiveVoting, showPublishAsIcon,
|
||||||
fullWidthTimelineButtonHeader,
|
fullWidthTimelineButtonHeader,
|
||||||
iconsAsButtons, rssIconAtTop, publishButtonAtTop,
|
iconsAsButtons, rssIconAtTop, publishButtonAtTop,
|
||||||
|
@ -1323,7 +1323,7 @@ def htmlBookmarks(cssCache: {}, defaultTimeline: str,
|
||||||
YTReplacementDomain,
|
YTReplacementDomain,
|
||||||
twitterReplacementDomain,
|
twitterReplacementDomain,
|
||||||
showPublishedDateOnly,
|
showPublishedDateOnly,
|
||||||
newswire, False, False,
|
newswire, False, False, False,
|
||||||
positiveVoting, showPublishAsIcon,
|
positiveVoting, showPublishAsIcon,
|
||||||
fullWidthTimelineButtonHeader,
|
fullWidthTimelineButtonHeader,
|
||||||
iconsAsButtons, rssIconAtTop, publishButtonAtTop,
|
iconsAsButtons, rssIconAtTop, publishButtonAtTop,
|
||||||
|
@ -1373,7 +1373,7 @@ def htmlInboxDMs(cssCache: {}, defaultTimeline: str,
|
||||||
YTReplacementDomain,
|
YTReplacementDomain,
|
||||||
twitterReplacementDomain,
|
twitterReplacementDomain,
|
||||||
showPublishedDateOnly,
|
showPublishedDateOnly,
|
||||||
newswire, False, False, positiveVoting,
|
newswire, False, False, False, positiveVoting,
|
||||||
showPublishAsIcon,
|
showPublishAsIcon,
|
||||||
fullWidthTimelineButtonHeader,
|
fullWidthTimelineButtonHeader,
|
||||||
iconsAsButtons, rssIconAtTop, publishButtonAtTop,
|
iconsAsButtons, rssIconAtTop, publishButtonAtTop,
|
||||||
|
@ -1424,7 +1424,7 @@ def htmlInboxReplies(cssCache: {}, defaultTimeline: str,
|
||||||
YTReplacementDomain,
|
YTReplacementDomain,
|
||||||
twitterReplacementDomain,
|
twitterReplacementDomain,
|
||||||
showPublishedDateOnly,
|
showPublishedDateOnly,
|
||||||
newswire, False, False,
|
newswire, False, False, False,
|
||||||
positiveVoting, showPublishAsIcon,
|
positiveVoting, showPublishAsIcon,
|
||||||
fullWidthTimelineButtonHeader,
|
fullWidthTimelineButtonHeader,
|
||||||
iconsAsButtons, rssIconAtTop, publishButtonAtTop,
|
iconsAsButtons, rssIconAtTop, publishButtonAtTop,
|
||||||
|
@ -1475,7 +1475,7 @@ def htmlInboxMedia(cssCache: {}, defaultTimeline: str,
|
||||||
YTReplacementDomain,
|
YTReplacementDomain,
|
||||||
twitterReplacementDomain,
|
twitterReplacementDomain,
|
||||||
showPublishedDateOnly,
|
showPublishedDateOnly,
|
||||||
newswire, False, False,
|
newswire, False, False, False,
|
||||||
positiveVoting, showPublishAsIcon,
|
positiveVoting, showPublishAsIcon,
|
||||||
fullWidthTimelineButtonHeader,
|
fullWidthTimelineButtonHeader,
|
||||||
iconsAsButtons, rssIconAtTop, publishButtonAtTop,
|
iconsAsButtons, rssIconAtTop, publishButtonAtTop,
|
||||||
|
@ -1526,7 +1526,7 @@ def htmlInboxBlogs(cssCache: {}, defaultTimeline: str,
|
||||||
YTReplacementDomain,
|
YTReplacementDomain,
|
||||||
twitterReplacementDomain,
|
twitterReplacementDomain,
|
||||||
showPublishedDateOnly,
|
showPublishedDateOnly,
|
||||||
newswire, False, False,
|
newswire, False, False, False,
|
||||||
positiveVoting, showPublishAsIcon,
|
positiveVoting, showPublishAsIcon,
|
||||||
fullWidthTimelineButtonHeader,
|
fullWidthTimelineButtonHeader,
|
||||||
iconsAsButtons, rssIconAtTop, publishButtonAtTop,
|
iconsAsButtons, rssIconAtTop, publishButtonAtTop,
|
||||||
|
@ -1578,7 +1578,7 @@ def htmlInboxFeatures(cssCache: {}, defaultTimeline: str,
|
||||||
YTReplacementDomain,
|
YTReplacementDomain,
|
||||||
twitterReplacementDomain,
|
twitterReplacementDomain,
|
||||||
showPublishedDateOnly,
|
showPublishedDateOnly,
|
||||||
newswire, False, False,
|
newswire, False, False, False,
|
||||||
positiveVoting, showPublishAsIcon,
|
positiveVoting, showPublishAsIcon,
|
||||||
fullWidthTimelineButtonHeader,
|
fullWidthTimelineButtonHeader,
|
||||||
iconsAsButtons, rssIconAtTop, publishButtonAtTop,
|
iconsAsButtons, rssIconAtTop, publishButtonAtTop,
|
||||||
|
@ -1601,7 +1601,7 @@ def htmlInboxNews(cssCache: {}, defaultTimeline: str,
|
||||||
YTReplacementDomain: str,
|
YTReplacementDomain: str,
|
||||||
twitterReplacementDomain: str,
|
twitterReplacementDomain: str,
|
||||||
showPublishedDateOnly: bool,
|
showPublishedDateOnly: bool,
|
||||||
newswire: {}, moderator: bool, editor: bool,
|
newswire: {}, moderator: bool, editor: bool, artist: bool,
|
||||||
positiveVoting: bool, showPublishAsIcon: bool,
|
positiveVoting: bool, showPublishAsIcon: bool,
|
||||||
fullWidthTimelineButtonHeader: bool,
|
fullWidthTimelineButtonHeader: bool,
|
||||||
iconsAsButtons: bool,
|
iconsAsButtons: bool,
|
||||||
|
@ -1629,7 +1629,7 @@ def htmlInboxNews(cssCache: {}, defaultTimeline: str,
|
||||||
YTReplacementDomain,
|
YTReplacementDomain,
|
||||||
twitterReplacementDomain,
|
twitterReplacementDomain,
|
||||||
showPublishedDateOnly,
|
showPublishedDateOnly,
|
||||||
newswire, moderator, editor,
|
newswire, moderator, editor, artist,
|
||||||
positiveVoting, showPublishAsIcon,
|
positiveVoting, showPublishAsIcon,
|
||||||
fullWidthTimelineButtonHeader,
|
fullWidthTimelineButtonHeader,
|
||||||
iconsAsButtons, rssIconAtTop, publishButtonAtTop,
|
iconsAsButtons, rssIconAtTop, publishButtonAtTop,
|
||||||
|
@ -1682,7 +1682,7 @@ def htmlOutbox(cssCache: {}, defaultTimeline: str,
|
||||||
YTReplacementDomain,
|
YTReplacementDomain,
|
||||||
twitterReplacementDomain,
|
twitterReplacementDomain,
|
||||||
showPublishedDateOnly,
|
showPublishedDateOnly,
|
||||||
newswire, False, False, positiveVoting,
|
newswire, False, False, False, positiveVoting,
|
||||||
showPublishAsIcon, fullWidthTimelineButtonHeader,
|
showPublishAsIcon, fullWidthTimelineButtonHeader,
|
||||||
iconsAsButtons, rssIconAtTop, publishButtonAtTop,
|
iconsAsButtons, rssIconAtTop, publishButtonAtTop,
|
||||||
authorized, None, theme, peertubeInstances,
|
authorized, None, theme, peertubeInstances,
|
||||||
|
|