Merge branch 'main' of ssh://code.freedombone.net:2222/bashrc/epicyon into main
12
daemon.py
|
|
@ -8522,7 +8522,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
baseDir,
|
baseDir,
|
||||||
path, domain,
|
path, domain,
|
||||||
port,
|
port,
|
||||||
httpPrefix).encode('utf-8')
|
httpPrefix,
|
||||||
|
self.server.defaultTimeline).encode('utf-8')
|
||||||
if msg:
|
if msg:
|
||||||
self._set_headers('text/html', len(msg),
|
self._set_headers('text/html', len(msg),
|
||||||
cookie, callingDomain)
|
cookie, callingDomain)
|
||||||
|
|
@ -8545,7 +8546,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
baseDir,
|
baseDir,
|
||||||
path, domain,
|
path, domain,
|
||||||
port,
|
port,
|
||||||
httpPrefix).encode('utf-8')
|
httpPrefix,
|
||||||
|
self.server.defaultTimeline).encode('utf-8')
|
||||||
if msg:
|
if msg:
|
||||||
self._set_headers('text/html', len(msg),
|
self._set_headers('text/html', len(msg),
|
||||||
cookie, callingDomain)
|
cookie, callingDomain)
|
||||||
|
|
@ -8568,7 +8570,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
baseDir,
|
baseDir,
|
||||||
path, domain,
|
path, domain,
|
||||||
port,
|
port,
|
||||||
httpPrefix).encode('utf-8')
|
httpPrefix,
|
||||||
|
self.server.defaultTimeline).encode('utf-8')
|
||||||
if msg:
|
if msg:
|
||||||
self._set_headers('text/html', len(msg),
|
self._set_headers('text/html', len(msg),
|
||||||
cookie, callingDomain)
|
cookie, callingDomain)
|
||||||
|
|
@ -9646,7 +9649,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
msg = htmlSearch(self.server.cssCache,
|
msg = htmlSearch(self.server.cssCache,
|
||||||
self.server.translate,
|
self.server.translate,
|
||||||
self.server.baseDir, self.path,
|
self.server.baseDir, self.path,
|
||||||
self.server.domain).encode('utf-8')
|
self.server.domain,
|
||||||
|
self.server.defaultTimeline).encode('utf-8')
|
||||||
self._set_headers('text/html', len(msg), cookie, callingDomain)
|
self._set_headers('text/html', len(msg), cookie, callingDomain)
|
||||||
self._write(msg)
|
self._write(msg)
|
||||||
self.server.GETbusy = False
|
self.server.GETbusy = False
|
||||||
|
|
|
||||||
|
|
@ -34,9 +34,6 @@
|
||||||
body {
|
body {
|
||||||
background-color: var(--main-bg-color);
|
background-color: var(--main-bg-color);
|
||||||
color: var(--day-number2);
|
color: var(--day-number2);
|
||||||
display: -webkit-box;
|
|
||||||
display: -ms-flexbox;
|
|
||||||
display: flex;
|
|
||||||
-webkit-box-align: center;
|
-webkit-box-align: center;
|
||||||
-ms-flex-align: center;
|
-ms-flex-align: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
@ -45,7 +42,7 @@ body {
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
font-family: 'Montserrat';
|
font-family: 'Montserrat';
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
min-height: 100vh;
|
margin: 5%;
|
||||||
}
|
}
|
||||||
|
|
||||||
main {
|
main {
|
||||||
|
|
@ -197,14 +194,14 @@ tr:nth-child(even) > .calendar__day__cell:nth-child(even) {
|
||||||
|
|
||||||
.buttonprev {
|
.buttonprev {
|
||||||
float: left;
|
float: left;
|
||||||
width: 10%;
|
width: 8%;
|
||||||
-ms-transform: translateY(30%);
|
-ms-transform: translateY(30%);
|
||||||
transform: translateY(30%);
|
transform: translateY(30%);
|
||||||
}
|
}
|
||||||
|
|
||||||
.buttonnext {
|
.buttonnext {
|
||||||
float: right;
|
float: right;
|
||||||
width: 10%;
|
width: 8%;
|
||||||
-ms-transform: translateY(30%) scaleX(-1);
|
-ms-transform: translateY(30%) scaleX(-1);
|
||||||
transform: translateY(30%) scaleX(-1);
|
transform: translateY(30%) scaleX(-1);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -64,6 +64,8 @@
|
||||||
--column-left-width: 10vw;
|
--column-left-width: 10vw;
|
||||||
--column-center-width: 80vw;
|
--column-center-width: 80vw;
|
||||||
--column-right-width: 10vw;
|
--column-right-width: 10vw;
|
||||||
|
--banner-height: 15vh;
|
||||||
|
--banner-height-mobile: 10vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
|
|
@ -602,7 +604,6 @@ input[type=submit]:hover {
|
||||||
max-width: 90%;
|
max-width: 90%;
|
||||||
min-width: 600px;
|
min-width: 600px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
padding: 5% 0px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The container <div> - needed to position the dropdown content */
|
/* The container <div> - needed to position the dropdown content */
|
||||||
|
|
@ -958,6 +959,10 @@ aside .toggle-inside li {
|
||||||
border: 0;
|
border: 0;
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
}
|
}
|
||||||
|
.timeline-banner {
|
||||||
|
width: 98vw;
|
||||||
|
height: var(--banner-height);
|
||||||
|
}
|
||||||
.column-left {
|
.column-left {
|
||||||
width: var(--column-left-width);
|
width: var(--column-left-width);
|
||||||
}
|
}
|
||||||
|
|
@ -1443,6 +1448,10 @@ aside .toggle-inside li {
|
||||||
border: 0;
|
border: 0;
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
}
|
}
|
||||||
|
.timeline-banner {
|
||||||
|
width: 98vw;
|
||||||
|
height: var(--banner-height-mobile);
|
||||||
|
}
|
||||||
.column-left {
|
.column-left {
|
||||||
width: 0%;
|
width: 0%;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -388,9 +388,14 @@ a:focus {
|
||||||
|
|
||||||
.containerNewPost {
|
.containerNewPost {
|
||||||
border: var(--border-width) solid var(--border-color);
|
border: var(--border-width) solid var(--border-color);
|
||||||
background-color: var(--main-bg-color);
|
|
||||||
border-radius: var(--timeline-border-radius);
|
border-radius: var(--timeline-border-radius);
|
||||||
padding: var(--container-padding);
|
background-color: var(--main-bg-color);
|
||||||
|
margin: var(--vertical-between-posts);
|
||||||
|
}
|
||||||
|
|
||||||
|
.containerSubmitNewPost {
|
||||||
|
border: 0;
|
||||||
|
background-color: var(--main-bg-color);
|
||||||
margin: var(--vertical-between-posts);
|
margin: var(--vertical-between-posts);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -663,7 +668,6 @@ input[type=submit]:hover {
|
||||||
max-width: 90%;
|
max-width: 90%;
|
||||||
min-width: 600px;
|
min-width: 600px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
padding: 5% 0px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The container <div> - needed to position the dropdown content */
|
/* The container <div> - needed to position the dropdown content */
|
||||||
|
|
@ -934,7 +938,6 @@ aside .toggle-inside li {
|
||||||
-ms-transition: all 0.1s ease-in-out;
|
-ms-transition: all 0.1s ease-in-out;
|
||||||
-o-transition: all 0.1s ease-in-out;
|
-o-transition: all 0.1s ease-in-out;
|
||||||
transition: all 0.1s ease-in-out;
|
transition: all 0.1s ease-in-out;
|
||||||
width: 170px;
|
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
|
@ -1315,6 +1318,10 @@ div.container {
|
||||||
background: transparent;
|
background: transparent;
|
||||||
border: none !important;
|
border: none !important;
|
||||||
font-size: 0;
|
font-size: 0;
|
||||||
|
padding-left: 0; padding-right: 0;
|
||||||
|
border-left-width: 0; border-right-width: 0;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
.button {
|
.button {
|
||||||
border-radius: var(--button-corner-radius);
|
border-radius: var(--button-corner-radius);
|
||||||
|
|
@ -1334,6 +1341,24 @@ div.container {
|
||||||
border-left: var(--tab-border-width) solid var(--tab-border-color);
|
border-left: var(--tab-border-width) solid var(--tab-border-color);
|
||||||
border-right: var(--tab-border-width) solid var(--tab-border-color);
|
border-right: var(--tab-border-width) solid var(--tab-border-color);
|
||||||
}
|
}
|
||||||
|
.buttonDesktop {
|
||||||
|
border-radius: var(--button-corner-radius);
|
||||||
|
background-color: var(--button-background);
|
||||||
|
color: var(--button-text);
|
||||||
|
text-align: center;
|
||||||
|
font-size: var(--font-size-header);
|
||||||
|
font-family: Arial, Helvetica, sans-serif;
|
||||||
|
padding: var(--button-height-padding);
|
||||||
|
width: 10%;
|
||||||
|
margin: 5px;
|
||||||
|
min-width: var(--button-width-chars);
|
||||||
|
transition: all 0.5s;
|
||||||
|
cursor: pointer;
|
||||||
|
border-top: var(--tab-border-width) solid var(--tab-border-color);
|
||||||
|
border-bottom: none;
|
||||||
|
border-left: var(--tab-border-width) solid var(--tab-border-color);
|
||||||
|
border-right: var(--tab-border-width) solid var(--tab-border-color);
|
||||||
|
}
|
||||||
.publishbtn {
|
.publishbtn {
|
||||||
border-radius: var(--button-corner-radius);
|
border-radius: var(--button-corner-radius);
|
||||||
background-color: var(--publish-button-background);
|
background-color: var(--publish-button-background);
|
||||||
|
|
@ -1983,6 +2008,15 @@ div.container {
|
||||||
border-left: var(--tab-border-width) solid var(--tab-border-color);
|
border-left: var(--tab-border-width) solid var(--tab-border-color);
|
||||||
border-right: var(--tab-border-width) solid var(--tab-border-color);
|
border-right: var(--tab-border-width) solid var(--tab-border-color);
|
||||||
}
|
}
|
||||||
|
.buttonDesktop {
|
||||||
|
background: transparent;
|
||||||
|
border: none !important;
|
||||||
|
font-size: 0;
|
||||||
|
padding-left: 0; padding-right: 0;
|
||||||
|
border-left-width: 0; border-right-width: 0;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
.publishbtn {
|
.publishbtn {
|
||||||
border-radius: var(--button-corner-radius);
|
border-radius: var(--button-corner-radius);
|
||||||
background-color: var(--publish-button-background);
|
background-color: var(--publish-button-background);
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,8 @@
|
||||||
--follow-text-size2: 40px;
|
--follow-text-size2: 40px;
|
||||||
--follow-text-entry-width: 90%;
|
--follow-text-entry-width: 90%;
|
||||||
--focus-color: white;
|
--focus-color: white;
|
||||||
|
--search-banner-height: 30vh;
|
||||||
|
--search-banner-height-mobile: 20vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
|
|
@ -58,7 +60,6 @@ body, html {
|
||||||
font-family: Arial, Helvetica, sans-serif;
|
font-family: Arial, Helvetica, sans-serif;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
min-width: 600px;
|
min-width: 600px;
|
||||||
margin: 5% auto;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
a, u {
|
a, u {
|
||||||
|
|
@ -89,13 +90,6 @@ a:focus {
|
||||||
border: 2px solid var(--focus-color);
|
border: 2px solid var(--focus-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
.searchBanner {
|
|
||||||
background-image: linear-gradient(rgba(0, 0, 0, 0.0), rgba(0, 0, 0, 0.5)), url("search_banner.png");
|
|
||||||
background-position: center;
|
|
||||||
background-repeat: no-repeat;
|
|
||||||
background-size: 90%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.follow {
|
.follow {
|
||||||
background-image: url("follow-background.jpg");
|
background-image: url("follow-background.jpg");
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
|
|
@ -198,6 +192,10 @@ input[type=text] {
|
||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (min-width: 400px) {
|
@media screen and (min-width: 400px) {
|
||||||
|
.timeline-banner {
|
||||||
|
width: 98vw;
|
||||||
|
height: var(--search-banner-height);
|
||||||
|
}
|
||||||
.hashtagswarm {
|
.hashtagswarm {
|
||||||
font-size: var(--hashtag-size1);
|
font-size: var(--hashtag-size1);
|
||||||
font-family: Arial, Helvetica, sans-serif;
|
font-family: Arial, Helvetica, sans-serif;
|
||||||
|
|
@ -245,6 +243,10 @@ input[type=text] {
|
||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (max-width: 1000px) {
|
@media screen and (max-width: 1000px) {
|
||||||
|
.timeline-banner {
|
||||||
|
width: 98vw;
|
||||||
|
height: var(--search-banner-height-mobile);
|
||||||
|
}
|
||||||
.hashtagswarm {
|
.hashtagswarm {
|
||||||
font-size: var(--hashtag-size2);
|
font-size: var(--hashtag-size2);
|
||||||
font-family: Arial, Helvetica, sans-serif;
|
font-family: Arial, Helvetica, sans-serif;
|
||||||
|
|
|
||||||
|
|
@ -114,7 +114,7 @@ parser.add_argument('-p', '--port', dest='port', type=int,
|
||||||
help='Port number to run on')
|
help='Port number to run on')
|
||||||
parser.add_argument('--postsPerSource',
|
parser.add_argument('--postsPerSource',
|
||||||
dest='maxNewswirePostsPerSource', type=int,
|
dest='maxNewswirePostsPerSource', type=int,
|
||||||
default=5,
|
default=4,
|
||||||
help='Maximum newswire posts per feed or account')
|
help='Maximum newswire posts per feed or account')
|
||||||
parser.add_argument('--maxFeedSize',
|
parser.add_argument('--maxFeedSize',
|
||||||
dest='maxNewswireFeedSizeKb', type=int,
|
dest='maxNewswireFeedSizeKb', type=int,
|
||||||
|
|
|
||||||
|
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 315 KiB |
|
Before Width: | Height: | Size: 636 B After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 668 B After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 743 B After Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 699 B After Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 652 B After Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 680 B After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 711 B After Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 7.2 KiB After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 836 B After Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.1 KiB |
|
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 315 KiB |
3
theme.py
|
|
@ -526,6 +526,7 @@ def setThemeStarlight(baseDir: str):
|
||||||
setRssIconAtTop(baseDir, True)
|
setRssIconAtTop(baseDir, True)
|
||||||
setPublishButtonAtTop(baseDir, False)
|
setPublishButtonAtTop(baseDir, False)
|
||||||
themeParams = {
|
themeParams = {
|
||||||
|
"search-banner-height-mobile": "15vh",
|
||||||
"column-left-header-background": "#69282c",
|
"column-left-header-background": "#69282c",
|
||||||
"column-left-image-width-mobile": "40vw",
|
"column-left-image-width-mobile": "40vw",
|
||||||
"line-spacing-newswire": "120%",
|
"line-spacing-newswire": "120%",
|
||||||
|
|
@ -1018,6 +1019,8 @@ def setThemeIndymediaModern(baseDir: str):
|
||||||
fontStrItalic = \
|
fontStrItalic = \
|
||||||
"url('./fonts/NimbusSanL-italic.otf') format('opentype')"
|
"url('./fonts/NimbusSanL-italic.otf') format('opentype')"
|
||||||
themeParams = {
|
themeParams = {
|
||||||
|
"search-banner-height": "15vh",
|
||||||
|
"search-banner-height-mobile": "10vh",
|
||||||
"publish-button-vertical-offset": "10px",
|
"publish-button-vertical-offset": "10px",
|
||||||
"container-button-padding": "0px",
|
"container-button-padding": "0px",
|
||||||
"container-button-margin": "0px",
|
"container-button-margin": "0px",
|
||||||
|
|
|
||||||
|
|
@ -324,5 +324,6 @@
|
||||||
"User": "المستعمل",
|
"User": "المستعمل",
|
||||||
"Features" : "ميزات",
|
"Features" : "ميزات",
|
||||||
"Article": "مقال إخباري",
|
"Article": "مقال إخباري",
|
||||||
"Create an article": "قم بإنشاء مقال"
|
"Create an article": "قم بإنشاء مقال",
|
||||||
|
"Settings": "إعدادات"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -324,5 +324,6 @@
|
||||||
"User": "Usuari",
|
"User": "Usuari",
|
||||||
"Features" : "Article",
|
"Features" : "Article",
|
||||||
"Article": "Reportatge",
|
"Article": "Reportatge",
|
||||||
"Create an article": "Creeu un article"
|
"Create an article": "Creeu un article",
|
||||||
|
"Settings": "Configuració"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -324,5 +324,6 @@
|
||||||
"User": "Defnyddiwr",
|
"User": "Defnyddiwr",
|
||||||
"Features" : "Nodweddion",
|
"Features" : "Nodweddion",
|
||||||
"Article": "Erthygl",
|
"Article": "Erthygl",
|
||||||
"Create an article": "Creu erthygl"
|
"Create an article": "Creu erthygl",
|
||||||
|
"Settings": "Gosodiadau"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -324,5 +324,6 @@
|
||||||
"User": "Nutzerin",
|
"User": "Nutzerin",
|
||||||
"Features" : "Eigenschaften",
|
"Features" : "Eigenschaften",
|
||||||
"Article": "Artikel",
|
"Article": "Artikel",
|
||||||
"Create an article": "Erstellen Sie einen Artikel"
|
"Create an article": "Erstellen Sie einen Artikel",
|
||||||
|
"Settings": "Einstellungen"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -324,5 +324,6 @@
|
||||||
"User": "User",
|
"User": "User",
|
||||||
"Features" : "Features",
|
"Features" : "Features",
|
||||||
"Article": "Article",
|
"Article": "Article",
|
||||||
"Create an article": "Create an article"
|
"Create an article": "Create an article",
|
||||||
|
"Settings": "Settings"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -324,5 +324,6 @@
|
||||||
"User": "Usuaria",
|
"User": "Usuaria",
|
||||||
"Features" : "Caracteristicas",
|
"Features" : "Caracteristicas",
|
||||||
"Article": "Artículo",
|
"Article": "Artículo",
|
||||||
"Create an article": "Crea un articulo"
|
"Create an article": "Crea un articulo",
|
||||||
|
"Settings": "Configuraciones"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -324,5 +324,6 @@
|
||||||
"User": "Utilisatrice",
|
"User": "Utilisatrice",
|
||||||
"Features" : "Traits",
|
"Features" : "Traits",
|
||||||
"Article": "Article",
|
"Article": "Article",
|
||||||
"Create an article": "Créer un article"
|
"Create an article": "Créer un article",
|
||||||
|
"Settings": "Réglages"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -324,5 +324,6 @@
|
||||||
"User": "Úsáideoir",
|
"User": "Úsáideoir",
|
||||||
"Features" : "Gnéithe",
|
"Features" : "Gnéithe",
|
||||||
"Article": "Airteagal",
|
"Article": "Airteagal",
|
||||||
"Create an article": "Cruthaigh alt"
|
"Create an article": "Cruthaigh alt",
|
||||||
|
"Settings": "Socruithe"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -324,5 +324,6 @@
|
||||||
"User": "उपयोगकर्ता",
|
"User": "उपयोगकर्ता",
|
||||||
"Features" : "विशेषताएं",
|
"Features" : "विशेषताएं",
|
||||||
"Article": "लेख",
|
"Article": "लेख",
|
||||||
"Create an article": "एक लेख बनाएँ"
|
"Create an article": "एक लेख बनाएँ",
|
||||||
|
"Settings": "समायोजन"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -324,5 +324,6 @@
|
||||||
"User": "Utente",
|
"User": "Utente",
|
||||||
"Features" : "Caratteristiche",
|
"Features" : "Caratteristiche",
|
||||||
"Article": "Articolo",
|
"Article": "Articolo",
|
||||||
"Create an article": "Crea un articolo"
|
"Create an article": "Crea un articolo",
|
||||||
|
"Settings": "impostazioni"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -324,5 +324,6 @@
|
||||||
"User": "ユーザー",
|
"User": "ユーザー",
|
||||||
"Features" : "特徴",
|
"Features" : "特徴",
|
||||||
"Article": "論文",
|
"Article": "論文",
|
||||||
"Create an article": "記事を作成する"
|
"Create an article": "記事を作成する",
|
||||||
|
"Settings": "設定"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -320,5 +320,6 @@
|
||||||
"User": "User",
|
"User": "User",
|
||||||
"Features" : "Features",
|
"Features" : "Features",
|
||||||
"Article": "Article",
|
"Article": "Article",
|
||||||
"Create an article": "Create an article"
|
"Create an article": "Create an article",
|
||||||
|
"Settings": "Settings"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -324,5 +324,6 @@
|
||||||
"User": "Do utilizador",
|
"User": "Do utilizador",
|
||||||
"Features" : "Recursos",
|
"Features" : "Recursos",
|
||||||
"Article": "Artigo",
|
"Article": "Artigo",
|
||||||
"Create an article": "Crie um artigo"
|
"Create an article": "Crie um artigo",
|
||||||
|
"Settings": "Definições"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -324,5 +324,6 @@
|
||||||
"User": "Пользователь",
|
"User": "Пользователь",
|
||||||
"Features" : "особенности",
|
"Features" : "особенности",
|
||||||
"Article": "Статья",
|
"Article": "Статья",
|
||||||
"Create an article": "Создать статью"
|
"Create an article": "Создать статью",
|
||||||
|
"Settings": "Настройки"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -324,5 +324,6 @@
|
||||||
"User": "用户",
|
"User": "用户",
|
||||||
"Features" : "特征",
|
"Features" : "特征",
|
||||||
"Article": "文章",
|
"Article": "文章",
|
||||||
"Create an article": "建立文章"
|
"Create an article": "建立文章",
|
||||||
|
"Settings": "设定值"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
410
webinterface.py
|
|
@ -1226,12 +1226,12 @@ def scheduledPostsExist(baseDir: str, nickname: str, domain: str) -> bool:
|
||||||
|
|
||||||
|
|
||||||
def htmlEditLinks(cssCache: {}, translate: {}, baseDir: str, path: str,
|
def htmlEditLinks(cssCache: {}, translate: {}, baseDir: str, path: str,
|
||||||
domain: str, port: int, httpPrefix: str) -> str:
|
domain: str, port: int, httpPrefix: str,
|
||||||
|
defaultTimeline: str) -> str:
|
||||||
"""Shows the edit links screen
|
"""Shows the edit links screen
|
||||||
"""
|
"""
|
||||||
if '/users/' not in path:
|
if '/users/' not in path:
|
||||||
return ''
|
return ''
|
||||||
pathOriginal = path
|
|
||||||
path = path.replace('/inbox', '').replace('/outbox', '')
|
path = path.replace('/inbox', '').replace('/outbox', '')
|
||||||
path = path.replace('/shares', '')
|
path = path.replace('/shares', '')
|
||||||
|
|
||||||
|
|
@ -1253,7 +1253,19 @@ def htmlEditLinks(cssCache: {}, translate: {}, baseDir: str, path: str,
|
||||||
editCSS = \
|
editCSS = \
|
||||||
editCSS.replace('https://', httpPrefix + '://')
|
editCSS.replace('https://', httpPrefix + '://')
|
||||||
|
|
||||||
|
# filename of the banner shown at the top
|
||||||
|
bannerFile, bannerFilename = getBannerFile(baseDir, nickname, domain)
|
||||||
|
|
||||||
editLinksForm = htmlHeader(cssFilename, editCSS)
|
editLinksForm = htmlHeader(cssFilename, editCSS)
|
||||||
|
|
||||||
|
# top banner
|
||||||
|
editLinksForm += \
|
||||||
|
'<a href="/users/' + nickname + '/' + defaultTimeline + '" title="' + \
|
||||||
|
translate['Switch to timeline view'] + '" alt="' + \
|
||||||
|
translate['Switch to timeline view'] + '">\n'
|
||||||
|
editLinksForm += '<img loading="lazy" class="timeline-banner" src="' + \
|
||||||
|
'/users/' + nickname + '/' + bannerFile + '" /></a>\n'
|
||||||
|
|
||||||
editLinksForm += \
|
editLinksForm += \
|
||||||
'<form enctype="multipart/form-data" method="POST" ' + \
|
'<form enctype="multipart/form-data" method="POST" ' + \
|
||||||
'accept-charset="UTF-8" action="' + path + '/linksdata">\n'
|
'accept-charset="UTF-8" action="' + path + '/linksdata">\n'
|
||||||
|
|
@ -1263,12 +1275,14 @@ def htmlEditLinks(cssCache: {}, translate: {}, baseDir: str, path: str,
|
||||||
' <p class="new-post-text">' + translate['Edit Links'] + '</p>'
|
' <p class="new-post-text">' + translate['Edit Links'] + '</p>'
|
||||||
editLinksForm += \
|
editLinksForm += \
|
||||||
' <div class="container">\n'
|
' <div class="container">\n'
|
||||||
|
# editLinksForm += \
|
||||||
|
# ' <a href="' + pathOriginal + '"><button class="cancelbtn">' + \
|
||||||
|
# translate['Go Back'] + '</button></a>\n'
|
||||||
editLinksForm += \
|
editLinksForm += \
|
||||||
' <a href="' + pathOriginal + '"><button class="cancelbtn">' + \
|
' <center>\n' + \
|
||||||
translate['Go Back'] + '</button></a>\n'
|
|
||||||
editLinksForm += \
|
|
||||||
' <input type="submit" name="submitLinks" value="' + \
|
' <input type="submit" name="submitLinks" value="' + \
|
||||||
translate['Submit'] + '">\n'
|
translate['Submit'] + '">\n' + \
|
||||||
|
' <center>\n'
|
||||||
editLinksForm += \
|
editLinksForm += \
|
||||||
' </div>\n'
|
' </div>\n'
|
||||||
|
|
||||||
|
|
@ -1285,7 +1299,7 @@ def htmlEditLinks(cssCache: {}, translate: {}, baseDir: str, path: str,
|
||||||
translate['One link per line. Description followed by the link.'] + \
|
translate['One link per line. Description followed by the link.'] + \
|
||||||
'<br>'
|
'<br>'
|
||||||
editLinksForm += \
|
editLinksForm += \
|
||||||
' <textarea id="message" name="editedLinks" style="height:50vh">' + \
|
' <textarea id="message" name="editedLinks" style="height:80vh">' + \
|
||||||
linksStr + '</textarea>'
|
linksStr + '</textarea>'
|
||||||
editLinksForm += \
|
editLinksForm += \
|
||||||
'</div>'
|
'</div>'
|
||||||
|
|
@ -1295,12 +1309,12 @@ def htmlEditLinks(cssCache: {}, translate: {}, baseDir: str, path: str,
|
||||||
|
|
||||||
|
|
||||||
def htmlEditNewswire(cssCache: {}, translate: {}, baseDir: str, path: str,
|
def htmlEditNewswire(cssCache: {}, translate: {}, baseDir: str, path: str,
|
||||||
domain: str, port: int, httpPrefix: str) -> str:
|
domain: str, port: int, httpPrefix: str,
|
||||||
|
defaultTimeline: str) -> str:
|
||||||
"""Shows the edit newswire screen
|
"""Shows the edit newswire screen
|
||||||
"""
|
"""
|
||||||
if '/users/' not in path:
|
if '/users/' not in path:
|
||||||
return ''
|
return ''
|
||||||
pathOriginal = path
|
|
||||||
path = path.replace('/inbox', '').replace('/outbox', '')
|
path = path.replace('/inbox', '').replace('/outbox', '')
|
||||||
path = path.replace('/shares', '')
|
path = path.replace('/shares', '')
|
||||||
|
|
||||||
|
|
@ -1322,7 +1336,19 @@ def htmlEditNewswire(cssCache: {}, translate: {}, baseDir: str, path: str,
|
||||||
editCSS = \
|
editCSS = \
|
||||||
editCSS.replace('https://', httpPrefix + '://')
|
editCSS.replace('https://', httpPrefix + '://')
|
||||||
|
|
||||||
|
# filename of the banner shown at the top
|
||||||
|
bannerFile, bannerFilename = getBannerFile(baseDir, nickname, domain)
|
||||||
|
|
||||||
editNewswireForm = htmlHeader(cssFilename, editCSS)
|
editNewswireForm = htmlHeader(cssFilename, editCSS)
|
||||||
|
|
||||||
|
# top banner
|
||||||
|
editNewswireForm += \
|
||||||
|
'<a href="/users/' + nickname + '/' + defaultTimeline + '" title="' + \
|
||||||
|
translate['Switch to timeline view'] + '" alt="' + \
|
||||||
|
translate['Switch to timeline view'] + '">\n'
|
||||||
|
editNewswireForm += '<img loading="lazy" class="timeline-banner" src="' + \
|
||||||
|
'/users/' + nickname + '/' + bannerFile + '" /></a>\n'
|
||||||
|
|
||||||
editNewswireForm += \
|
editNewswireForm += \
|
||||||
'<form enctype="multipart/form-data" method="POST" ' + \
|
'<form enctype="multipart/form-data" method="POST" ' + \
|
||||||
'accept-charset="UTF-8" action="' + path + '/newswiredata">\n'
|
'accept-charset="UTF-8" action="' + path + '/newswiredata">\n'
|
||||||
|
|
@ -1332,12 +1358,14 @@ def htmlEditNewswire(cssCache: {}, translate: {}, baseDir: str, path: str,
|
||||||
' <p class="new-post-text">' + translate['Edit newswire'] + '</p>'
|
' <p class="new-post-text">' + translate['Edit newswire'] + '</p>'
|
||||||
editNewswireForm += \
|
editNewswireForm += \
|
||||||
' <div class="container">\n'
|
' <div class="container">\n'
|
||||||
|
# editNewswireForm += \
|
||||||
|
# ' <a href="' + pathOriginal + '"><button class="cancelbtn">' + \
|
||||||
|
# translate['Go Back'] + '</button></a>\n'
|
||||||
editNewswireForm += \
|
editNewswireForm += \
|
||||||
' <a href="' + pathOriginal + '"><button class="cancelbtn">' + \
|
' <center>\n' + \
|
||||||
translate['Go Back'] + '</button></a>\n'
|
|
||||||
editNewswireForm += \
|
|
||||||
' <input type="submit" name="submitNewswire" value="' + \
|
' <input type="submit" name="submitNewswire" value="' + \
|
||||||
translate['Submit'] + '">\n'
|
translate['Submit'] + '">\n' + \
|
||||||
|
' <center>\n'
|
||||||
editNewswireForm += \
|
editNewswireForm += \
|
||||||
' </div>\n'
|
' </div>\n'
|
||||||
|
|
||||||
|
|
@ -1356,7 +1384,7 @@ def htmlEditNewswire(cssCache: {}, translate: {}, baseDir: str, path: str,
|
||||||
'<br>'
|
'<br>'
|
||||||
editNewswireForm += \
|
editNewswireForm += \
|
||||||
' <textarea id="message" name="editedNewswire" ' + \
|
' <textarea id="message" name="editedNewswire" ' + \
|
||||||
'style="height:500px">' + newswireStr + '</textarea>'
|
'style="height:80vh">' + newswireStr + '</textarea>'
|
||||||
|
|
||||||
filterStr = ''
|
filterStr = ''
|
||||||
filterFilename = \
|
filterFilename = \
|
||||||
|
|
@ -1371,7 +1399,7 @@ def htmlEditNewswire(cssCache: {}, translate: {}, baseDir: str, path: str,
|
||||||
editNewswireForm += ' <br><label class="labels">' + \
|
editNewswireForm += ' <br><label class="labels">' + \
|
||||||
translate['One per line'] + '</label>'
|
translate['One per line'] + '</label>'
|
||||||
editNewswireForm += ' <textarea id="message" ' + \
|
editNewswireForm += ' <textarea id="message" ' + \
|
||||||
'name="filteredWordsNewswire" style="height:200px">' + \
|
'name="filteredWordsNewswire" style="height:50vh">' + \
|
||||||
filterStr + '</textarea>\n'
|
filterStr + '</textarea>\n'
|
||||||
|
|
||||||
hashtagRulesStr = ''
|
hashtagRulesStr = ''
|
||||||
|
|
@ -1391,7 +1419,7 @@ def htmlEditNewswire(cssCache: {}, translate: {}, baseDir: str, path: str,
|
||||||
'https://gitlab.com/bashrc2/epicyon/-/raw/main/hashtagrules.txt' + \
|
'https://gitlab.com/bashrc2/epicyon/-/raw/main/hashtagrules.txt' + \
|
||||||
'">' + translate['See instructions'] + '</a>\n'
|
'">' + translate['See instructions'] + '</a>\n'
|
||||||
editNewswireForm += ' <textarea id="message" ' + \
|
editNewswireForm += ' <textarea id="message" ' + \
|
||||||
'name="hashtagRulesList" style="height:200px">' + \
|
'name="hashtagRulesList" style="height:80vh">' + \
|
||||||
hashtagRulesStr + '</textarea>\n'
|
hashtagRulesStr + '</textarea>\n'
|
||||||
|
|
||||||
editNewswireForm += \
|
editNewswireForm += \
|
||||||
|
|
@ -1480,11 +1508,11 @@ def htmlEditNewsPost(cssCache: {}, translate: {}, baseDir: str, path: str,
|
||||||
|
|
||||||
|
|
||||||
def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str,
|
def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str,
|
||||||
domain: str, port: int, httpPrefix: str) -> str:
|
domain: str, port: int, httpPrefix: str,
|
||||||
|
defaultTimeline: str) -> str:
|
||||||
"""Shows the edit profile screen
|
"""Shows the edit profile screen
|
||||||
"""
|
"""
|
||||||
imageFormats = '.png, .jpg, .jpeg, .gif, .webp, .avif'
|
imageFormats = '.png, .jpg, .jpeg, .gif, .webp, .avif'
|
||||||
pathOriginal = path
|
|
||||||
path = path.replace('/inbox', '').replace('/outbox', '')
|
path = path.replace('/inbox', '').replace('/outbox', '')
|
||||||
path = path.replace('/shares', '')
|
path = path.replace('/shares', '')
|
||||||
nickname = getNicknameFromActor(path)
|
nickname = getNicknameFromActor(path)
|
||||||
|
|
@ -1501,6 +1529,9 @@ def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str,
|
||||||
if not os.path.isfile(actorFilename):
|
if not os.path.isfile(actorFilename):
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
|
# filename of the banner shown at the top
|
||||||
|
bannerFile, bannerFilename = getBannerFile(baseDir, nickname, domain)
|
||||||
|
|
||||||
isBot = ''
|
isBot = ''
|
||||||
isGroup = ''
|
isGroup = ''
|
||||||
followDMs = ''
|
followDMs = ''
|
||||||
|
|
@ -1673,9 +1704,10 @@ def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str,
|
||||||
editProfileCSS = \
|
editProfileCSS = \
|
||||||
editProfileCSS.replace('https://', httpPrefix + '://')
|
editProfileCSS.replace('https://', httpPrefix + '://')
|
||||||
|
|
||||||
instanceStr = ''
|
|
||||||
moderatorsStr = ''
|
moderatorsStr = ''
|
||||||
themesDropdown = ''
|
themesDropdown = ''
|
||||||
|
instanceStr = ''
|
||||||
|
|
||||||
adminNickname = getConfigParam(baseDir, 'admin')
|
adminNickname = getConfigParam(baseDir, 'admin')
|
||||||
if adminNickname:
|
if adminNickname:
|
||||||
if path.startswith('/users/' + adminNickname + '/'):
|
if path.startswith('/users/' + adminNickname + '/'):
|
||||||
|
|
@ -1685,7 +1717,7 @@ def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str,
|
||||||
getConfigParam(baseDir, 'instanceDescriptionShort')
|
getConfigParam(baseDir, 'instanceDescriptionShort')
|
||||||
instanceTitle = \
|
instanceTitle = \
|
||||||
getConfigParam(baseDir, 'instanceTitle')
|
getConfigParam(baseDir, 'instanceTitle')
|
||||||
instanceStr = '<div class="container">'
|
instanceStr += '<div class="container">'
|
||||||
instanceStr += \
|
instanceStr += \
|
||||||
' <label class="labels">' + \
|
' <label class="labels">' + \
|
||||||
translate['Instance Title'] + '</label>'
|
translate['Instance Title'] + '</label>'
|
||||||
|
|
@ -1792,6 +1824,15 @@ def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str,
|
||||||
'" selected>')
|
'" selected>')
|
||||||
|
|
||||||
editProfileForm = htmlHeader(cssFilename, editProfileCSS)
|
editProfileForm = htmlHeader(cssFilename, editProfileCSS)
|
||||||
|
|
||||||
|
# top banner
|
||||||
|
editProfileForm += \
|
||||||
|
'<a href="/users/' + nickname + '/' + defaultTimeline + '" title="' + \
|
||||||
|
translate['Switch to timeline view'] + '" alt="' + \
|
||||||
|
translate['Switch to timeline view'] + '">\n'
|
||||||
|
editProfileForm += '<img loading="lazy" class="timeline-banner" src="' + \
|
||||||
|
'/users/' + nickname + '/' + bannerFile + '" /></a>\n'
|
||||||
|
|
||||||
editProfileForm += \
|
editProfileForm += \
|
||||||
'<form enctype="multipart/form-data" method="POST" ' + \
|
'<form enctype="multipart/form-data" method="POST" ' + \
|
||||||
'accept-charset="UTF-8" action="' + path + '/profiledata">\n'
|
'accept-charset="UTF-8" action="' + path + '/profiledata">\n'
|
||||||
|
|
@ -1800,12 +1841,14 @@ def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str,
|
||||||
' <p class="new-post-text">' + translate['Profile for'] + \
|
' <p class="new-post-text">' + translate['Profile for'] + \
|
||||||
' ' + nickname + '@' + domainFull + '</p>'
|
' ' + nickname + '@' + domainFull + '</p>'
|
||||||
editProfileForm += ' <div class="container">\n'
|
editProfileForm += ' <div class="container">\n'
|
||||||
|
# editProfileForm += \
|
||||||
|
# ' <a href="' + pathOriginal + '"><button class="cancelbtn">' + \
|
||||||
|
# translate['Go Back'] + '</button></a>\n'
|
||||||
editProfileForm += \
|
editProfileForm += \
|
||||||
' <a href="' + pathOriginal + '"><button class="cancelbtn">' + \
|
' <center>\n' + \
|
||||||
translate['Go Back'] + '</button></a>\n'
|
|
||||||
editProfileForm += \
|
|
||||||
' <input type="submit" name="submitProfile" value="' + \
|
' <input type="submit" name="submitProfile" value="' + \
|
||||||
translate['Submit'] + '">\n'
|
translate['Submit'] + '">\n' + \
|
||||||
|
' </center>\n'
|
||||||
editProfileForm += ' </div>\n'
|
editProfileForm += ' </div>\n'
|
||||||
|
|
||||||
if scheduledPostsExist(baseDir, nickname, domain):
|
if scheduledPostsExist(baseDir, nickname, domain):
|
||||||
|
|
@ -2386,6 +2429,9 @@ def htmlNewPost(cssCache: {}, mediaInstance: bool, translate: {},
|
||||||
showPublicOnDropdown = True
|
showPublicOnDropdown = True
|
||||||
messageBoxHeight = 400
|
messageBoxHeight = 400
|
||||||
|
|
||||||
|
# filename of the banner shown at the top
|
||||||
|
bannerFile, bannerFilename = getBannerFile(baseDir, nickname, domain)
|
||||||
|
|
||||||
if not path.endswith('/newshare'):
|
if not path.endswith('/newshare'):
|
||||||
if not path.endswith('/newreport'):
|
if not path.endswith('/newreport'):
|
||||||
if not inReplyTo or path.endswith('/newreminder'):
|
if not inReplyTo or path.endswith('/newreminder'):
|
||||||
|
|
@ -2738,6 +2784,13 @@ def htmlNewPost(cssCache: {}, mediaInstance: bool, translate: {},
|
||||||
|
|
||||||
newPostForm = htmlHeader(cssFilename, newPostCSS)
|
newPostForm = htmlHeader(cssFilename, newPostCSS)
|
||||||
|
|
||||||
|
newPostForm += \
|
||||||
|
'<a href="/users/' + nickname + '/' + defaultTimeline + '" title="' + \
|
||||||
|
translate['Switch to timeline view'] + '" alt="' + \
|
||||||
|
translate['Switch to timeline view'] + '">\n'
|
||||||
|
newPostForm += '<img loading="lazy" class="timeline-banner" src="' + \
|
||||||
|
'/users/' + nickname + '/' + bannerFile + '" /></a>\n'
|
||||||
|
|
||||||
# only show the share option if this is not a reply
|
# only show the share option if this is not a reply
|
||||||
shareOptionOnDropdown = ''
|
shareOptionOnDropdown = ''
|
||||||
questionOptionOnDropdown = ''
|
questionOptionOnDropdown = ''
|
||||||
|
|
@ -2901,6 +2954,7 @@ def htmlNewPost(cssCache: {}, mediaInstance: bool, translate: {},
|
||||||
newPostForm += ' <div class="containerNewPost">\n'
|
newPostForm += ' <div class="containerNewPost">\n'
|
||||||
newPostForm += ' <table style="width:100%" border="0"><tr>\n'
|
newPostForm += ' <table style="width:100%" border="0"><tr>\n'
|
||||||
newPostForm += '<td>' + dropDownContent + '</td>\n'
|
newPostForm += '<td>' + dropDownContent + '</td>\n'
|
||||||
|
|
||||||
newPostForm += \
|
newPostForm += \
|
||||||
' <td><a href="' + pathBase + \
|
' <td><a href="' + pathBase + \
|
||||||
'/searchemoji"><img loading="lazy" class="emojisearch" ' + \
|
'/searchemoji"><img loading="lazy" class="emojisearch" ' + \
|
||||||
|
|
@ -2910,15 +2964,17 @@ def htmlNewPost(cssCache: {}, mediaInstance: bool, translate: {},
|
||||||
newPostForm += ' </tr>\n'
|
newPostForm += ' </tr>\n'
|
||||||
newPostForm += '</table>\n'
|
newPostForm += '</table>\n'
|
||||||
newPostForm += ' </div>\n'
|
newPostForm += ' </div>\n'
|
||||||
newPostForm += ' <div class="container"><center>\n'
|
|
||||||
newPostForm += \
|
newPostForm += ' <div class="containerSubmitNewPost"><center>\n'
|
||||||
' <a href="' + pathBase + \
|
# newPostForm += \
|
||||||
'/inbox"><button class="cancelbtn">' + \
|
# ' <a href="' + pathBase + \
|
||||||
translate['Go Back'] + '</button></a>\n'
|
# '/inbox"><button class="cancelbtn">' + \
|
||||||
|
# translate['Go Back'] + '</button></a>\n'
|
||||||
newPostForm += \
|
newPostForm += \
|
||||||
' <input type="submit" name="submitPost" value="' + \
|
' <input type="submit" name="submitPost" value="' + \
|
||||||
translate['Submit'] + '">\n'
|
translate['Submit'] + '">\n'
|
||||||
newPostForm += ' </center></div>\n'
|
newPostForm += ' </center></div>\n'
|
||||||
|
|
||||||
newPostForm += replyStr
|
newPostForm += replyStr
|
||||||
if mediaInstance and not replyStr:
|
if mediaInstance and not replyStr:
|
||||||
newPostForm += newPostImageSection
|
newPostForm += newPostImageSection
|
||||||
|
|
@ -6032,24 +6088,32 @@ def getBannerFile(baseDir: str, nickname: str, domain: str) -> (str, str):
|
||||||
"""
|
"""
|
||||||
returns the banner filename
|
returns the banner filename
|
||||||
"""
|
"""
|
||||||
# filename of the banner shown at the top
|
bannerExtensions = ('png', 'jpg', 'jpeg', 'gif', 'avif', 'webp')
|
||||||
bannerFile = 'banner.png'
|
bannerFile = ''
|
||||||
|
bannerFilename = ''
|
||||||
|
for ext in bannerExtensions:
|
||||||
|
bannerFile = 'banner.' + ext
|
||||||
bannerFilename = baseDir + '/accounts/' + \
|
bannerFilename = baseDir + '/accounts/' + \
|
||||||
nickname + '@' + domain + '/' + bannerFile
|
nickname + '@' + domain + '/' + bannerFile
|
||||||
if not os.path.isfile(bannerFilename):
|
if os.path.isfile(bannerFilename):
|
||||||
bannerFile = 'banner.jpg'
|
break
|
||||||
|
return bannerFile, bannerFilename
|
||||||
|
|
||||||
|
|
||||||
|
def getSearchBannerFile(baseDir: str,
|
||||||
|
nickname: str, domain: str) -> (str, str):
|
||||||
|
"""
|
||||||
|
returns the search banner filename
|
||||||
|
"""
|
||||||
|
bannerExtensions = ('png', 'jpg', 'jpeg', 'gif', 'avif', 'webp')
|
||||||
|
bannerFile = ''
|
||||||
|
bannerFilename = ''
|
||||||
|
for ext in bannerExtensions:
|
||||||
|
bannerFile = 'search_banner.' + ext
|
||||||
bannerFilename = baseDir + '/accounts/' + \
|
bannerFilename = baseDir + '/accounts/' + \
|
||||||
nickname + '@' + domain + '/' + bannerFile
|
nickname + '@' + domain + '/' + bannerFile
|
||||||
if not os.path.isfile(bannerFilename):
|
if os.path.isfile(bannerFilename):
|
||||||
bannerFile = 'banner.gif'
|
break
|
||||||
bannerFilename = baseDir + '/accounts/' + \
|
|
||||||
nickname + '@' + domain + '/' + bannerFile
|
|
||||||
if not os.path.isfile(bannerFilename):
|
|
||||||
bannerFile = 'banner.avif'
|
|
||||||
bannerFilename = baseDir + '/accounts/' + \
|
|
||||||
nickname + '@' + domain + '/' + bannerFile
|
|
||||||
if not os.path.isfile(bannerFilename):
|
|
||||||
bannerFile = 'banner.webp'
|
|
||||||
return bannerFile, bannerFilename
|
return bannerFile, bannerFilename
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -6076,24 +6140,24 @@ def headerButtonsFrontScreen(translate: {},
|
||||||
' <a href="/">' + \
|
' <a href="/">' + \
|
||||||
'<button class="' + buttonFeatures + '">' + \
|
'<button class="' + buttonFeatures + '">' + \
|
||||||
'<span>' + translate['Features'] + \
|
'<span>' + translate['Features'] + \
|
||||||
'</span></button></a>\n'
|
'</span></button></a>'
|
||||||
if not authorized:
|
if not authorized:
|
||||||
headerStr += \
|
headerStr += \
|
||||||
' <a href="/login">' + \
|
' <a href="/login">' + \
|
||||||
'<button class="buttonMobile">' + \
|
'<button class="buttonMobile">' + \
|
||||||
'<span>' + translate['Login'] + \
|
'<span>' + translate['Login'] + \
|
||||||
'</span></button></a>\n'
|
'</span></button></a>'
|
||||||
if iconsAsButtons:
|
if iconsAsButtons:
|
||||||
headerStr += \
|
headerStr += \
|
||||||
' <a href="/users/news/newswiremobile">' + \
|
' <a href="/users/news/newswiremobile">' + \
|
||||||
'<button class="' + buttonNewswire + '">' + \
|
'<button class="' + buttonNewswire + '">' + \
|
||||||
'<span>' + translate['Newswire'] + \
|
'<span>' + translate['Newswire'] + \
|
||||||
'</span></button></a>\n'
|
'</span></button></a>'
|
||||||
headerStr += \
|
headerStr += \
|
||||||
' <a href="/users/news/linksmobile">' + \
|
' <a href="/users/news/linksmobile">' + \
|
||||||
'<button class="' + buttonLinks + '">' + \
|
'<button class="' + buttonLinks + '">' + \
|
||||||
'<span>' + translate['Links'] + \
|
'<span>' + translate['Links'] + \
|
||||||
'</span></button></a>\n'
|
'</span></button></a>'
|
||||||
else:
|
else:
|
||||||
headerStr += \
|
headerStr += \
|
||||||
' <a href="' + \
|
' <a href="' + \
|
||||||
|
|
@ -6113,7 +6177,7 @@ def headerButtonsFrontScreen(translate: {},
|
||||||
' <a href="/login">' + \
|
' <a href="/login">' + \
|
||||||
'<button class="buttonMobile">' + \
|
'<button class="buttonMobile">' + \
|
||||||
'<span>' + translate['Login'] + \
|
'<span>' + translate['Login'] + \
|
||||||
'</span></button></a>\n'
|
'</span></button></a>'
|
||||||
|
|
||||||
if headerStr:
|
if headerStr:
|
||||||
headerStr = \
|
headerStr = \
|
||||||
|
|
@ -6156,32 +6220,32 @@ def headerButtonsTimeline(defaultTimeline: str,
|
||||||
buttons for inbox, outbox, search, calendar, etc
|
buttons for inbox, outbox, search, calendar, etc
|
||||||
"""
|
"""
|
||||||
# start of the button header with inbox, outbox, etc
|
# start of the button header with inbox, outbox, etc
|
||||||
tlStr = ' <div class="containerHeader">\n'
|
tlStr = '<div class="containerHeader">\n'
|
||||||
# first button
|
# first button
|
||||||
if defaultTimeline == 'tlmedia':
|
if defaultTimeline == 'tlmedia':
|
||||||
tlStr += \
|
tlStr += \
|
||||||
' <a href="' + usersPath + \
|
'<a href="' + usersPath + \
|
||||||
'/tlmedia"><button class="' + \
|
'/tlmedia"><button class="' + \
|
||||||
mediaButton + '"><span>' + translate['Media'] + \
|
mediaButton + '"><span>' + translate['Media'] + \
|
||||||
'</span></button></a>\n'
|
'</span></button></a>'
|
||||||
elif defaultTimeline == 'tlblogs':
|
elif defaultTimeline == 'tlblogs':
|
||||||
tlStr += \
|
tlStr += \
|
||||||
' <a href="' + usersPath + \
|
'<a href="' + usersPath + \
|
||||||
'/tlblogs"><button class="' + \
|
'/tlblogs"><button class="' + \
|
||||||
blogsButton + '"><span>' + translate['Blogs'] + \
|
blogsButton + '"><span>' + translate['Blogs'] + \
|
||||||
'</span></button></a>\n'
|
'</span></button></a>'
|
||||||
elif defaultTimeline == 'tlnews':
|
elif defaultTimeline == 'tlnews':
|
||||||
tlStr += \
|
tlStr += \
|
||||||
' <a href="' + usersPath + \
|
'<a href="' + usersPath + \
|
||||||
'/tlnews"><button class="' + \
|
'/tlnews"><button class="' + \
|
||||||
newsButton + '"><span>' + translate['Features'] + \
|
newsButton + '"><span>' + translate['Features'] + \
|
||||||
'</span></button></a>\n'
|
'</span></button></a>'
|
||||||
else:
|
else:
|
||||||
tlStr += \
|
tlStr += \
|
||||||
' <a href="' + usersPath + \
|
'<a href="' + usersPath + \
|
||||||
'/inbox"><button class="' + \
|
'/inbox"><button class="' + \
|
||||||
inboxButton + '"><span>' + \
|
inboxButton + '"><span>' + \
|
||||||
translate['Inbox'] + '</span></button></a>\n'
|
translate['Inbox'] + '</span></button></a>'
|
||||||
|
|
||||||
# if this is a news instance and we are viewing the news timeline
|
# if this is a news instance and we are viewing the news timeline
|
||||||
newsHeader = False
|
newsHeader = False
|
||||||
|
|
@ -6190,32 +6254,32 @@ def headerButtonsTimeline(defaultTimeline: str,
|
||||||
|
|
||||||
if not newsHeader:
|
if not newsHeader:
|
||||||
tlStr += \
|
tlStr += \
|
||||||
' <a href="' + usersPath + \
|
'<a href="' + usersPath + \
|
||||||
'/dm"><button class="' + dmButton + \
|
'/dm"><button class="' + dmButton + \
|
||||||
'"><span>' + htmlHighlightLabel(translate['DM'], newDM) + \
|
'"><span>' + htmlHighlightLabel(translate['DM'], newDM) + \
|
||||||
'</span></button></a>\n'
|
'</span></button></a>'
|
||||||
|
|
||||||
tlStr += \
|
tlStr += \
|
||||||
' <a href="' + usersPath + '/tlreplies"><button class="' + \
|
'<a href="' + usersPath + '/tlreplies"><button class="' + \
|
||||||
repliesButton + '"><span>' + \
|
repliesButton + '"><span>' + \
|
||||||
htmlHighlightLabel(translate['Replies'], newReply) + \
|
htmlHighlightLabel(translate['Replies'], newReply) + \
|
||||||
'</span></button></a>\n'
|
'</span></button></a>'
|
||||||
|
|
||||||
# typically the media button
|
# typically the media button
|
||||||
if defaultTimeline != 'tlmedia':
|
if defaultTimeline != 'tlmedia':
|
||||||
if not minimal and not newsHeader:
|
if not minimal and not newsHeader:
|
||||||
tlStr += \
|
tlStr += \
|
||||||
' <a href="' + usersPath + \
|
'<a href="' + usersPath + \
|
||||||
'/tlmedia"><button class="' + \
|
'/tlmedia"><button class="' + \
|
||||||
mediaButton + '"><span>' + translate['Media'] + \
|
mediaButton + '"><span>' + translate['Media'] + \
|
||||||
'</span></button></a>\n'
|
'</span></button></a>'
|
||||||
else:
|
else:
|
||||||
if not minimal:
|
if not minimal:
|
||||||
tlStr += \
|
tlStr += \
|
||||||
' <a href="' + usersPath + \
|
'<a href="' + usersPath + \
|
||||||
'/inbox"><button class="' + \
|
'/inbox"><button class="' + \
|
||||||
inboxButton+'"><span>' + translate['Inbox'] + \
|
inboxButton+'"><span>' + translate['Inbox'] + \
|
||||||
'</span></button></a>\n'
|
'</span></button></a>'
|
||||||
|
|
||||||
isFeaturesTimeline = \
|
isFeaturesTimeline = \
|
||||||
defaultTimeline == 'tlnews' and boxName == 'tlnews'
|
defaultTimeline == 'tlnews' and boxName == 'tlnews'
|
||||||
|
|
@ -6229,41 +6293,41 @@ def headerButtonsTimeline(defaultTimeline: str,
|
||||||
if defaultTimeline == 'tlnews':
|
if defaultTimeline == 'tlnews':
|
||||||
titleStr = translate['Article']
|
titleStr = translate['Article']
|
||||||
tlStr += \
|
tlStr += \
|
||||||
' <a href="' + usersPath + \
|
'<a href="' + usersPath + \
|
||||||
'/tlblogs"><button class="' + \
|
'/tlblogs"><button class="' + \
|
||||||
blogsButton + '"><span>' + titleStr + \
|
blogsButton + '"><span>' + titleStr + \
|
||||||
'</span></button></a>\n'
|
'</span></button></a>'
|
||||||
else:
|
else:
|
||||||
if not minimal:
|
if not minimal:
|
||||||
tlStr += \
|
tlStr += \
|
||||||
' <a href="' + usersPath + \
|
'<a href="' + usersPath + \
|
||||||
'/inbox"><button class="' + \
|
'/inbox"><button class="' + \
|
||||||
inboxButton + '"><span>' + translate['Inbox'] + \
|
inboxButton + '"><span>' + translate['Inbox'] + \
|
||||||
'</span></button></a>\n'
|
'</span></button></a>'
|
||||||
|
|
||||||
# typically the news button
|
# typically the news button
|
||||||
# but may change if this is a news oriented instance
|
# but may change if this is a news oriented instance
|
||||||
if defaultTimeline != 'tlnews':
|
if defaultTimeline != 'tlnews':
|
||||||
tlStr += \
|
tlStr += \
|
||||||
' <a href="' + usersPath + \
|
'<a href="' + usersPath + \
|
||||||
'/tlnews"><button class="' + \
|
'/tlnews"><button class="' + \
|
||||||
newsButton + '"><span>' + translate['News'] + \
|
newsButton + '"><span>' + translate['News'] + \
|
||||||
'</span></button></a>\n'
|
'</span></button></a>'
|
||||||
else:
|
else:
|
||||||
if not newsHeader:
|
if not newsHeader:
|
||||||
tlStr += \
|
tlStr += \
|
||||||
' <a href="' + usersPath + \
|
'<a href="' + usersPath + \
|
||||||
'/inbox"><button class="' + \
|
'/inbox"><button class="' + \
|
||||||
inboxButton + '"><span>' + translate['Inbox'] + \
|
inboxButton + '"><span>' + translate['Inbox'] + \
|
||||||
'</span></button></a>\n'
|
'</span></button></a>'
|
||||||
|
|
||||||
if not newsHeader:
|
if not newsHeader:
|
||||||
# button for the outbox
|
# button for the outbox
|
||||||
tlStr += \
|
tlStr += \
|
||||||
' <a href="' + usersPath + \
|
'<a href="' + usersPath + \
|
||||||
'/outbox"><button class="' + \
|
'/outbox"><button class="' + \
|
||||||
sentButton + '"><span>' + translate['Outbox'] + \
|
sentButton + '"><span>' + translate['Outbox'] + \
|
||||||
'</span></button></a>\n'
|
'</span></button></a>'
|
||||||
|
|
||||||
# add other buttons
|
# add other buttons
|
||||||
tlStr += \
|
tlStr += \
|
||||||
|
|
@ -6278,44 +6342,44 @@ def headerButtonsTimeline(defaultTimeline: str,
|
||||||
# happening today button
|
# happening today button
|
||||||
if not iconsAsButtons:
|
if not iconsAsButtons:
|
||||||
tlStr += \
|
tlStr += \
|
||||||
' <a href="' + usersPath + '/calendar?year=' + \
|
'<a href="' + usersPath + '/calendar?year=' + \
|
||||||
str(now.year) + '?month=' + str(now.month) + \
|
str(now.year) + '?month=' + str(now.month) + \
|
||||||
'?day=' + str(now.day) + '">' + \
|
'?day=' + str(now.day) + '">' + \
|
||||||
'<button class="buttonevent">' + \
|
'<button class="buttonevent">' + \
|
||||||
translate['Happening Today'] + '</button></a>\n'
|
translate['Happening Today'] + '</button></a>'
|
||||||
else:
|
else:
|
||||||
tlStr += \
|
tlStr += \
|
||||||
' <a href="' + usersPath + '/calendar?year=' + \
|
'<a href="' + usersPath + '/calendar?year=' + \
|
||||||
str(now.year) + '?month=' + str(now.month) + \
|
str(now.year) + '?month=' + str(now.month) + \
|
||||||
'?day=' + str(now.day) + '">' + \
|
'?day=' + str(now.day) + '">' + \
|
||||||
'<button class="button">' + \
|
'<button class="button">' + \
|
||||||
translate['Happening Today'] + '</button></a>\n'
|
translate['Happening Today'] + '</button></a>'
|
||||||
|
|
||||||
# happening this week button
|
# happening this week button
|
||||||
if thisWeeksEventsCheck(baseDir, nickname, domain):
|
if thisWeeksEventsCheck(baseDir, nickname, domain):
|
||||||
if not iconsAsButtons:
|
if not iconsAsButtons:
|
||||||
tlStr += \
|
tlStr += \
|
||||||
' <a href="' + usersPath + \
|
'<a href="' + usersPath + \
|
||||||
'/calendar"><button class="buttonevent">' + \
|
'/calendar"><button class="buttonevent">' + \
|
||||||
translate['Happening This Week'] + '</button></a>\n'
|
translate['Happening This Week'] + '</button></a>'
|
||||||
else:
|
else:
|
||||||
tlStr += \
|
tlStr += \
|
||||||
' <a href="' + usersPath + \
|
'<a href="' + usersPath + \
|
||||||
'/calendar"><button class="button">' + \
|
'/calendar"><button class="button">' + \
|
||||||
translate['Happening This Week'] + '</button></a>\n'
|
translate['Happening This Week'] + '</button></a>'
|
||||||
else:
|
else:
|
||||||
# happening this week button
|
# happening this week button
|
||||||
if thisWeeksEventsCheck(baseDir, nickname, domain):
|
if thisWeeksEventsCheck(baseDir, nickname, domain):
|
||||||
if not iconsAsButtons:
|
if not iconsAsButtons:
|
||||||
tlStr += \
|
tlStr += \
|
||||||
' <a href="' + usersPath + \
|
'<a href="' + usersPath + \
|
||||||
'/calendar"><button class="buttonevent">' + \
|
'/calendar"><button class="buttonevent">' + \
|
||||||
translate['Happening This Week'] + '</button></a>\n'
|
translate['Happening This Week'] + '</button></a>'
|
||||||
else:
|
else:
|
||||||
tlStr += \
|
tlStr += \
|
||||||
' <a href="' + usersPath + \
|
'<a href="' + usersPath + \
|
||||||
'/calendar"><button class="button">' + \
|
'/calendar"><button class="button">' + \
|
||||||
translate['Happening This Week'] + '</button></a>\n'
|
translate['Happening This Week'] + '</button></a>'
|
||||||
|
|
||||||
if not newsHeader:
|
if not newsHeader:
|
||||||
if not iconsAsButtons:
|
if not iconsAsButtons:
|
||||||
|
|
@ -6326,13 +6390,13 @@ def headerButtonsTimeline(defaultTimeline: str,
|
||||||
iconsDir + '/search.png" title="' + \
|
iconsDir + '/search.png" title="' + \
|
||||||
translate['Search and follow'] + '" alt="| ' + \
|
translate['Search and follow'] + '" alt="| ' + \
|
||||||
translate['Search and follow'] + \
|
translate['Search and follow'] + \
|
||||||
'" class="timelineicon"/></a>\n'
|
'" class="timelineicon"/></a>'
|
||||||
else:
|
else:
|
||||||
tlStr += \
|
tlStr += \
|
||||||
' <a href="' + usersPath + \
|
'<a href="' + usersPath + \
|
||||||
'/search"><button class="button">' + \
|
'/search"><button class="button">' + \
|
||||||
'<span>' + translate['Search'] + \
|
'<span>' + translate['Search'] + \
|
||||||
'</span></button></a>\n'
|
'</span></button></a>'
|
||||||
|
|
||||||
# benchmark 5
|
# benchmark 5
|
||||||
timeDiff = int((time.time() - timelineStartTime) * 1000)
|
timeDiff = int((time.time() - timelineStartTime) * 1000)
|
||||||
|
|
@ -6355,10 +6419,10 @@ def headerButtonsTimeline(defaultTimeline: str,
|
||||||
'" class="timelineicon"/></a>\n'
|
'" class="timelineicon"/></a>\n'
|
||||||
else:
|
else:
|
||||||
tlStr += \
|
tlStr += \
|
||||||
' <a href="' + usersPath + calendarPath + \
|
'<a href="' + usersPath + calendarPath + \
|
||||||
'"><button class="button">' + \
|
'"><button class="button">' + \
|
||||||
'<span>' + translate['Calendar'] + \
|
'<span>' + translate['Calendar'] + \
|
||||||
'</span></button></a>\n'
|
'</span></button></a>'
|
||||||
|
|
||||||
if not newsHeader:
|
if not newsHeader:
|
||||||
# the show/hide button, for a simpler header appearance
|
# the show/hide button, for a simpler header appearance
|
||||||
|
|
@ -6372,50 +6436,58 @@ def headerButtonsTimeline(defaultTimeline: str,
|
||||||
'" class="timelineicon"/></a>\n'
|
'" class="timelineicon"/></a>\n'
|
||||||
else:
|
else:
|
||||||
tlStr += \
|
tlStr += \
|
||||||
' <a href="' + usersPath + '/minimal' + \
|
'<a href="' + usersPath + '/minimal' + \
|
||||||
'"><button class="button">' + \
|
'"><button class="button">' + \
|
||||||
'<span>' + translate['Expand'] + \
|
'<span>' + translate['Expand'] + \
|
||||||
'</span></button></a>\n'
|
'</span></button></a>'
|
||||||
|
|
||||||
if newsHeader:
|
if newsHeader:
|
||||||
tlStr += \
|
tlStr += \
|
||||||
' <a href="' + usersPath + '/inbox' + \
|
'<a href="' + usersPath + '/inbox">' + \
|
||||||
'"><button class="button">' + \
|
'<button class="button">' + \
|
||||||
'<span>' + translate['User'] + '</span></button></a>\n'
|
'<span>' + translate['User'] + '</span></button></a>'
|
||||||
|
|
||||||
# the newswire button to show right column links
|
# the newswire button to show right column links
|
||||||
if not iconsAsButtons:
|
if not iconsAsButtons:
|
||||||
tlStr += \
|
tlStr += \
|
||||||
' <a class="imageAnchorMobile" href="' + \
|
'<a class="imageAnchorMobile" href="' + \
|
||||||
usersPath + '/newswiremobile">' + \
|
usersPath + '/newswiremobile">' + \
|
||||||
'<img loading="lazy" src="/' + iconsDir + \
|
'<img loading="lazy" src="/' + iconsDir + \
|
||||||
'/newswire.png" title="' + translate['News'] + \
|
'/newswire.png" title="' + translate['News'] + \
|
||||||
'" alt="| ' + translate['News'] + \
|
'" alt="| ' + translate['News'] + \
|
||||||
'" class="timelineicon"/></a>\n'
|
'" class="timelineicon"/></a>'
|
||||||
else:
|
else:
|
||||||
|
# NOTE: deliberately no \n at end of line
|
||||||
tlStr += \
|
tlStr += \
|
||||||
' <a href="' + \
|
'<a href="' + \
|
||||||
usersPath + '/newswiremobile' + \
|
usersPath + '/newswiremobile' + \
|
||||||
'"><button class="buttonMobile">' + \
|
'"><button class="buttonMobile">' + \
|
||||||
'<span>' + translate['Newswire'] + \
|
'<span>' + translate['Newswire'] + \
|
||||||
'</span></button></a>\n'
|
'</span></button></a>'
|
||||||
|
|
||||||
# the links button to show left column links
|
# the links button to show left column links
|
||||||
if not iconsAsButtons:
|
if not iconsAsButtons:
|
||||||
tlStr += \
|
tlStr += \
|
||||||
' <a class="imageAnchorMobile" href="' + \
|
'<a class="imageAnchorMobile" href="' + \
|
||||||
usersPath + '/linksmobile">' + \
|
usersPath + '/linksmobile">' + \
|
||||||
'<img loading="lazy" src="/' + iconsDir + \
|
'<img loading="lazy" src="/' + iconsDir + \
|
||||||
'/links.png" title="' + translate['Edit Links'] + \
|
'/links.png" title="' + translate['Edit Links'] + \
|
||||||
'" alt="| ' + translate['Edit Links'] + \
|
'" alt="| ' + translate['Edit Links'] + \
|
||||||
'" class="timelineicon"/></a>\n'
|
'" class="timelineicon"/></a>'
|
||||||
else:
|
else:
|
||||||
|
# NOTE: deliberately no \n at end of line
|
||||||
tlStr += \
|
tlStr += \
|
||||||
' <a href="' + \
|
'<a href="' + \
|
||||||
usersPath + '/linksmobile' + \
|
usersPath + '/linksmobile' + \
|
||||||
'"><button class="buttonMobile">' + \
|
'"><button class="buttonMobile">' + \
|
||||||
'<span>' + translate['Links'] + \
|
'<span>' + translate['Links'] + \
|
||||||
'</span></button></a>\n'
|
'</span></button></a>'
|
||||||
|
|
||||||
|
if newsHeader:
|
||||||
|
tlStr += \
|
||||||
|
'<a href="' + usersPath + '/editprofile">' + \
|
||||||
|
'<button class="buttonDesktop">' + \
|
||||||
|
'<span>' + translate['Settings'] + '</span></button></a>'
|
||||||
|
|
||||||
if not newsHeader:
|
if not newsHeader:
|
||||||
tlStr += followApprovals
|
tlStr += followApprovals
|
||||||
|
|
@ -6517,10 +6589,6 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
|
||||||
print('ERROR: css file not found ' + cssFilename)
|
print('ERROR: css file not found ' + cssFilename)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
# load css
|
|
||||||
profileStyle = \
|
|
||||||
profileStyle.replace('banner.png',
|
|
||||||
'/users/' + nickname + '/' + bannerFile)
|
|
||||||
# replace any https within the css with whatever prefix is needed
|
# replace any https within the css with whatever prefix is needed
|
||||||
if httpPrefix != 'https':
|
if httpPrefix != 'https':
|
||||||
profileStyle = \
|
profileStyle = \
|
||||||
|
|
@ -6631,12 +6699,11 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
|
||||||
moderationButtonStr = ''
|
moderationButtonStr = ''
|
||||||
if moderator and not minimal:
|
if moderator and not minimal:
|
||||||
moderationButtonStr = \
|
moderationButtonStr = \
|
||||||
' ' + \
|
|
||||||
'<a href="' + usersPath + \
|
'<a href="' + usersPath + \
|
||||||
'/moderation"><button class="' + \
|
'/moderation"><button class="' + \
|
||||||
moderationButton + '"><span>' + \
|
moderationButton + '"><span>' + \
|
||||||
htmlHighlightLabel(translate['Mod'], newReport) + \
|
htmlHighlightLabel(translate['Mod'], newReport) + \
|
||||||
' </span></button></a>\n'
|
' </span></button></a>'
|
||||||
|
|
||||||
# shares, bookmarks and events buttons
|
# shares, bookmarks and events buttons
|
||||||
sharesButtonStr = ''
|
sharesButtonStr = ''
|
||||||
|
|
@ -6644,23 +6711,20 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
|
||||||
eventsButtonStr = ''
|
eventsButtonStr = ''
|
||||||
if not minimal:
|
if not minimal:
|
||||||
sharesButtonStr = \
|
sharesButtonStr = \
|
||||||
' ' + \
|
|
||||||
'<a href="' + usersPath + '/tlshares"><button class="' + \
|
'<a href="' + usersPath + '/tlshares"><button class="' + \
|
||||||
sharesButton + '"><span>' + \
|
sharesButton + '"><span>' + \
|
||||||
htmlHighlightLabel(translate['Shares'], newShare) + \
|
htmlHighlightLabel(translate['Shares'], newShare) + \
|
||||||
' </span></button></a>\n'
|
'</span></button></a>'
|
||||||
|
|
||||||
bookmarksButtonStr = \
|
bookmarksButtonStr = \
|
||||||
' ' + \
|
|
||||||
'<a href="' + usersPath + '/tlbookmarks"><button class="' + \
|
'<a href="' + usersPath + '/tlbookmarks"><button class="' + \
|
||||||
bookmarksButton + '"><span>' + translate['Bookmarks'] + \
|
bookmarksButton + '"><span>' + translate['Bookmarks'] + \
|
||||||
' </span></button></a>\n'
|
'</span></button></a>'
|
||||||
|
|
||||||
eventsButtonStr = \
|
eventsButtonStr = \
|
||||||
' ' + \
|
|
||||||
'<a href="' + usersPath + '/tlevents"><button class="' + \
|
'<a href="' + usersPath + '/tlevents"><button class="' + \
|
||||||
eventsButton + '"><span>' + translate['Events'] + \
|
eventsButton + '"><span>' + translate['Events'] + \
|
||||||
' </span></button></a>\n'
|
'</span></button></a>'
|
||||||
|
|
||||||
tlStr = htmlHeader(cssFilename, profileStyle)
|
tlStr = htmlHeader(cssFilename, profileStyle)
|
||||||
|
|
||||||
|
|
@ -6673,7 +6737,7 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
|
||||||
if boxName == 'dm':
|
if boxName == 'dm':
|
||||||
if not iconsAsButtons:
|
if not iconsAsButtons:
|
||||||
newPostButtonStr = \
|
newPostButtonStr = \
|
||||||
' <a class="imageAnchor" href="' + usersPath + \
|
'<a class="imageAnchor" href="' + usersPath + \
|
||||||
'/newdm"><img loading="lazy" src="/' + \
|
'/newdm"><img loading="lazy" src="/' + \
|
||||||
iconsDir + '/newpost.png" title="' + \
|
iconsDir + '/newpost.png" title="' + \
|
||||||
translate['Create a new DM'] + \
|
translate['Create a new DM'] + \
|
||||||
|
|
@ -6683,11 +6747,11 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
|
||||||
newPostButtonStr = \
|
newPostButtonStr = \
|
||||||
'<a href="' + usersPath + '/newdm">' + \
|
'<a href="' + usersPath + '/newdm">' + \
|
||||||
'<button class="button"><span>' + \
|
'<button class="button"><span>' + \
|
||||||
translate['Post'] + ' </span></button></a>\n'
|
translate['Post'] + ' </span></button></a>'
|
||||||
elif boxName == 'tlblogs' or boxName == 'tlnews':
|
elif boxName == 'tlblogs' or boxName == 'tlnews':
|
||||||
if not iconsAsButtons:
|
if not iconsAsButtons:
|
||||||
newPostButtonStr = \
|
newPostButtonStr = \
|
||||||
' <a class="imageAnchor" href="' + usersPath + \
|
'<a class="imageAnchor" href="' + usersPath + \
|
||||||
'/newblog"><img loading="lazy" src="/' + \
|
'/newblog"><img loading="lazy" src="/' + \
|
||||||
iconsDir + '/newpost.png" title="' + \
|
iconsDir + '/newpost.png" title="' + \
|
||||||
translate['Create a new post'] + '" alt="| ' + \
|
translate['Create a new post'] + '" alt="| ' + \
|
||||||
|
|
@ -6697,11 +6761,11 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
|
||||||
newPostButtonStr = \
|
newPostButtonStr = \
|
||||||
'<a href="' + usersPath + '/newblog">' + \
|
'<a href="' + usersPath + '/newblog">' + \
|
||||||
'<button class="button"><span>' + \
|
'<button class="button"><span>' + \
|
||||||
translate['Post'] + ' </span></button></a>\n'
|
translate['Post'] + '</span></button></a>'
|
||||||
elif boxName == 'tlevents':
|
elif boxName == 'tlevents':
|
||||||
if not iconsAsButtons:
|
if not iconsAsButtons:
|
||||||
newPostButtonStr = \
|
newPostButtonStr = \
|
||||||
' <a class="imageAnchor" href="' + usersPath + \
|
'<a class="imageAnchor" href="' + usersPath + \
|
||||||
'/newevent"><img loading="lazy" src="/' + \
|
'/newevent"><img loading="lazy" src="/' + \
|
||||||
iconsDir + '/newpost.png" title="' + \
|
iconsDir + '/newpost.png" title="' + \
|
||||||
translate['Create a new event'] + '" alt="| ' + \
|
translate['Create a new event'] + '" alt="| ' + \
|
||||||
|
|
@ -6711,12 +6775,12 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
|
||||||
newPostButtonStr = \
|
newPostButtonStr = \
|
||||||
'<a href="' + usersPath + '/newevent">' + \
|
'<a href="' + usersPath + '/newevent">' + \
|
||||||
'<button class="button"><span>' + \
|
'<button class="button"><span>' + \
|
||||||
translate['Post'] + ' </span></button></a>\n'
|
translate['Post'] + '</span></button></a>'
|
||||||
else:
|
else:
|
||||||
if not manuallyApproveFollowers:
|
if not manuallyApproveFollowers:
|
||||||
if not iconsAsButtons:
|
if not iconsAsButtons:
|
||||||
newPostButtonStr = \
|
newPostButtonStr = \
|
||||||
' <a class="imageAnchor" href="' + usersPath + \
|
'<a class="imageAnchor" href="' + usersPath + \
|
||||||
'/newpost"><img loading="lazy" src="/' + \
|
'/newpost"><img loading="lazy" src="/' + \
|
||||||
iconsDir + '/newpost.png" title="' + \
|
iconsDir + '/newpost.png" title="' + \
|
||||||
translate['Create a new post'] + '" alt="| ' + \
|
translate['Create a new post'] + '" alt="| ' + \
|
||||||
|
|
@ -6726,11 +6790,11 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
|
||||||
newPostButtonStr = \
|
newPostButtonStr = \
|
||||||
'<a href="' + usersPath + '/newpost">' + \
|
'<a href="' + usersPath + '/newpost">' + \
|
||||||
'<button class="button"><span>' + \
|
'<button class="button"><span>' + \
|
||||||
translate['Post'] + ' </span></button></a>\n'
|
translate['Post'] + '</span></button></a>'
|
||||||
else:
|
else:
|
||||||
if not iconsAsButtons:
|
if not iconsAsButtons:
|
||||||
newPostButtonStr = \
|
newPostButtonStr = \
|
||||||
' <a class="imageAnchor" href="' + usersPath + \
|
'<a class="imageAnchor" href="' + usersPath + \
|
||||||
'/newfollowers"><img loading="lazy" src="/' + \
|
'/newfollowers"><img loading="lazy" src="/' + \
|
||||||
iconsDir + '/newpost.png" title="' + \
|
iconsDir + '/newpost.png" title="' + \
|
||||||
translate['Create a new post'] + \
|
translate['Create a new post'] + \
|
||||||
|
|
@ -6740,7 +6804,7 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
|
||||||
newPostButtonStr = \
|
newPostButtonStr = \
|
||||||
'<a href="' + usersPath + '/newfollowers">' + \
|
'<a href="' + usersPath + '/newfollowers">' + \
|
||||||
'<button class="button"><span>' + \
|
'<button class="button"><span>' + \
|
||||||
translate['Post'] + ' </span></button></a>\n'
|
translate['Post'] + '</span></button></a>'
|
||||||
# This creates a link to the profile page when viewed
|
# This creates a link to the profile page when viewed
|
||||||
# in lynx, but should be invisible in a graphical web browser
|
# in lynx, but should be invisible in a graphical web browser
|
||||||
tlStr += \
|
tlStr += \
|
||||||
|
|
@ -6754,7 +6818,7 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
|
||||||
translate['Switch to profile view'] + '" alt="' + \
|
translate['Switch to profile view'] + '" alt="' + \
|
||||||
translate['Switch to profile view'] + '">\n'
|
translate['Switch to profile view'] + '">\n'
|
||||||
tlStr += '<img loading="lazy" class="timeline-banner" src="' + \
|
tlStr += '<img loading="lazy" class="timeline-banner" src="' + \
|
||||||
usersPath + '/banner.png" /></a>\n'
|
usersPath + '/' + bannerFile + '" /></a>\n'
|
||||||
|
|
||||||
if fullWidthTimelineButtonHeader:
|
if fullWidthTimelineButtonHeader:
|
||||||
tlStr += \
|
tlStr += \
|
||||||
|
|
@ -6969,6 +7033,18 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
|
||||||
if boxName == 'tlmedia':
|
if boxName == 'tlmedia':
|
||||||
tlStr += '</div>\n'
|
tlStr += '</div>\n'
|
||||||
|
|
||||||
|
# page down arrow
|
||||||
|
if itemCtr > 2:
|
||||||
|
tlStr += \
|
||||||
|
' <center>\n' + \
|
||||||
|
' <a href="' + usersPath + '/' + boxName + '?page=' + \
|
||||||
|
str(pageNumber + 1) + \
|
||||||
|
'"><img loading="lazy" class="pageicon" src="/' + \
|
||||||
|
iconsDir + '/pagedown.png" title="' + \
|
||||||
|
translate['Page down'] + '" alt="' + \
|
||||||
|
translate['Page down'] + '"></a>\n' + \
|
||||||
|
' </center>\n'
|
||||||
|
|
||||||
# end of column-center
|
# end of column-center
|
||||||
tlStr += ' </td>\n'
|
tlStr += ' </td>\n'
|
||||||
|
|
||||||
|
|
@ -6990,24 +7066,6 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
|
||||||
if timeDiff > 100:
|
if timeDiff > 100:
|
||||||
print('TIMELINE TIMING ' + boxName + ' 9 = ' + str(timeDiff))
|
print('TIMELINE TIMING ' + boxName + ' 9 = ' + str(timeDiff))
|
||||||
|
|
||||||
# page down arrow
|
|
||||||
if itemCtr > 2:
|
|
||||||
tlStr += \
|
|
||||||
' <tr>\n' + \
|
|
||||||
' <td class="col-left"></td>\n' + \
|
|
||||||
' <td class="col-center">\n' + \
|
|
||||||
' <center>\n' + \
|
|
||||||
' <a href="' + usersPath + '/' + boxName + '?page=' + \
|
|
||||||
str(pageNumber + 1) + \
|
|
||||||
'"><img loading="lazy" class="pageicon" src="/' + \
|
|
||||||
iconsDir + '/pagedown.png" title="' + \
|
|
||||||
translate['Page down'] + '" alt="' + \
|
|
||||||
translate['Page down'] + '"></a>\n' + \
|
|
||||||
' </center>\n' + \
|
|
||||||
' </td>\n' + \
|
|
||||||
' <td class="col-right"></td>\n' + \
|
|
||||||
' </tr>\n'
|
|
||||||
|
|
||||||
tlStr += ' </tbody>\n'
|
tlStr += ' </tbody>\n'
|
||||||
tlStr += '</table>\n'
|
tlStr += '</table>\n'
|
||||||
tlStr += htmlFooter()
|
tlStr += htmlFooter()
|
||||||
|
|
@ -7932,6 +7990,13 @@ def htmlPersonOptions(cssCache: {}, translate: {}, baseDir: str,
|
||||||
profileStyle.replace('--follow-text-entry-width: 90%;',
|
profileStyle.replace('--follow-text-entry-width: 90%;',
|
||||||
'--follow-text-entry-width: 20%;')
|
'--follow-text-entry-width: 20%;')
|
||||||
|
|
||||||
|
if not os.path.isfile(baseDir + '/accounts/' +
|
||||||
|
'options-background.jpg'):
|
||||||
|
profileStyle = \
|
||||||
|
profileStyle.replace('background-image: ' +
|
||||||
|
'url("options-background.jpg");',
|
||||||
|
'background-image: none;')
|
||||||
|
|
||||||
# To snooze, or not to snooze? That is the question
|
# To snooze, or not to snooze? That is the question
|
||||||
snoozeButtonStr = 'Snooze'
|
snoozeButtonStr = 'Snooze'
|
||||||
if nickname:
|
if nickname:
|
||||||
|
|
@ -8041,26 +8106,26 @@ def htmlPersonOptions(cssCache: {}, translate: {}, baseDir: str,
|
||||||
optionsStr += optionsLinkStr
|
optionsStr += optionsLinkStr
|
||||||
optionsStr += \
|
optionsStr += \
|
||||||
' <a href="/"><button type="button" class="buttonIcon" ' + \
|
' <a href="/"><button type="button" class="buttonIcon" ' + \
|
||||||
'name="submitBack">' + translate['Go Back'] + '</button></a>\n'
|
'name="submitBack">' + translate['Go Back'] + '</button></a>'
|
||||||
optionsStr += \
|
optionsStr += \
|
||||||
' <button type="submit" class="button" name="submitView">' + \
|
' <button type="submit" class="button" name="submitView">' + \
|
||||||
translate['View'] + '</button>\n'
|
translate['View'] + '</button>'
|
||||||
optionsStr += donateStr
|
optionsStr += donateStr
|
||||||
optionsStr += \
|
optionsStr += \
|
||||||
' <button type="submit" class="button" name="submit' + \
|
' <button type="submit" class="button" name="submit' + \
|
||||||
followStr + '">' + translate[followStr] + '</button>\n'
|
followStr + '">' + translate[followStr] + '</button>'
|
||||||
optionsStr += \
|
optionsStr += \
|
||||||
' <button type="submit" class="button" name="submit' + \
|
' <button type="submit" class="button" name="submit' + \
|
||||||
blockStr + '">' + translate[blockStr] + '</button>\n'
|
blockStr + '">' + translate[blockStr] + '</button>'
|
||||||
optionsStr += \
|
optionsStr += \
|
||||||
' <button type="submit" class="button" name="submitDM">' + \
|
' <button type="submit" class="button" name="submitDM">' + \
|
||||||
translate['DM'] + '</button>\n'
|
translate['DM'] + '</button>'
|
||||||
optionsStr += \
|
optionsStr += \
|
||||||
' <button type="submit" class="button" name="submit' + \
|
' <button type="submit" class="button" name="submit' + \
|
||||||
snoozeButtonStr + '">' + translate[snoozeButtonStr] + '</button>\n'
|
snoozeButtonStr + '">' + translate[snoozeButtonStr] + '</button>'
|
||||||
optionsStr += \
|
optionsStr += \
|
||||||
' <button type="submit" class="button" name="submitReport">' + \
|
' <button type="submit" class="button" name="submitReport">' + \
|
||||||
translate['Report'] + '</button>\n'
|
translate['Report'] + '</button>'
|
||||||
|
|
||||||
personNotes = ''
|
personNotes = ''
|
||||||
personNotesFilename = \
|
personNotesFilename = \
|
||||||
|
|
@ -8596,7 +8661,8 @@ def htmlHashTagSwarm(baseDir: str, actor: str) -> str:
|
||||||
|
|
||||||
|
|
||||||
def htmlSearch(cssCache: {}, translate: {},
|
def htmlSearch(cssCache: {}, translate: {},
|
||||||
baseDir: str, path: str, domain: str) -> str:
|
baseDir: str, path: str, domain: str,
|
||||||
|
defaultTimeline: str) -> str:
|
||||||
"""Search called from the timeline icon
|
"""Search called from the timeline icon
|
||||||
"""
|
"""
|
||||||
actor = path.replace('/search', '')
|
actor = path.replace('/search', '')
|
||||||
|
|
@ -8613,26 +8679,44 @@ def htmlSearch(cssCache: {}, translate: {},
|
||||||
|
|
||||||
profileStyle = getCSS(baseDir, cssFilename, cssCache)
|
profileStyle = getCSS(baseDir, cssFilename, cssCache)
|
||||||
|
|
||||||
|
if not os.path.isfile(baseDir + '/accounts/' +
|
||||||
|
'follow-background.jpg'):
|
||||||
|
profileStyle = \
|
||||||
|
profileStyle.replace('background-image: ' +
|
||||||
|
'url("follow-background.jpg");',
|
||||||
|
'background-image: none;')
|
||||||
|
|
||||||
followStr = htmlHeader(cssFilename, profileStyle)
|
followStr = htmlHeader(cssFilename, profileStyle)
|
||||||
|
|
||||||
# show a banner above the search box
|
# show a banner above the search box
|
||||||
searchBannerFilename = \
|
searchBannerFile, searchBannerFilename = \
|
||||||
baseDir + '/accounts/' + searchNickname + '@' + domain + \
|
getSearchBannerFile(baseDir, searchNickname, domain)
|
||||||
'/search_banner.png'
|
|
||||||
if not os.path.isfile(searchBannerFilename):
|
if not os.path.isfile(searchBannerFilename):
|
||||||
|
# get the default search banner for the theme
|
||||||
theme = getConfigParam(baseDir, 'theme').lower()
|
theme = getConfigParam(baseDir, 'theme').lower()
|
||||||
if theme == 'default':
|
if theme == 'default':
|
||||||
theme = ''
|
theme = ''
|
||||||
else:
|
else:
|
||||||
theme = '_' + theme
|
theme = '_' + theme
|
||||||
|
bannerExtensions = ('png', 'jpg', 'jpeg', 'gif', 'avif', 'webp')
|
||||||
|
for ext in bannerExtensions:
|
||||||
|
searchBannerFile = 'search_banner.' + ext
|
||||||
|
searchBannerFilename = \
|
||||||
|
baseDir + '/accounts/' + \
|
||||||
|
searchNickname + '@' + domain + '/' + searchBannerFile
|
||||||
themeSearchBannerFilename = \
|
themeSearchBannerFilename = \
|
||||||
baseDir + '/img/search_banner' + theme + '.png'
|
baseDir + '/img/search_banner' + theme + '.' + ext
|
||||||
if os.path.isfile(themeSearchBannerFilename):
|
if os.path.isfile(themeSearchBannerFilename):
|
||||||
copyfile(themeSearchBannerFilename, searchBannerFilename)
|
copyfile(themeSearchBannerFilename, searchBannerFilename)
|
||||||
|
break
|
||||||
if os.path.isfile(searchBannerFilename):
|
if os.path.isfile(searchBannerFilename):
|
||||||
followStr += '<center>\n<div class="searchBanner">\n' + \
|
usersPath = '/users/' + searchNickname
|
||||||
'<br><br><br><br><br><br><br><br>' + \
|
followStr += \
|
||||||
'<br><br><br><br><br><br><br><br>\n</div>\n</center>\n'
|
'<a href="' + usersPath + '/' + defaultTimeline + '" title="' + \
|
||||||
|
translate['Switch to timeline view'] + '" alt="' + \
|
||||||
|
translate['Switch to timeline view'] + '">\n'
|
||||||
|
followStr += '<img loading="lazy" class="timeline-banner" src="' + \
|
||||||
|
usersPath + '/' + searchBannerFile + '" /></a>\n'
|
||||||
|
|
||||||
# show the search box
|
# show the search box
|
||||||
followStr += '<div class="follow">\n'
|
followStr += '<div class="follow">\n'
|
||||||
|
|
@ -8647,8 +8731,8 @@ def htmlSearch(cssCache: {}, translate: {},
|
||||||
followStr += \
|
followStr += \
|
||||||
' <input type="hidden" name="actor" value="' + actor + '">\n'
|
' <input type="hidden" name="actor" value="' + actor + '">\n'
|
||||||
followStr += ' <input type="text" name="searchtext" autofocus><br>\n'
|
followStr += ' <input type="text" name="searchtext" autofocus><br>\n'
|
||||||
followStr += ' <a href="/"><button type="button" class="button" ' + \
|
# followStr += ' <a href="/"><button type="button" class="button" ' + \
|
||||||
'name="submitBack">' + translate['Go Back'] + '</button></a>\n'
|
# 'name="submitBack">' + translate['Go Back'] + '</button></a>\n'
|
||||||
followStr += ' <button type="submit" class="button" ' + \
|
followStr += ' <button type="submit" class="button" ' + \
|
||||||
'name="submitSearch">' + translate['Submit'] + '</button>\n'
|
'name="submitSearch">' + translate['Submit'] + '</button>\n'
|
||||||
followStr += ' </form>\n'
|
followStr += ' </form>\n'
|
||||||
|
|
|
||||||