mirror of https://gitlab.com/bashrc2/epicyon
Merge branch 'main' of ssh://code.freedombone.net:2222/bashrc/epicyon into main
commit
66ca660006
63
daemon.py
63
daemon.py
|
|
@ -1697,7 +1697,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self._write(msg.encode('utf-8'))
|
self._write(msg.encode('utf-8'))
|
||||||
return
|
return
|
||||||
|
|
||||||
if self.path.startswith('/about'):
|
if self.path.endswith('/about'):
|
||||||
if callingDomain.endswith('.onion'):
|
if callingDomain.endswith('.onion'):
|
||||||
msg = \
|
msg = \
|
||||||
htmlAbout(self.server.baseDir, 'http',
|
htmlAbout(self.server.baseDir, 'http',
|
||||||
|
|
@ -1840,36 +1840,6 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
|
|
||||||
self._benchmarkGETtimings(GETstartTime, GETtimings, 16)
|
self._benchmarkGETtimings(GETstartTime, GETtimings, 16)
|
||||||
|
|
||||||
# login screen background image
|
|
||||||
if self.path == '/login-background.png':
|
|
||||||
mediaFilename = \
|
|
||||||
self.server.baseDir + '/accounts/login-background.png'
|
|
||||||
if os.path.isfile(mediaFilename):
|
|
||||||
if self._etag_exists(mediaFilename):
|
|
||||||
# The file has not changed
|
|
||||||
self._304()
|
|
||||||
return
|
|
||||||
|
|
||||||
tries = 0
|
|
||||||
mediaBinary = None
|
|
||||||
while tries < 5:
|
|
||||||
try:
|
|
||||||
with open(mediaFilename, 'rb') as avFile:
|
|
||||||
mediaBinary = avFile.read()
|
|
||||||
break
|
|
||||||
except Exception as e:
|
|
||||||
print(e)
|
|
||||||
time.sleep(1)
|
|
||||||
tries += 1
|
|
||||||
if mediaBinary:
|
|
||||||
self._set_headers_etag(mediaFilename, 'image/png',
|
|
||||||
mediaBinary, cookie,
|
|
||||||
callingDomain)
|
|
||||||
self._write(mediaBinary)
|
|
||||||
return
|
|
||||||
self._404()
|
|
||||||
return
|
|
||||||
|
|
||||||
# QR code for account handle
|
# QR code for account handle
|
||||||
if '/users/' in self.path and \
|
if '/users/' in self.path and \
|
||||||
self.path.endswith('/qrcode.png'):
|
self.path.endswith('/qrcode.png'):
|
||||||
|
|
@ -1941,32 +1911,39 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
|
|
||||||
self._benchmarkGETtimings(GETstartTime, GETtimings, 17)
|
self._benchmarkGETtimings(GETstartTime, GETtimings, 17)
|
||||||
|
|
||||||
|
if '-background.' in self.path:
|
||||||
|
for ext in ('webp', 'gif', 'jpg', 'png'):
|
||||||
|
for bg in ('follow', 'options', 'login'):
|
||||||
# follow screen background image
|
# follow screen background image
|
||||||
if self.path == '/follow-background.png':
|
if self.path.endswith('/' + bg + '-background.' + ext):
|
||||||
mediaFilename = \
|
bgFilename = \
|
||||||
self.server.baseDir + '/accounts/follow-background.png'
|
self.server.baseDir + '/accounts/' + \
|
||||||
if os.path.isfile(mediaFilename):
|
bg + '-background.' + ext
|
||||||
if self._etag_exists(mediaFilename):
|
if os.path.isfile(bgFilename):
|
||||||
|
if self._etag_exists(bgFilename):
|
||||||
# The file has not changed
|
# The file has not changed
|
||||||
self._304()
|
self._304()
|
||||||
return
|
return
|
||||||
|
|
||||||
tries = 0
|
tries = 0
|
||||||
mediaBinary = None
|
bgBinary = None
|
||||||
while tries < 5:
|
while tries < 5:
|
||||||
try:
|
try:
|
||||||
with open(mediaFilename, 'rb') as avFile:
|
with open(bgFilename, 'rb') as avFile:
|
||||||
mediaBinary = avFile.read()
|
bgBinary = avFile.read()
|
||||||
break
|
break
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(e)
|
print(e)
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
tries += 1
|
tries += 1
|
||||||
if mediaBinary:
|
if bgBinary:
|
||||||
self._set_headers_etag(mediaFilename, 'image/png',
|
if ext == 'jpg':
|
||||||
mediaBinary, cookie,
|
ext = 'jpeg'
|
||||||
|
self._set_headers_etag(bgFilename,
|
||||||
|
'image/' + ext,
|
||||||
|
bgBinary, cookie,
|
||||||
callingDomain)
|
callingDomain)
|
||||||
self._write(mediaBinary)
|
self._write(bgBinary)
|
||||||
return
|
return
|
||||||
self._404()
|
self._404()
|
||||||
return
|
return
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,12 @@ a:link {
|
||||||
}
|
}
|
||||||
|
|
||||||
.follow {
|
.follow {
|
||||||
background-image: url("follow-background.png");
|
background-image: url("follow-background.jpg");
|
||||||
|
background-size: cover;
|
||||||
|
-webkit-background-size: cover;
|
||||||
|
-moz-background-size: cover;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-position: center;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background-position: center;
|
background-position: center;
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,12 @@ body, html {
|
||||||
background-color: var(--main-bg-color);
|
background-color: var(--main-bg-color);
|
||||||
color: var(--main-fg-color);
|
color: var(--main-fg-color);
|
||||||
|
|
||||||
background-image: url("/login-background.png");
|
background-image: url("/login-background.jpg");
|
||||||
|
background-size: cover;
|
||||||
|
-webkit-background-size: cover;
|
||||||
|
-moz-background-size: cover;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-position: center;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
font-family: Arial, Helvetica, sans-serif;
|
font-family: Arial, Helvetica, sans-serif;
|
||||||
max-width: 60%;
|
max-width: 60%;
|
||||||
|
|
@ -125,7 +130,12 @@ span.psw {
|
||||||
background-color: var(--main-bg-color);
|
background-color: var(--main-bg-color);
|
||||||
color: var(--main-fg-color);
|
color: var(--main-fg-color);
|
||||||
|
|
||||||
background-image: url("/login-background.png");
|
background-image: url("/login-background.jpg");
|
||||||
|
background-size: cover;
|
||||||
|
-webkit-background-size: cover;
|
||||||
|
-moz-background-size: cover;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-position: center;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
font-family: Arial, Helvetica, sans-serif;
|
font-family: Arial, Helvetica, sans-serif;
|
||||||
max-width: 60%;
|
max-width: 60%;
|
||||||
|
|
@ -168,7 +178,12 @@ span.psw {
|
||||||
background-color: var(--main-bg-color);
|
background-color: var(--main-bg-color);
|
||||||
color: var(--main-fg-color);
|
color: var(--main-fg-color);
|
||||||
|
|
||||||
background-image: url("/login-background.png");
|
background-image: url("/login-background.jpg");
|
||||||
|
background-size: cover;
|
||||||
|
-webkit-background-size: cover;
|
||||||
|
-moz-background-size: cover;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-position: center;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
font-family: Arial, Helvetica, sans-serif;
|
font-family: Arial, Helvetica, sans-serif;
|
||||||
max-width: 95%;
|
max-width: 95%;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,232 @@
|
||||||
|
@charset "UTF-8";
|
||||||
|
|
||||||
|
:root {
|
||||||
|
--main-bg-color: #282c37;
|
||||||
|
--link-bg-color: #282c37;
|
||||||
|
--main-fg-color: #dddddd;
|
||||||
|
--main-link-color: #999;
|
||||||
|
--main-visited-color: #888;
|
||||||
|
--border-color: #505050;
|
||||||
|
--font-size-header: 18px;
|
||||||
|
--font-color-header: #ccc;
|
||||||
|
--font-size: 40px;
|
||||||
|
--font-size2: 24px;
|
||||||
|
--font-size3: 38px;
|
||||||
|
--font-size4: 22px;
|
||||||
|
--font-size5: 20px;
|
||||||
|
--text-entry-foreground: #ccc;
|
||||||
|
--text-entry-background: #111;
|
||||||
|
--time-color: #aaa;
|
||||||
|
--button-text: #FFFFFF;
|
||||||
|
--button-background: #999;
|
||||||
|
--button-selected: #666;
|
||||||
|
--hashtag-margin: 2%;
|
||||||
|
--hashtag-vertical-spacing1: 50px;
|
||||||
|
--hashtag-vertical-spacing2: 100px;
|
||||||
|
--hashtag-vertical-spacing3: 100px;
|
||||||
|
--hashtag-vertical-spacing4: 150px;
|
||||||
|
--hashtag-size1: 30px;
|
||||||
|
--hashtag-size2: 40px;
|
||||||
|
--follow-text-size1: 24px;
|
||||||
|
--follow-text-size2: 40px;
|
||||||
|
--follow-text-entry-width: 90%;
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Bedstead';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: normal;
|
||||||
|
font-display: block;
|
||||||
|
src: url('./fonts/bedstead.otf') format('opentype');
|
||||||
|
}
|
||||||
|
|
||||||
|
body, html {
|
||||||
|
background-image: url("options-background.jpg");
|
||||||
|
background-size: cover;
|
||||||
|
-webkit-background-size: cover;
|
||||||
|
-moz-background-size: cover;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-position: center;
|
||||||
|
background-color: var(--main-bg-color);
|
||||||
|
color: var(--main-fg-color);
|
||||||
|
|
||||||
|
height: 100%;
|
||||||
|
font-family: Arial, Helvetica, sans-serif;
|
||||||
|
max-width: 100%;
|
||||||
|
min-width: 600px;
|
||||||
|
margin: 5% auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
a, u {
|
||||||
|
color: var(--main-fg-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
a:visited{
|
||||||
|
color: var(--main-visited-color);
|
||||||
|
background: var(--link-bg-color);
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:link {
|
||||||
|
color: var(--main-link-color);
|
||||||
|
background: var(--link-bg-color);
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.follow {
|
||||||
|
height: 100%;
|
||||||
|
position: relative;
|
||||||
|
background-color: var(--main-bg-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
.followAvatar {
|
||||||
|
margin: 0% 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.followAvatar img {
|
||||||
|
border-radius: 10%;
|
||||||
|
width: 20%;
|
||||||
|
min-width: 200px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.followText {
|
||||||
|
font-size: var(--font-size);
|
||||||
|
font-family: Arial, Helvetica, sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
.imText {
|
||||||
|
font-size: var(--font-size4);
|
||||||
|
font-family: Arial, Helvetica, sans-serif;
|
||||||
|
color: var(--main-link-color);
|
||||||
|
background: var(--link-bg-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
.pgp {
|
||||||
|
font-size: var(--font-size5);
|
||||||
|
font-family: Arial, Helvetica, sans-serif;
|
||||||
|
color: var(--main-link-color);
|
||||||
|
background: var(--link-bg-color);
|
||||||
|
font-family: 'monospace';
|
||||||
|
}
|
||||||
|
|
||||||
|
.button {
|
||||||
|
border-radius: 4px;
|
||||||
|
background-color: var(--button-background);
|
||||||
|
border: none;
|
||||||
|
color: var(--button-text);
|
||||||
|
text-align: center;
|
||||||
|
padding: 10px;
|
||||||
|
font-size: var(--font-size);
|
||||||
|
font-family: Arial, Helvetica, sans-serif;
|
||||||
|
width: 20%;
|
||||||
|
max-width: 200px;
|
||||||
|
min-width: 100px;
|
||||||
|
cursor: pointer;
|
||||||
|
margin: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button:hover {
|
||||||
|
background-color: #555;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type=text] {
|
||||||
|
width: var(--follow-text-entry-width);
|
||||||
|
clear: both;
|
||||||
|
font-size: var(--font-size);
|
||||||
|
font-family: Arial, Helvetica, sans-serif;
|
||||||
|
text-align: center;
|
||||||
|
color: var(--text-entry-foreground);
|
||||||
|
background-color: var(--text-entry-background);
|
||||||
|
}
|
||||||
|
|
||||||
|
.options {
|
||||||
|
font-size: var(--font-size);
|
||||||
|
font-family: Arial, Helvetica, sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
.options img {
|
||||||
|
width: 15%;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (min-width: 400px) {
|
||||||
|
.followText {
|
||||||
|
font-size: var(--follow-text-size1);
|
||||||
|
font-family: Arial, Helvetica, sans-serif;
|
||||||
|
}
|
||||||
|
input[type=text] {
|
||||||
|
width: var(--follow-text-entry-width);
|
||||||
|
clear: both;
|
||||||
|
font-size: 24px;
|
||||||
|
font-family: Arial, Helvetica, sans-serif;
|
||||||
|
text-align: center;
|
||||||
|
color: var(--text-entry-foreground);
|
||||||
|
background-color: var(--text-entry-background);
|
||||||
|
}
|
||||||
|
.button {
|
||||||
|
border-radius: 4px;
|
||||||
|
background-color: var(--button-background);
|
||||||
|
border: none;
|
||||||
|
color: var(--button-text);
|
||||||
|
text-align: center;
|
||||||
|
padding: 10px;
|
||||||
|
font-size: 24px;
|
||||||
|
font-family: Arial, Helvetica, sans-serif;
|
||||||
|
width: 20%;
|
||||||
|
max-width: 200px;
|
||||||
|
min-width: 100px;
|
||||||
|
cursor: pointer;
|
||||||
|
margin: 30px;
|
||||||
|
}
|
||||||
|
input[type=checkbox]
|
||||||
|
{
|
||||||
|
-ms-transform: scale(2);
|
||||||
|
-moz-transform: scale(2);
|
||||||
|
-webkit-transform: scale(2);
|
||||||
|
-o-transform: scale(2);
|
||||||
|
transform: scale(2);
|
||||||
|
padding: 10px;
|
||||||
|
margin: 20px 30px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (max-width: 1000px) {
|
||||||
|
.followText {
|
||||||
|
font-size: var(--follow-text-size2);
|
||||||
|
font-family: Arial, Helvetica, sans-serif;
|
||||||
|
}
|
||||||
|
input[type=text] {
|
||||||
|
width: var(--follow-text-entry-width);
|
||||||
|
clear: both;
|
||||||
|
font-size: 40px;
|
||||||
|
font-family: Arial, Helvetica, sans-serif;
|
||||||
|
text-align: center;
|
||||||
|
color: var(--text-entry-foreground);
|
||||||
|
background-color: var(--text-entry-background);
|
||||||
|
}
|
||||||
|
.button {
|
||||||
|
border-radius: 4px;
|
||||||
|
background-color: var(--button-background);
|
||||||
|
border: none;
|
||||||
|
color: var(--button-text);
|
||||||
|
text-align: center;
|
||||||
|
padding: 10px;
|
||||||
|
font-size: 40px;
|
||||||
|
font-family: Arial, Helvetica, sans-serif;
|
||||||
|
width: 20%;
|
||||||
|
max-width: 200px;
|
||||||
|
min-width: 100px;
|
||||||
|
cursor: pointer;
|
||||||
|
margin: 30px;
|
||||||
|
}
|
||||||
|
input[type=checkbox]
|
||||||
|
{
|
||||||
|
-ms-transform: scale(4);
|
||||||
|
-moz-transform: scale(4);
|
||||||
|
-webkit-transform: scale(4);
|
||||||
|
-o-transform: scale(4);
|
||||||
|
transform: scale(4);
|
||||||
|
padding: 20px;
|
||||||
|
margin: 30px 40px;
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 98 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 98 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 98 KiB |
172
theme.py
172
theme.py
|
|
@ -14,7 +14,8 @@ from shutil import copyfile
|
||||||
|
|
||||||
def getThemeFiles() -> []:
|
def getThemeFiles() -> []:
|
||||||
return ('epicyon.css', 'login.css', 'follow.css',
|
return ('epicyon.css', 'login.css', 'follow.css',
|
||||||
'suspended.css', 'calendar.css', 'blog.css')
|
'suspended.css', 'calendar.css', 'blog.css',
|
||||||
|
'options.css')
|
||||||
|
|
||||||
|
|
||||||
def getThemesList() -> []:
|
def getThemesList() -> []:
|
||||||
|
|
@ -88,7 +89,8 @@ def setCSSparam(css: str, param: str, value: str) -> str:
|
||||||
return newcss.strip()
|
return newcss.strip()
|
||||||
|
|
||||||
|
|
||||||
def setThemeFromDict(baseDir: str, name: str, themeParams: {}) -> None:
|
def setThemeFromDict(baseDir: str, name: str,
|
||||||
|
themeParams: {}, bgParams: {}) -> None:
|
||||||
"""Uses a dictionary to set a theme
|
"""Uses a dictionary to set a theme
|
||||||
"""
|
"""
|
||||||
if name:
|
if name:
|
||||||
|
|
@ -108,6 +110,29 @@ def setThemeFromDict(baseDir: str, name: str, themeParams: {}) -> None:
|
||||||
with open(filename, 'w+') as cssfile:
|
with open(filename, 'w+') as cssfile:
|
||||||
cssfile.write(css)
|
cssfile.write(css)
|
||||||
|
|
||||||
|
if bgParams.get('login'):
|
||||||
|
setBackgroundFormat(baseDir, name, 'login', bgParams['login'])
|
||||||
|
if bgParams.get('follow'):
|
||||||
|
setBackgroundFormat(baseDir, name, 'login', bgParams['follow'])
|
||||||
|
if bgParams.get('options'):
|
||||||
|
setBackgroundFormat(baseDir, name, 'login', bgParams['options'])
|
||||||
|
|
||||||
|
|
||||||
|
def setBackgroundFormat(baseDir: str, name: str,
|
||||||
|
backgroundType: str, extension: str) -> None:
|
||||||
|
"""Sets the background file extension
|
||||||
|
"""
|
||||||
|
if extension == 'jpg':
|
||||||
|
return
|
||||||
|
cssFilename = baseDir + '/' + backgroundType + '.css'
|
||||||
|
if not os.path.isfile(cssFilename):
|
||||||
|
return
|
||||||
|
with open(cssFilename, 'r') as cssfile:
|
||||||
|
css = cssfile.read()
|
||||||
|
css = css.replace('background.jpg', 'background.' + extension)
|
||||||
|
with open(cssFilename, 'w+') as cssfile2:
|
||||||
|
cssfile2.write(css)
|
||||||
|
|
||||||
|
|
||||||
def enableGrayscale(baseDir: str) -> None:
|
def enableGrayscale(baseDir: str) -> None:
|
||||||
"""Enables grayscale for the current theme
|
"""Enables grayscale for the current theme
|
||||||
|
|
@ -192,17 +217,24 @@ def setCustomFont(baseDir: str):
|
||||||
|
|
||||||
|
|
||||||
def setThemeDefault(baseDir: str):
|
def setThemeDefault(baseDir: str):
|
||||||
|
name = 'default'
|
||||||
removeTheme(baseDir)
|
removeTheme(baseDir)
|
||||||
setThemeInConfig(baseDir, 'default')
|
setThemeInConfig(baseDir, name)
|
||||||
themeParams = {
|
themeParams = {
|
||||||
"dummyValue": "1234"
|
"dummyValue": "1234"
|
||||||
}
|
}
|
||||||
setThemeFromDict(baseDir, 'default', themeParams)
|
bgParams = {
|
||||||
|
"login": 'jpg',
|
||||||
|
"follow": 'jpg',
|
||||||
|
"options": 'jpg'
|
||||||
|
}
|
||||||
|
setThemeFromDict(baseDir, name, themeParams, bgParams)
|
||||||
|
|
||||||
|
|
||||||
def setThemeBlue(baseDir: str):
|
def setThemeBlue(baseDir: str):
|
||||||
|
name = 'blue'
|
||||||
removeTheme(baseDir)
|
removeTheme(baseDir)
|
||||||
setThemeInConfig(baseDir, 'blue')
|
setThemeInConfig(baseDir, name)
|
||||||
themeParams = {
|
themeParams = {
|
||||||
"font-size-header": "22px",
|
"font-size-header": "22px",
|
||||||
"font-size-header-mobile": "32px",
|
"font-size-header-mobile": "32px",
|
||||||
|
|
@ -225,12 +257,18 @@ def setThemeBlue(baseDir: str):
|
||||||
"*font-family": "'Domestic_Manners'",
|
"*font-family": "'Domestic_Manners'",
|
||||||
"*src": "url('./fonts/Domestic_Manners.woff2') format('woff2')"
|
"*src": "url('./fonts/Domestic_Manners.woff2') format('woff2')"
|
||||||
}
|
}
|
||||||
setThemeFromDict(baseDir, 'blue', themeParams)
|
bgParams = {
|
||||||
|
"login": 'jpg',
|
||||||
|
"follow": 'jpg',
|
||||||
|
"options": 'jpg'
|
||||||
|
}
|
||||||
|
setThemeFromDict(baseDir, name, themeParams, bgParams)
|
||||||
|
|
||||||
|
|
||||||
def setThemeNight(baseDir: str):
|
def setThemeNight(baseDir: str):
|
||||||
|
name = 'night'
|
||||||
removeTheme(baseDir)
|
removeTheme(baseDir)
|
||||||
setThemeInConfig(baseDir, 'night')
|
setThemeInConfig(baseDir, name)
|
||||||
fontStr = \
|
fontStr = \
|
||||||
"url('./fonts/CheGuevaraTextSans-Regular.woff2') format('woff2')"
|
"url('./fonts/CheGuevaraTextSans-Regular.woff2') format('woff2')"
|
||||||
themeParams = {
|
themeParams = {
|
||||||
|
|
@ -263,12 +301,18 @@ def setThemeNight(baseDir: str):
|
||||||
"*font-family": "'CheGuevaraTextSans-Regular'",
|
"*font-family": "'CheGuevaraTextSans-Regular'",
|
||||||
"*src": fontStr
|
"*src": fontStr
|
||||||
}
|
}
|
||||||
setThemeFromDict(baseDir, 'night', themeParams)
|
bgParams = {
|
||||||
|
"login": 'jpg',
|
||||||
|
"follow": 'jpg',
|
||||||
|
"options": 'jpg'
|
||||||
|
}
|
||||||
|
setThemeFromDict(baseDir, name, themeParams, bgParams)
|
||||||
|
|
||||||
|
|
||||||
def setThemeStarlight(baseDir: str):
|
def setThemeStarlight(baseDir: str):
|
||||||
|
name = 'starlight'
|
||||||
removeTheme(baseDir)
|
removeTheme(baseDir)
|
||||||
setThemeInConfig(baseDir, 'starlight')
|
setThemeInConfig(baseDir, name)
|
||||||
themeParams = {
|
themeParams = {
|
||||||
"font-size-button-mobile": "36px",
|
"font-size-button-mobile": "36px",
|
||||||
"font-size": "32px",
|
"font-size": "32px",
|
||||||
|
|
@ -310,12 +354,18 @@ def setThemeStarlight(baseDir: str):
|
||||||
"*font-family": "'bgrove'",
|
"*font-family": "'bgrove'",
|
||||||
"*src": "url('fonts/bgrove.woff2') format('woff2')"
|
"*src": "url('fonts/bgrove.woff2') format('woff2')"
|
||||||
}
|
}
|
||||||
setThemeFromDict(baseDir, 'starlight', themeParams)
|
bgParams = {
|
||||||
|
"login": 'jpg',
|
||||||
|
"follow": 'jpg',
|
||||||
|
"options": 'jpg'
|
||||||
|
}
|
||||||
|
setThemeFromDict(baseDir, name, themeParams, bgParams)
|
||||||
|
|
||||||
|
|
||||||
def setThemeHenge(baseDir: str):
|
def setThemeHenge(baseDir: str):
|
||||||
|
name = 'henge'
|
||||||
removeTheme(baseDir)
|
removeTheme(baseDir)
|
||||||
setThemeInConfig(baseDir, 'henge')
|
setThemeInConfig(baseDir, name)
|
||||||
themeParams = {
|
themeParams = {
|
||||||
"font-size-button-mobile": "36px",
|
"font-size-button-mobile": "36px",
|
||||||
"font-size": "32px",
|
"font-size": "32px",
|
||||||
|
|
@ -354,12 +404,18 @@ def setThemeHenge(baseDir: str):
|
||||||
"*font-family": "'bgrove'",
|
"*font-family": "'bgrove'",
|
||||||
"*src": "url('fonts/bgrove.woff2') format('woff2')"
|
"*src": "url('fonts/bgrove.woff2') format('woff2')"
|
||||||
}
|
}
|
||||||
setThemeFromDict(baseDir, 'henge', themeParams)
|
bgParams = {
|
||||||
|
"login": 'jpg',
|
||||||
|
"follow": 'jpg',
|
||||||
|
"options": 'jpg'
|
||||||
|
}
|
||||||
|
setThemeFromDict(baseDir, name, themeParams, bgParams)
|
||||||
|
|
||||||
|
|
||||||
def setThemeZen(baseDir: str):
|
def setThemeZen(baseDir: str):
|
||||||
|
name = 'zen'
|
||||||
removeTheme(baseDir)
|
removeTheme(baseDir)
|
||||||
setThemeInConfig(baseDir, 'zen')
|
setThemeInConfig(baseDir, name)
|
||||||
themeParams = {
|
themeParams = {
|
||||||
"main-bg-color": "#5c4e41",
|
"main-bg-color": "#5c4e41",
|
||||||
"text-entry-background": "#5c4e41",
|
"text-entry-background": "#5c4e41",
|
||||||
|
|
@ -378,10 +434,16 @@ def setThemeZen(baseDir: str):
|
||||||
"dropdown-bg-color": "#504e41",
|
"dropdown-bg-color": "#504e41",
|
||||||
"dropdown-bg-color-hover": "#444"
|
"dropdown-bg-color-hover": "#444"
|
||||||
}
|
}
|
||||||
setThemeFromDict(baseDir, 'zen', themeParams)
|
bgParams = {
|
||||||
|
"login": 'jpg',
|
||||||
|
"follow": 'jpg',
|
||||||
|
"options": 'jpg'
|
||||||
|
}
|
||||||
|
setThemeFromDict(baseDir, name, themeParams, bgParams)
|
||||||
|
|
||||||
|
|
||||||
def setThemeHighVis(baseDir: str):
|
def setThemeHighVis(baseDir: str):
|
||||||
|
name = 'highvis'
|
||||||
themeParams = {
|
themeParams = {
|
||||||
"font-size-header": "22px",
|
"font-size-header": "22px",
|
||||||
"font-size-header-mobile": "32px",
|
"font-size-header-mobile": "32px",
|
||||||
|
|
@ -398,10 +460,16 @@ def setThemeHighVis(baseDir: str):
|
||||||
"*font-family": "'LinBiolinum_Rah'",
|
"*font-family": "'LinBiolinum_Rah'",
|
||||||
"*src": "url('./fonts/LinBiolinum_Rah.woff2') format('woff2')"
|
"*src": "url('./fonts/LinBiolinum_Rah.woff2') format('woff2')"
|
||||||
}
|
}
|
||||||
setThemeFromDict(baseDir, 'highvis', themeParams)
|
bgParams = {
|
||||||
|
"login": 'jpg',
|
||||||
|
"follow": 'jpg',
|
||||||
|
"options": 'jpg'
|
||||||
|
}
|
||||||
|
setThemeFromDict(baseDir, name, themeParams, bgParams)
|
||||||
|
|
||||||
|
|
||||||
def setThemeLCD(baseDir: str):
|
def setThemeLCD(baseDir: str):
|
||||||
|
name = 'lcd'
|
||||||
themeParams = {
|
themeParams = {
|
||||||
"main-bg-color": "#9fb42b",
|
"main-bg-color": "#9fb42b",
|
||||||
"link-bg-color": "#33390d",
|
"link-bg-color": "#33390d",
|
||||||
|
|
@ -454,10 +522,16 @@ def setThemeLCD(baseDir: str):
|
||||||
"*font-family": "'LcdSolid'",
|
"*font-family": "'LcdSolid'",
|
||||||
"*src": "url('./fonts/LcdSolid.woff2') format('woff2')"
|
"*src": "url('./fonts/LcdSolid.woff2') format('woff2')"
|
||||||
}
|
}
|
||||||
setThemeFromDict(baseDir, 'lcd', themeParams)
|
bgParams = {
|
||||||
|
"login": 'jpg',
|
||||||
|
"follow": 'jpg',
|
||||||
|
"options": 'jpg'
|
||||||
|
}
|
||||||
|
setThemeFromDict(baseDir, name, themeParams, bgParams)
|
||||||
|
|
||||||
|
|
||||||
def setThemePurple(baseDir: str):
|
def setThemePurple(baseDir: str):
|
||||||
|
name = 'purple'
|
||||||
fontStr = \
|
fontStr = \
|
||||||
"url('./fonts/CheGuevaraTextSans-Regular.woff2') format('woff2')"
|
"url('./fonts/CheGuevaraTextSans-Regular.woff2') format('woff2')"
|
||||||
themeParams = {
|
themeParams = {
|
||||||
|
|
@ -497,10 +571,16 @@ def setThemePurple(baseDir: str):
|
||||||
"*font-family": "'CheGuevaraTextSans-Regular'",
|
"*font-family": "'CheGuevaraTextSans-Regular'",
|
||||||
"*src": fontStr
|
"*src": fontStr
|
||||||
}
|
}
|
||||||
setThemeFromDict(baseDir, 'purple', themeParams)
|
bgParams = {
|
||||||
|
"login": 'jpg',
|
||||||
|
"follow": 'jpg',
|
||||||
|
"options": 'jpg'
|
||||||
|
}
|
||||||
|
setThemeFromDict(baseDir, name, themeParams, bgParams)
|
||||||
|
|
||||||
|
|
||||||
def setThemeHacker(baseDir: str):
|
def setThemeHacker(baseDir: str):
|
||||||
|
name = 'hacker'
|
||||||
themeParams = {
|
themeParams = {
|
||||||
"main-bg-color": "black",
|
"main-bg-color": "black",
|
||||||
"link-bg-color": "black",
|
"link-bg-color": "black",
|
||||||
|
|
@ -536,10 +616,16 @@ def setThemeHacker(baseDir: str):
|
||||||
"event-color": "#00ff00",
|
"event-color": "#00ff00",
|
||||||
"image-corners": "0%"
|
"image-corners": "0%"
|
||||||
}
|
}
|
||||||
setThemeFromDict(baseDir, 'hacker', themeParams)
|
bgParams = {
|
||||||
|
"login": 'jpg',
|
||||||
|
"follow": 'jpg',
|
||||||
|
"options": 'jpg'
|
||||||
|
}
|
||||||
|
setThemeFromDict(baseDir, name, themeParams, bgParams)
|
||||||
|
|
||||||
|
|
||||||
def setThemeLight(baseDir: str):
|
def setThemeLight(baseDir: str):
|
||||||
|
name = 'light'
|
||||||
themeParams = {
|
themeParams = {
|
||||||
"font-size-button-mobile": "36px",
|
"font-size-button-mobile": "36px",
|
||||||
"font-size": "32px",
|
"font-size": "32px",
|
||||||
|
|
@ -582,7 +668,12 @@ def setThemeLight(baseDir: str):
|
||||||
"*font-family": "'ElectrumADFExp-Regular'",
|
"*font-family": "'ElectrumADFExp-Regular'",
|
||||||
"*src": "url('./fonts/ElectrumADFExp-Regular.otf') format('opentype')"
|
"*src": "url('./fonts/ElectrumADFExp-Regular.otf') format('opentype')"
|
||||||
}
|
}
|
||||||
setThemeFromDict(baseDir, 'light', themeParams)
|
bgParams = {
|
||||||
|
"login": 'jpg',
|
||||||
|
"follow": 'jpg',
|
||||||
|
"options": 'jpg'
|
||||||
|
}
|
||||||
|
setThemeFromDict(baseDir, name, themeParams, bgParams)
|
||||||
|
|
||||||
|
|
||||||
def setThemeImages(baseDir: str, name: str) -> None:
|
def setThemeImages(baseDir: str, name: str) -> None:
|
||||||
|
|
@ -605,10 +696,12 @@ def setThemeImages(baseDir: str, name: str) -> None:
|
||||||
baseDir + '/img/banner_' + themeNameLower + '.png'
|
baseDir + '/img/banner_' + themeNameLower + '.png'
|
||||||
searchBannerFilename = \
|
searchBannerFilename = \
|
||||||
baseDir + '/img/search_banner_' + themeNameLower + '.png'
|
baseDir + '/img/search_banner_' + themeNameLower + '.png'
|
||||||
if os.path.isfile(profileImageFilename) and \
|
|
||||||
os.path.isfile(bannerFilename):
|
backgroundNames = ('login', 'shares', 'delete', 'follow',
|
||||||
for subdir, dirs, files in os.walk(baseDir +
|
'options', 'block', 'search', 'calendar')
|
||||||
'/accounts'):
|
extensions = ('webp', 'gif', 'jpg', 'png')
|
||||||
|
|
||||||
|
for subdir, dirs, files in os.walk(baseDir + '/accounts'):
|
||||||
for acct in dirs:
|
for acct in dirs:
|
||||||
if '@' not in acct:
|
if '@' not in acct:
|
||||||
continue
|
continue
|
||||||
|
|
@ -617,6 +710,39 @@ def setThemeImages(baseDir: str, name: str) -> None:
|
||||||
accountDir = \
|
accountDir = \
|
||||||
os.path.join(baseDir + '/accounts', acct)
|
os.path.join(baseDir + '/accounts', acct)
|
||||||
|
|
||||||
|
for backgroundType in backgroundNames:
|
||||||
|
for ext in extensions:
|
||||||
|
if themeNameLower == 'default':
|
||||||
|
backgroundImageFilename = \
|
||||||
|
baseDir + '/img/' + backgroundType + \
|
||||||
|
'-background.' + ext
|
||||||
|
else:
|
||||||
|
backgroundImageFilename = \
|
||||||
|
baseDir + '/img/' + backgroundType + \
|
||||||
|
'_background_' + themeNameLower + '.' + ext
|
||||||
|
|
||||||
|
if os.path.isfile(backgroundImageFilename):
|
||||||
|
try:
|
||||||
|
copyfile(backgroundImageFilename,
|
||||||
|
baseDir + '/accounts/' + backgroundType +
|
||||||
|
'-background.' + ext)
|
||||||
|
continue
|
||||||
|
except BaseException:
|
||||||
|
pass
|
||||||
|
# background image was not found
|
||||||
|
# so remove any existing file
|
||||||
|
if os.path.isfile(baseDir + '/accounts/' +
|
||||||
|
backgroundType +
|
||||||
|
'-background.' + ext):
|
||||||
|
try:
|
||||||
|
os.remove(baseDir + '/accounts/' +
|
||||||
|
backgroundType +
|
||||||
|
'-background.' + ext)
|
||||||
|
except BaseException:
|
||||||
|
pass
|
||||||
|
|
||||||
|
if os.path.isfile(profileImageFilename) and \
|
||||||
|
os.path.isfile(bannerFilename):
|
||||||
try:
|
try:
|
||||||
copyfile(profileImageFilename,
|
copyfile(profileImageFilename,
|
||||||
accountDir + '/image.png')
|
accountDir + '/image.png')
|
||||||
|
|
|
||||||
134
webinterface.py
134
webinterface.py
|
|
@ -1580,10 +1580,11 @@ def htmlLogin(translate: {}, baseDir: str, autocomplete=True) -> str:
|
||||||
if not loginImageFilename:
|
if not loginImageFilename:
|
||||||
loginImageFilename = baseDir + '/accounts/' + loginImage
|
loginImageFilename = baseDir + '/accounts/' + loginImage
|
||||||
copyfile(baseDir + '/img/login.png', loginImageFilename)
|
copyfile(baseDir + '/img/login.png', loginImageFilename)
|
||||||
if os.path.isfile(baseDir + '/img/login-background.png'):
|
|
||||||
if not os.path.isfile(baseDir + '/accounts/login-background.png'):
|
if os.path.isfile(baseDir + '/accounts/login-background-custom.jpg'):
|
||||||
copyfile(baseDir + '/img/login-background.png',
|
if not os.path.isfile(baseDir + '/accounts/login-background.jpg'):
|
||||||
baseDir + '/accounts/login-background.png')
|
copyfile(baseDir + '/accounts/login-background-custom.jpg',
|
||||||
|
baseDir + '/accounts/login-background.jpg')
|
||||||
|
|
||||||
if accounts > 0:
|
if accounts > 0:
|
||||||
loginText = \
|
loginText = \
|
||||||
|
|
@ -1661,7 +1662,7 @@ def htmlLogin(translate: {}, baseDir: str, autocomplete=True) -> str:
|
||||||
' <input type="password" ' + autocompleteStr + \
|
' <input type="password" ' + autocompleteStr + \
|
||||||
' placeholder="' + translate['Enter Password'] + \
|
' placeholder="' + translate['Enter Password'] + \
|
||||||
'" name="password" required>'
|
'" name="password" required>'
|
||||||
loginForm += registerButtonStr + loginButtonStr
|
loginForm += loginButtonStr + registerButtonStr
|
||||||
loginForm += ' </div>'
|
loginForm += ' </div>'
|
||||||
loginForm += '</form>'
|
loginForm += '</form>'
|
||||||
loginForm += \
|
loginForm += \
|
||||||
|
|
@ -1680,10 +1681,11 @@ def htmlTermsOfService(baseDir: str, httpPrefix: str, domainFull: str) -> str:
|
||||||
if not os.path.isfile(baseDir + '/accounts/tos.txt'):
|
if not os.path.isfile(baseDir + '/accounts/tos.txt'):
|
||||||
copyfile(baseDir + '/default_tos.txt',
|
copyfile(baseDir + '/default_tos.txt',
|
||||||
baseDir + '/accounts/tos.txt')
|
baseDir + '/accounts/tos.txt')
|
||||||
if os.path.isfile(baseDir + '/img/login-background.png'):
|
|
||||||
if not os.path.isfile(baseDir + '/accounts/login-background.png'):
|
if os.path.isfile(baseDir + '/accounts/login-background-custom.jpg'):
|
||||||
copyfile(baseDir + '/img/login-background.png',
|
if not os.path.isfile(baseDir + '/accounts/login-background.jpg'):
|
||||||
baseDir + '/accounts/login-background.png')
|
copyfile(baseDir + '/accounts/login-background-custom.jpg',
|
||||||
|
baseDir + '/accounts/login-background.jpg')
|
||||||
|
|
||||||
TOSText = 'Terms of Service go here.'
|
TOSText = 'Terms of Service go here.'
|
||||||
if os.path.isfile(baseDir + '/accounts/tos.txt'):
|
if os.path.isfile(baseDir + '/accounts/tos.txt'):
|
||||||
|
|
@ -1720,35 +1722,35 @@ def htmlAbout(baseDir: str, httpPrefix: str,
|
||||||
if not os.path.isfile(baseDir + '/accounts/about.txt'):
|
if not os.path.isfile(baseDir + '/accounts/about.txt'):
|
||||||
copyfile(baseDir + '/default_about.txt',
|
copyfile(baseDir + '/default_about.txt',
|
||||||
baseDir + '/accounts/about.txt')
|
baseDir + '/accounts/about.txt')
|
||||||
if os.path.isfile(baseDir + '/img/login-background.png'):
|
|
||||||
if not os.path.isfile(baseDir + '/accounts/login-background.png'):
|
if os.path.isfile(baseDir + '/accounts/login-background-custom.jpg'):
|
||||||
copyfile(baseDir + '/img/login-background.png',
|
if not os.path.isfile(baseDir + '/accounts/login-background.jpg'):
|
||||||
baseDir + '/accounts/login-background.png')
|
copyfile(baseDir + '/accounts/login-background-custom.jpg',
|
||||||
|
baseDir + '/accounts/login-background.jpg')
|
||||||
|
|
||||||
aboutText = 'Information about this instance goes here.'
|
aboutText = 'Information about this instance goes here.'
|
||||||
if os.path.isfile(baseDir + '/accounts/about.txt'):
|
if os.path.isfile(baseDir + '/accounts/about.txt'):
|
||||||
with open(baseDir + '/accounts/about.txt', 'r') as file:
|
with open(baseDir + '/accounts/about.txt', 'r') as aboutFile:
|
||||||
aboutText = file.read()
|
aboutText = aboutFile.read()
|
||||||
|
|
||||||
aboutForm = ''
|
aboutForm = ''
|
||||||
cssFilename = baseDir + '/epicyon-profile.css'
|
cssFilename = baseDir + '/epicyon-profile.css'
|
||||||
if os.path.isfile(baseDir + '/epicyon.css'):
|
if os.path.isfile(baseDir + '/epicyon.css'):
|
||||||
cssFilename = baseDir + '/epicyon.css'
|
cssFilename = baseDir + '/epicyon.css'
|
||||||
with open(cssFilename, 'r') as cssFile:
|
with open(cssFilename, 'r') as cssFile:
|
||||||
termsCSS = cssFile.read()
|
aboutCSS = cssFile.read()
|
||||||
if httpPrefix != 'http':
|
if httpPrefix != 'http':
|
||||||
termsCSS = termsCSS.replace('https://',
|
aboutCSS = aboutCSS.replace('https://',
|
||||||
httpPrefix + '://')
|
httpPrefix + '://')
|
||||||
|
|
||||||
aboutForm = htmlHeader(cssFilename, termsCSS)
|
aboutForm = htmlHeader(cssFilename, aboutCSS)
|
||||||
aboutForm += '<div class="container">' + aboutText + '</div>'
|
aboutForm += '<div class="container">' + aboutText + '</div>'
|
||||||
if onionDomain:
|
if onionDomain:
|
||||||
aboutForm += \
|
aboutForm += \
|
||||||
'<div class="container"><center><p class="administeredby">' + \
|
'<div class="container"><center><p class="administeredby">' + \
|
||||||
'http://' + onionDomain + '</p></center></div>'
|
'http://' + onionDomain + '</p></center></div>'
|
||||||
if adminNickname:
|
if adminNickname:
|
||||||
adminActor = \
|
adminActor = '/users/' + adminNickname
|
||||||
httpPrefix + '://' + domainFull + '/users/' + adminNickname
|
|
||||||
aboutForm += \
|
aboutForm += \
|
||||||
'<div class="container"><center>' + \
|
'<div class="container"><center>' + \
|
||||||
'<p class="administeredby">Administered by <a href="' + \
|
'<p class="administeredby">Administered by <a href="' + \
|
||||||
|
|
@ -5340,10 +5342,10 @@ def htmlFollowConfirm(translate: {}, baseDir: str,
|
||||||
"""
|
"""
|
||||||
followDomain, port = getDomainFromActor(followActor)
|
followDomain, port = getDomainFromActor(followActor)
|
||||||
|
|
||||||
if os.path.isfile(baseDir + '/img/follow-background.png'):
|
if os.path.isfile(baseDir + '/accounts/follow-background-custom.jpg'):
|
||||||
if not os.path.isfile(baseDir + '/accounts/follow-background.png'):
|
if not os.path.isfile(baseDir + '/accounts/follow-background.jpg'):
|
||||||
copyfile(baseDir + '/img/follow-background.png',
|
copyfile(baseDir + '/accounts/follow-background-custom.jpg',
|
||||||
baseDir + '/accounts/follow-background.png')
|
baseDir + '/accounts/follow-background.jpg')
|
||||||
|
|
||||||
cssFilename = baseDir + '/epicyon-follow.css'
|
cssFilename = baseDir + '/epicyon-follow.css'
|
||||||
if os.path.isfile(baseDir + '/follow.css'):
|
if os.path.isfile(baseDir + '/follow.css'):
|
||||||
|
|
@ -5385,10 +5387,10 @@ def htmlUnfollowConfirm(translate: {}, baseDir: str,
|
||||||
"""
|
"""
|
||||||
followDomain, port = getDomainFromActor(followActor)
|
followDomain, port = getDomainFromActor(followActor)
|
||||||
|
|
||||||
if os.path.isfile(baseDir + '/img/follow-background.png'):
|
if os.path.isfile(baseDir + '/accounts/follow-background-custom.jpg'):
|
||||||
if not os.path.isfile(baseDir + '/accounts/follow-background.png'):
|
if not os.path.isfile(baseDir + '/accounts/follow-background.jpg'):
|
||||||
copyfile(baseDir + '/img/follow-background.png',
|
copyfile(baseDir + '/accounts/follow-background-custom.jpg',
|
||||||
baseDir + '/accounts/follow-background.png')
|
baseDir + '/accounts/follow-background.jpg')
|
||||||
|
|
||||||
cssFilename = baseDir + '/epicyon-follow.css'
|
cssFilename = baseDir + '/epicyon-follow.css'
|
||||||
if os.path.isfile(baseDir + '/follow.css'):
|
if os.path.isfile(baseDir + '/follow.css'):
|
||||||
|
|
@ -5445,10 +5447,10 @@ def htmlPersonOptions(translate: {}, baseDir: str,
|
||||||
if optionsPort != 80 and optionsPort != 443:
|
if optionsPort != 80 and optionsPort != 443:
|
||||||
optionsDomainFull = optionsDomain + ':' + str(optionsPort)
|
optionsDomainFull = optionsDomain + ':' + str(optionsPort)
|
||||||
|
|
||||||
if os.path.isfile(baseDir + '/img/options-background.png'):
|
if os.path.isfile(baseDir + '/accounts/options-background-custom.jpg'):
|
||||||
if not os.path.isfile(baseDir + '/accounts/options-background.png'):
|
if not os.path.isfile(baseDir + '/accounts/options-background.jpg'):
|
||||||
copyfile(baseDir + '/img/options-background.png',
|
copyfile(baseDir + '/accounts/options-background.jpg',
|
||||||
baseDir + '/accounts/options-background.png')
|
baseDir + '/accounts/options-background.jpg')
|
||||||
|
|
||||||
followStr = 'Follow'
|
followStr = 'Follow'
|
||||||
blockStr = 'Block'
|
blockStr = 'Block'
|
||||||
|
|
@ -5478,9 +5480,9 @@ def htmlPersonOptions(translate: {}, baseDir: str,
|
||||||
optionsLinkStr = \
|
optionsLinkStr = \
|
||||||
' <input type="hidden" name="postUrl" value="' + \
|
' <input type="hidden" name="postUrl" value="' + \
|
||||||
optionsLink + '">'
|
optionsLink + '">'
|
||||||
cssFilename = baseDir + '/epicyon-follow.css'
|
cssFilename = baseDir + '/epicyon-options.css'
|
||||||
if os.path.isfile(baseDir + '/follow.css'):
|
if os.path.isfile(baseDir + '/options.css'):
|
||||||
cssFilename = baseDir + '/follow.css'
|
cssFilename = baseDir + '/options.css'
|
||||||
with open(cssFilename, 'r') as cssFile:
|
with open(cssFilename, 'r') as cssFile:
|
||||||
profileStyle = cssFile.read()
|
profileStyle = cssFile.read()
|
||||||
profileStyle = \
|
profileStyle = \
|
||||||
|
|
@ -5501,61 +5503,63 @@ def htmlPersonOptions(translate: {}, baseDir: str,
|
||||||
translate['Donate'] + '</button></a>'
|
translate['Donate'] + '</button></a>'
|
||||||
|
|
||||||
optionsStr = htmlHeader(cssFilename, profileStyle)
|
optionsStr = htmlHeader(cssFilename, profileStyle)
|
||||||
optionsStr += '<div class="options">'
|
optionsStr += '<div class="options">\n'
|
||||||
optionsStr += ' <div class="optionsAvatar">'
|
optionsStr += ' <div class="optionsAvatar">\n'
|
||||||
optionsStr += ' <center>'
|
optionsStr += ' <center>\n'
|
||||||
optionsStr += ' <a href="' + optionsActor + '">'
|
optionsStr += ' <a href="' + optionsActor + '">\n'
|
||||||
optionsStr += ' <img loading="lazy" src="' + optionsProfileUrl + '"/></a>'
|
optionsStr += ' <img loading="lazy" src="' + optionsProfileUrl + \
|
||||||
|
'"/></a>\n'
|
||||||
optionsStr += \
|
optionsStr += \
|
||||||
' <p class="optionsText">' + translate['Options for'] + \
|
' <p class="optionsText">' + translate['Options for'] + \
|
||||||
' @' + getNicknameFromActor(optionsActor) + '@' + \
|
' @' + getNicknameFromActor(optionsActor) + '@' + \
|
||||||
optionsDomain + '</p>'
|
optionsDomain + '</p>\n'
|
||||||
if emailAddress:
|
if emailAddress:
|
||||||
optionsStr += \
|
optionsStr += \
|
||||||
'<p class="imText">' + translate['Email'] + \
|
'<p class="imText">' + translate['Email'] + \
|
||||||
': <a href="mailto:' + \
|
': <a href="mailto:' + \
|
||||||
emailAddress + '">' + emailAddress + '</a></p>'
|
emailAddress + '">' + emailAddress + '</a></p>\n'
|
||||||
if xmppAddress:
|
if xmppAddress:
|
||||||
optionsStr += \
|
optionsStr += \
|
||||||
'<p class="imText">' + translate['XMPP'] + \
|
'<p class="imText">' + translate['XMPP'] + \
|
||||||
': <a href="xmpp:' + xmppAddress + '">' + xmppAddress + '</a></p>'
|
': <a href="xmpp:' + xmppAddress + '">' + \
|
||||||
|
xmppAddress + '</a></p>\n'
|
||||||
if matrixAddress:
|
if matrixAddress:
|
||||||
optionsStr += \
|
optionsStr += \
|
||||||
'<p class="imText">' + translate['Matrix'] + ': ' + \
|
'<p class="imText">' + translate['Matrix'] + ': ' + \
|
||||||
matrixAddress + '</p>'
|
matrixAddress + '</p>\n'
|
||||||
if ssbAddress:
|
if ssbAddress:
|
||||||
optionsStr += \
|
optionsStr += \
|
||||||
'<p class="imText">SSB: ' + ssbAddress + '</p>'
|
'<p class="imText">SSB: ' + ssbAddress + '</p>\n'
|
||||||
if blogAddress:
|
if blogAddress:
|
||||||
optionsStr += \
|
optionsStr += \
|
||||||
'<p class="imText">Blog: <a href="' + blogAddress + '">' + \
|
'<p class="imText">Blog: <a href="' + blogAddress + '">' + \
|
||||||
blogAddress + '</a></p>'
|
blogAddress + '</a></p>\n'
|
||||||
if toxAddress:
|
if toxAddress:
|
||||||
optionsStr += \
|
optionsStr += \
|
||||||
'<p class="imText">Tox: ' + toxAddress + '</p>'
|
'<p class="imText">Tox: ' + toxAddress + '</p>\n'
|
||||||
if PGPfingerprint:
|
if PGPfingerprint:
|
||||||
optionsStr += '<p class="pgp">PGP: ' + \
|
optionsStr += '<p class="pgp">PGP: ' + \
|
||||||
PGPfingerprint.replace('\n', '<br>') + '</p>'
|
PGPfingerprint.replace('\n', '<br>') + '</p>\n'
|
||||||
if PGPpubKey:
|
if PGPpubKey:
|
||||||
optionsStr += '<p class="pgp">' + \
|
optionsStr += '<p class="pgp">' + \
|
||||||
PGPpubKey.replace('\n', '<br>') + '</p>'
|
PGPpubKey.replace('\n', '<br>') + '</p>\n'
|
||||||
optionsStr += ' <form method="POST" action="' + \
|
optionsStr += ' <form method="POST" action="' + \
|
||||||
originPathStr + '/personoptions">'
|
originPathStr + '/personoptions">\n'
|
||||||
optionsStr += ' <input type="hidden" name="pageNumber" value="' + \
|
optionsStr += ' <input type="hidden" name="pageNumber" value="' + \
|
||||||
str(pageNumber) + '">'
|
str(pageNumber) + '">\n'
|
||||||
optionsStr += ' <input type="hidden" name="actor" value="' + \
|
optionsStr += ' <input type="hidden" name="actor" value="' + \
|
||||||
optionsActor + '">'
|
optionsActor + '">\n'
|
||||||
optionsStr += ' <input type="hidden" name="avatarUrl" value="' + \
|
optionsStr += ' <input type="hidden" name="avatarUrl" value="' + \
|
||||||
optionsProfileUrl + '">'
|
optionsProfileUrl + '">\n'
|
||||||
if optionsNickname:
|
if optionsNickname:
|
||||||
handle = optionsNickname + '@' + optionsDomainFull
|
handle = optionsNickname + '@' + optionsDomainFull
|
||||||
petname = getPetName(baseDir, nickname, domain, handle)
|
petname = getPetName(baseDir, nickname, domain, handle)
|
||||||
optionsStr += \
|
optionsStr += \
|
||||||
translate['Petname'] + ': ' + \
|
translate['Petname'] + ': ' + \
|
||||||
'<input type="text" name="optionpetname" value="' + \
|
'<input type="text" name="optionpetname" value="' + \
|
||||||
petname + '">' \
|
petname + '">\n' \
|
||||||
'<button type="submit" class="button" name="submitPetname">' + \
|
'<button type="submit" class="button" name="submitPetname">' + \
|
||||||
translate['Submit'] + '</button><br>'
|
translate['Submit'] + '</button><br>\n'
|
||||||
|
|
||||||
if isFollowingActor(baseDir, nickname, domain, optionsActor):
|
if isFollowingActor(baseDir, nickname, domain, optionsActor):
|
||||||
if receivingCalendarEvents(baseDir, nickname, domain,
|
if receivingCalendarEvents(baseDir, nickname, domain,
|
||||||
|
|
@ -5579,28 +5583,28 @@ def htmlPersonOptions(translate: {}, baseDir: str,
|
||||||
optionsStr += optionsLinkStr
|
optionsStr += optionsLinkStr
|
||||||
optionsStr += \
|
optionsStr += \
|
||||||
' <button type="submit" class="button" name="submitView">' + \
|
' <button type="submit" class="button" name="submitView">' + \
|
||||||
translate['View'] + '</button>'
|
translate['View'] + '</button>\n'
|
||||||
optionsStr += donateStr
|
optionsStr += donateStr
|
||||||
optionsStr += \
|
optionsStr += \
|
||||||
' <button type="submit" class="button" name="submit' + \
|
' <button type="submit" class="button" name="submit' + \
|
||||||
followStr + '">' + translate[followStr] + '</button>'
|
followStr + '">' + translate[followStr] + '</button>\n'
|
||||||
optionsStr += \
|
optionsStr += \
|
||||||
' <button type="submit" class="button" name="submit' + \
|
' <button type="submit" class="button" name="submit' + \
|
||||||
blockStr + '">' + translate[blockStr] + '</button>'
|
blockStr + '">' + translate[blockStr] + '</button>\n'
|
||||||
optionsStr += \
|
optionsStr += \
|
||||||
' <button type="submit" class="button" name="submitDM">' + \
|
' <button type="submit" class="button" name="submitDM">' + \
|
||||||
translate['DM'] + '</button>'
|
translate['DM'] + '</button>\n'
|
||||||
optionsStr += \
|
optionsStr += \
|
||||||
' <button type="submit" class="button" name="submit' + \
|
' <button type="submit" class="button" name="submit' + \
|
||||||
snoozeButtonStr + '">' + translate[snoozeButtonStr] + '</button>'
|
snoozeButtonStr + '">' + translate[snoozeButtonStr] + '</button>\n'
|
||||||
optionsStr += \
|
optionsStr += \
|
||||||
' <button type="submit" class="button" name="submitReport">' + \
|
' <button type="submit" class="button" name="submitReport">' + \
|
||||||
translate['Report'] + '</button>'
|
translate['Report'] + '</button>\n'
|
||||||
|
|
||||||
optionsStr += ' </form>'
|
optionsStr += ' </form>\n'
|
||||||
optionsStr += '</center>'
|
optionsStr += '</center>\n'
|
||||||
optionsStr += '</div>'
|
optionsStr += '</div>\n'
|
||||||
optionsStr += '</div>'
|
optionsStr += '</div>\n'
|
||||||
optionsStr += htmlFooter()
|
optionsStr += htmlFooter()
|
||||||
return optionsStr
|
return optionsStr
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue