diff --git a/daemon.py b/daemon.py index f48106971..f6cad15a3 100644 --- a/daemon.py +++ b/daemon.py @@ -8522,7 +8522,8 @@ class PubServer(BaseHTTPRequestHandler): baseDir, path, domain, port, - httpPrefix).encode('utf-8') + httpPrefix, + self.server.defaultTimeline).encode('utf-8') if msg: self._set_headers('text/html', len(msg), cookie, callingDomain) @@ -8545,7 +8546,8 @@ class PubServer(BaseHTTPRequestHandler): baseDir, path, domain, port, - httpPrefix).encode('utf-8') + httpPrefix, + self.server.defaultTimeline).encode('utf-8') if msg: self._set_headers('text/html', len(msg), cookie, callingDomain) @@ -8568,7 +8570,8 @@ class PubServer(BaseHTTPRequestHandler): baseDir, path, domain, port, - httpPrefix).encode('utf-8') + httpPrefix, + self.server.defaultTimeline).encode('utf-8') if msg: self._set_headers('text/html', len(msg), cookie, callingDomain) @@ -9646,7 +9649,8 @@ class PubServer(BaseHTTPRequestHandler): msg = htmlSearch(self.server.cssCache, self.server.translate, 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._write(msg) self.server.GETbusy = False diff --git a/epicyon-calendar.css b/epicyon-calendar.css index 8d369ec8f..a57effefc 100644 --- a/epicyon-calendar.css +++ b/epicyon-calendar.css @@ -34,9 +34,6 @@ body { background-color: var(--main-bg-color); color: var(--day-number2); - display: -webkit-box; - display: -ms-flexbox; - display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; @@ -45,7 +42,7 @@ body { justify-content: center; font-family: 'Montserrat'; font-weight: 700; - min-height: 100vh; + margin: 5%; } main { @@ -197,14 +194,14 @@ tr:nth-child(even) > .calendar__day__cell:nth-child(even) { .buttonprev { float: left; - width: 10%; + width: 8%; -ms-transform: translateY(30%); transform: translateY(30%); } .buttonnext { float: right; - width: 10%; + width: 8%; -ms-transform: translateY(30%) scaleX(-1); transform: translateY(30%) scaleX(-1); } diff --git a/epicyon-links.css b/epicyon-links.css index 1434a4df7..d942bc773 100644 --- a/epicyon-links.css +++ b/epicyon-links.css @@ -64,6 +64,8 @@ --column-left-width: 10vw; --column-center-width: 80vw; --column-right-width: 10vw; + --banner-height: 15vh; + --banner-height-mobile: 10vh; } @font-face { @@ -602,7 +604,6 @@ input[type=submit]:hover { max-width: 90%; min-width: 600px; margin: 0 auto; - padding: 5% 0px; } /* The container
- needed to position the dropdown content */ @@ -958,6 +959,10 @@ aside .toggle-inside li { border: 0; width: 100vw; } + .timeline-banner { + width: 98vw; + height: var(--banner-height); + } .column-left { width: var(--column-left-width); } @@ -1443,6 +1448,10 @@ aside .toggle-inside li { border: 0; width: 100vw; } + .timeline-banner { + width: 98vw; + height: var(--banner-height-mobile); + } .column-left { width: 0%; } diff --git a/epicyon-profile.css b/epicyon-profile.css index 75572b813..ad284219a 100644 --- a/epicyon-profile.css +++ b/epicyon-profile.css @@ -388,9 +388,14 @@ a:focus { .containerNewPost { border: var(--border-width) solid var(--border-color); - background-color: var(--main-bg-color); 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); } @@ -663,7 +668,6 @@ input[type=submit]:hover { max-width: 90%; min-width: 600px; margin: 0 auto; - padding: 5% 0px; } /* The container
- needed to position the dropdown content */ @@ -934,7 +938,6 @@ aside .toggle-inside li { -ms-transition: all 0.1s ease-in-out; -o-transition: all 0.1s ease-in-out; transition: all 0.1s ease-in-out; - width: 170px; margin: 0 auto; text-decoration: none; display: inline-block; @@ -1315,6 +1318,10 @@ div.container { 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; } .button { border-radius: var(--button-corner-radius); @@ -1334,6 +1341,24 @@ div.container { border-left: 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 { border-radius: var(--button-corner-radius); background-color: var(--publish-button-background); @@ -1983,6 +2008,15 @@ div.container { border-left: 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 { border-radius: var(--button-corner-radius); background-color: var(--publish-button-background); diff --git a/epicyon-search.css b/epicyon-search.css index 92ed3217e..243758e9e 100644 --- a/epicyon-search.css +++ b/epicyon-search.css @@ -33,6 +33,8 @@ --follow-text-size2: 40px; --follow-text-entry-width: 90%; --focus-color: white; + --search-banner-height: 30vh; + --search-banner-height-mobile: 20vh; } @font-face { @@ -58,7 +60,6 @@ body, html { font-family: Arial, Helvetica, sans-serif; max-width: 100%; min-width: 600px; - margin: 5% auto; } a, u { @@ -89,13 +90,6 @@ a:focus { 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 { background-image: url("follow-background.jpg"); background-size: cover; @@ -198,6 +192,10 @@ input[type=text] { } @media screen and (min-width: 400px) { + .timeline-banner { + width: 98vw; + height: var(--search-banner-height); + } .hashtagswarm { font-size: var(--hashtag-size1); font-family: Arial, Helvetica, sans-serif; @@ -245,6 +243,10 @@ input[type=text] { } @media screen and (max-width: 1000px) { + .timeline-banner { + width: 98vw; + height: var(--search-banner-height-mobile); + } .hashtagswarm { font-size: var(--hashtag-size2); font-family: Arial, Helvetica, sans-serif; diff --git a/epicyon.py b/epicyon.py index 343b12447..237cdaa82 100644 --- a/epicyon.py +++ b/epicyon.py @@ -114,7 +114,7 @@ parser.add_argument('-p', '--port', dest='port', type=int, help='Port number to run on') parser.add_argument('--postsPerSource', dest='maxNewswirePostsPerSource', type=int, - default=5, + default=4, help='Maximum newswire posts per feed or account') parser.add_argument('--maxFeedSize', dest='maxNewswireFeedSizeKb', type=int, diff --git a/img/banner_indymediamodern.png b/img/banner_indymediamodern.png index b7361d6c5..5d1e78a25 100644 Binary files a/img/banner_indymediamodern.png and b/img/banner_indymediamodern.png differ diff --git a/img/icons/indymediamodern/bookmark.png b/img/icons/indymediamodern/bookmark.png index 0f790bf07..d7d8e20f7 100644 Binary files a/img/icons/indymediamodern/bookmark.png and b/img/icons/indymediamodern/bookmark.png differ diff --git a/img/icons/indymediamodern/bookmark_inactive.png b/img/icons/indymediamodern/bookmark_inactive.png index 49aeff58a..df0ef95d1 100644 Binary files a/img/icons/indymediamodern/bookmark_inactive.png and b/img/icons/indymediamodern/bookmark_inactive.png differ diff --git a/img/icons/indymediamodern/edit.png b/img/icons/indymediamodern/edit.png index fc78a5e83..ebb5fc688 100644 Binary files a/img/icons/indymediamodern/edit.png and b/img/icons/indymediamodern/edit.png differ diff --git a/img/icons/indymediamodern/edit_notify.png b/img/icons/indymediamodern/edit_notify.png index a26dd4f04..c223a21db 100644 Binary files a/img/icons/indymediamodern/edit_notify.png and b/img/icons/indymediamodern/edit_notify.png differ diff --git a/img/icons/indymediamodern/like.png b/img/icons/indymediamodern/like.png index 1f7f20156..f3f399753 100644 Binary files a/img/icons/indymediamodern/like.png and b/img/icons/indymediamodern/like.png differ diff --git a/img/icons/indymediamodern/like_inactive.png b/img/icons/indymediamodern/like_inactive.png index 3a019c2bc..c78cd1005 100644 Binary files a/img/icons/indymediamodern/like_inactive.png and b/img/icons/indymediamodern/like_inactive.png differ diff --git a/img/icons/indymediamodern/repeat.png b/img/icons/indymediamodern/repeat.png index 485822a9c..3da4feb05 100644 Binary files a/img/icons/indymediamodern/repeat.png and b/img/icons/indymediamodern/repeat.png differ diff --git a/img/icons/indymediamodern/repeat_inactive.png b/img/icons/indymediamodern/repeat_inactive.png index 03e9ab250..10f34de63 100644 Binary files a/img/icons/indymediamodern/repeat_inactive.png and b/img/icons/indymediamodern/repeat_inactive.png differ diff --git a/img/icons/indymediamodern/reply.png b/img/icons/indymediamodern/reply.png index c4f0f7da6..af32aa0ba 100644 Binary files a/img/icons/indymediamodern/reply.png and b/img/icons/indymediamodern/reply.png differ diff --git a/img/icons/indymediamodern/vote.png b/img/icons/indymediamodern/vote.png index c810092b0..bd5256695 100644 Binary files a/img/icons/indymediamodern/vote.png and b/img/icons/indymediamodern/vote.png differ diff --git a/img/search_banner_indymediamodern.png b/img/search_banner_indymediamodern.png index 5a28e1f82..5d1e78a25 100644 Binary files a/img/search_banner_indymediamodern.png and b/img/search_banner_indymediamodern.png differ diff --git a/theme.py b/theme.py index a54bf0b13..dec93871f 100644 --- a/theme.py +++ b/theme.py @@ -526,6 +526,7 @@ def setThemeStarlight(baseDir: str): setRssIconAtTop(baseDir, True) setPublishButtonAtTop(baseDir, False) themeParams = { + "search-banner-height-mobile": "15vh", "column-left-header-background": "#69282c", "column-left-image-width-mobile": "40vw", "line-spacing-newswire": "120%", @@ -1018,6 +1019,8 @@ def setThemeIndymediaModern(baseDir: str): fontStrItalic = \ "url('./fonts/NimbusSanL-italic.otf') format('opentype')" themeParams = { + "search-banner-height": "15vh", + "search-banner-height-mobile": "10vh", "publish-button-vertical-offset": "10px", "container-button-padding": "0px", "container-button-margin": "0px", diff --git a/translations/ar.json b/translations/ar.json index 607b7ce40..d0c16cab4 100644 --- a/translations/ar.json +++ b/translations/ar.json @@ -324,5 +324,6 @@ "User": "المستعمل", "Features" : "ميزات", "Article": "مقال إخباري", - "Create an article": "قم بإنشاء مقال" + "Create an article": "قم بإنشاء مقال", + "Settings": "إعدادات" } diff --git a/translations/ca.json b/translations/ca.json index 0b0b702d1..7bb30de20 100644 --- a/translations/ca.json +++ b/translations/ca.json @@ -324,5 +324,6 @@ "User": "Usuari", "Features" : "Article", "Article": "Reportatge", - "Create an article": "Creeu un article" + "Create an article": "Creeu un article", + "Settings": "Configuració" } diff --git a/translations/cy.json b/translations/cy.json index e4f548916..d3c964222 100644 --- a/translations/cy.json +++ b/translations/cy.json @@ -324,5 +324,6 @@ "User": "Defnyddiwr", "Features" : "Nodweddion", "Article": "Erthygl", - "Create an article": "Creu erthygl" + "Create an article": "Creu erthygl", + "Settings": "Gosodiadau" } diff --git a/translations/de.json b/translations/de.json index c486d8444..e2e373907 100644 --- a/translations/de.json +++ b/translations/de.json @@ -324,5 +324,6 @@ "User": "Nutzerin", "Features" : "Eigenschaften", "Article": "Artikel", - "Create an article": "Erstellen Sie einen Artikel" + "Create an article": "Erstellen Sie einen Artikel", + "Settings": "Einstellungen" } diff --git a/translations/en.json b/translations/en.json index 2dcd54fda..c3d6d80ea 100644 --- a/translations/en.json +++ b/translations/en.json @@ -324,5 +324,6 @@ "User": "User", "Features" : "Features", "Article": "Article", - "Create an article": "Create an article" + "Create an article": "Create an article", + "Settings": "Settings" } diff --git a/translations/es.json b/translations/es.json index c3f84bda0..547e1fb11 100644 --- a/translations/es.json +++ b/translations/es.json @@ -324,5 +324,6 @@ "User": "Usuaria", "Features" : "Caracteristicas", "Article": "Artículo", - "Create an article": "Crea un articulo" + "Create an article": "Crea un articulo", + "Settings": "Configuraciones" } diff --git a/translations/fr.json b/translations/fr.json index bb897925f..4d03a9ef9 100644 --- a/translations/fr.json +++ b/translations/fr.json @@ -324,5 +324,6 @@ "User": "Utilisatrice", "Features" : "Traits", "Article": "Article", - "Create an article": "Créer un article" + "Create an article": "Créer un article", + "Settings": "Réglages" } diff --git a/translations/ga.json b/translations/ga.json index 5cd34c5f8..1f683ad04 100644 --- a/translations/ga.json +++ b/translations/ga.json @@ -324,5 +324,6 @@ "User": "Úsáideoir", "Features" : "Gnéithe", "Article": "Airteagal", - "Create an article": "Cruthaigh alt" + "Create an article": "Cruthaigh alt", + "Settings": "Socruithe" } diff --git a/translations/hi.json b/translations/hi.json index a8736813f..c181d5b72 100644 --- a/translations/hi.json +++ b/translations/hi.json @@ -324,5 +324,6 @@ "User": "उपयोगकर्ता", "Features" : "विशेषताएं", "Article": "लेख", - "Create an article": "एक लेख बनाएँ" + "Create an article": "एक लेख बनाएँ", + "Settings": "समायोजन" } diff --git a/translations/it.json b/translations/it.json index 834628eec..0a968746b 100644 --- a/translations/it.json +++ b/translations/it.json @@ -324,5 +324,6 @@ "User": "Utente", "Features" : "Caratteristiche", "Article": "Articolo", - "Create an article": "Crea un articolo" + "Create an article": "Crea un articolo", + "Settings": "impostazioni" } diff --git a/translations/ja.json b/translations/ja.json index 1c85a5de3..6db9ca798 100644 --- a/translations/ja.json +++ b/translations/ja.json @@ -324,5 +324,6 @@ "User": "ユーザー", "Features" : "特徴", "Article": "論文", - "Create an article": "記事を作成する" + "Create an article": "記事を作成する", + "Settings": "設定" } diff --git a/translations/oc.json b/translations/oc.json index 0586b23cd..f8de1d224 100644 --- a/translations/oc.json +++ b/translations/oc.json @@ -320,5 +320,6 @@ "User": "User", "Features" : "Features", "Article": "Article", - "Create an article": "Create an article" + "Create an article": "Create an article", + "Settings": "Settings" } diff --git a/translations/pt.json b/translations/pt.json index 58e95a5bf..87519778c 100644 --- a/translations/pt.json +++ b/translations/pt.json @@ -324,5 +324,6 @@ "User": "Do utilizador", "Features" : "Recursos", "Article": "Artigo", - "Create an article": "Crie um artigo" + "Create an article": "Crie um artigo", + "Settings": "Definições" } diff --git a/translations/ru.json b/translations/ru.json index 75d6c4bd8..faeceb3a9 100644 --- a/translations/ru.json +++ b/translations/ru.json @@ -324,5 +324,6 @@ "User": "Пользователь", "Features" : "особенности", "Article": "Статья", - "Create an article": "Создать статью" + "Create an article": "Создать статью", + "Settings": "Настройки" } diff --git a/translations/zh.json b/translations/zh.json index b848bd20a..8ed04b18f 100644 --- a/translations/zh.json +++ b/translations/zh.json @@ -324,5 +324,6 @@ "User": "用户", "Features" : "特征", "Article": "文章", - "Create an article": "建立文章" + "Create an article": "建立文章", + "Settings": "设定值" } diff --git a/webinterface.py b/webinterface.py index 7e20bf4ff..84b1550b6 100644 --- a/webinterface.py +++ b/webinterface.py @@ -1226,12 +1226,12 @@ def scheduledPostsExist(baseDir: str, nickname: str, domain: str) -> bool: 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 """ if '/users/' not in path: return '' - pathOriginal = path path = path.replace('/inbox', '').replace('/outbox', '') path = path.replace('/shares', '') @@ -1253,7 +1253,19 @@ def htmlEditLinks(cssCache: {}, translate: {}, baseDir: str, path: str, editCSS = \ editCSS.replace('https://', httpPrefix + '://') + # filename of the banner shown at the top + bannerFile, bannerFilename = getBannerFile(baseDir, nickname, domain) + editLinksForm = htmlHeader(cssFilename, editCSS) + + # top banner + editLinksForm += \ + '\n' + editLinksForm += '\n' + editLinksForm += \ '
\n' @@ -1263,12 +1275,14 @@ def htmlEditLinks(cssCache: {}, translate: {}, baseDir: str, path: str, '

' + translate['Edit Links'] + '

' editLinksForm += \ '
\n' + # editLinksForm += \ + # ' \n' editLinksForm += \ - ' \n' - editLinksForm += \ - ' \n' + '
\n' + \ + ' \n' + \ + '
\n' editLinksForm += \ '
\n' @@ -1285,7 +1299,7 @@ def htmlEditLinks(cssCache: {}, translate: {}, baseDir: str, path: str, translate['One link per line. Description followed by the link.'] + \ '
' editLinksForm += \ - ' ' editLinksForm += \ '
' @@ -1295,12 +1309,12 @@ def htmlEditLinks(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 """ if '/users/' not in path: return '' - pathOriginal = path path = path.replace('/inbox', '').replace('/outbox', '') path = path.replace('/shares', '') @@ -1322,7 +1336,19 @@ def htmlEditNewswire(cssCache: {}, translate: {}, baseDir: str, path: str, editCSS = \ editCSS.replace('https://', httpPrefix + '://') + # filename of the banner shown at the top + bannerFile, bannerFilename = getBannerFile(baseDir, nickname, domain) + editNewswireForm = htmlHeader(cssFilename, editCSS) + + # top banner + editNewswireForm += \ + '\n' + editNewswireForm += '\n' + editNewswireForm += \ '\n' @@ -1332,12 +1358,14 @@ def htmlEditNewswire(cssCache: {}, translate: {}, baseDir: str, path: str, '

' + translate['Edit newswire'] + '

' editNewswireForm += \ '
\n' + # editNewswireForm += \ + # ' \n' editNewswireForm += \ - ' \n' - editNewswireForm += \ + '
\n' + \ ' \n' + translate['Submit'] + '">\n' + \ + '
\n' editNewswireForm += \ '
\n' @@ -1356,7 +1384,7 @@ def htmlEditNewswire(cssCache: {}, translate: {}, baseDir: str, path: str, '
' editNewswireForm += \ ' ' + 'style="height:80vh">' + newswireStr + '' filterStr = '' filterFilename = \ @@ -1371,7 +1399,7 @@ def htmlEditNewswire(cssCache: {}, translate: {}, baseDir: str, path: str, editNewswireForm += '
' editNewswireForm += ' \n' hashtagRulesStr = '' @@ -1391,7 +1419,7 @@ def htmlEditNewswire(cssCache: {}, translate: {}, baseDir: str, path: str, 'https://gitlab.com/bashrc2/epicyon/-/raw/main/hashtagrules.txt' + \ '">' + translate['See instructions'] + '\n' editNewswireForm += ' \n' editNewswireForm += \ @@ -1480,11 +1508,11 @@ def htmlEditNewsPost(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 """ imageFormats = '.png, .jpg, .jpeg, .gif, .webp, .avif' - pathOriginal = path path = path.replace('/inbox', '').replace('/outbox', '') path = path.replace('/shares', '') nickname = getNicknameFromActor(path) @@ -1501,6 +1529,9 @@ def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str, if not os.path.isfile(actorFilename): return '' + # filename of the banner shown at the top + bannerFile, bannerFilename = getBannerFile(baseDir, nickname, domain) + isBot = '' isGroup = '' followDMs = '' @@ -1673,9 +1704,10 @@ def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str, editProfileCSS = \ editProfileCSS.replace('https://', httpPrefix + '://') - instanceStr = '' moderatorsStr = '' themesDropdown = '' + instanceStr = '' + adminNickname = getConfigParam(baseDir, 'admin') if adminNickname: if path.startswith('/users/' + adminNickname + '/'): @@ -1685,7 +1717,7 @@ def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str, getConfigParam(baseDir, 'instanceDescriptionShort') instanceTitle = \ getConfigParam(baseDir, 'instanceTitle') - instanceStr = '
' + instanceStr += '
' instanceStr += \ ' ' @@ -1792,6 +1824,15 @@ def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str, '" selected>') editProfileForm = htmlHeader(cssFilename, editProfileCSS) + + # top banner + editProfileForm += \ + '\n' + editProfileForm += '\n' + editProfileForm += \ '\n' @@ -1800,12 +1841,14 @@ def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str, '

' + translate['Profile for'] + \ ' ' + nickname + '@' + domainFull + '

' editProfileForm += '
\n' + # editProfileForm += \ + # ' \n' editProfileForm += \ - ' \n' - editProfileForm += \ - ' \n' + '
\n' + \ + ' \n' + \ + '
\n' editProfileForm += '
\n' if scheduledPostsExist(baseDir, nickname, domain): @@ -2386,6 +2429,9 @@ def htmlNewPost(cssCache: {}, mediaInstance: bool, translate: {}, showPublicOnDropdown = True 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('/newreport'): if not inReplyTo or path.endswith('/newreminder'): @@ -2738,6 +2784,13 @@ def htmlNewPost(cssCache: {}, mediaInstance: bool, translate: {}, newPostForm = htmlHeader(cssFilename, newPostCSS) + newPostForm += \ + '\n' + newPostForm += '\n' + # only show the share option if this is not a reply shareOptionOnDropdown = '' questionOptionOnDropdown = '' @@ -2901,6 +2954,7 @@ def htmlNewPost(cssCache: {}, mediaInstance: bool, translate: {}, newPostForm += '
\n' newPostForm += ' \n' newPostForm += '\n' + newPostForm += \ ' \n' @@ -6990,24 +7066,6 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str, if timeDiff > 100: print('TIMELINE TIMING ' + boxName + ' 9 = ' + str(timeDiff)) - # page down arrow - if itemCtr > 2: - tlStr += \ - ' \n' + \ - ' \n' + \ - ' \n' + \ - ' \n' + \ - ' \n' - tlStr += ' \n' tlStr += '
' + dropDownContent + '\n' + + newPostForm += '
\n' + # newPostForm += \ + # ' \n' newPostForm += \ ' \n' newPostForm += '
\n' + newPostForm += replyStr if mediaInstance and not replyStr: newPostForm += newPostImageSection @@ -6032,24 +6088,32 @@ def getBannerFile(baseDir: str, nickname: str, domain: str) -> (str, str): """ returns the banner filename """ - # filename of the banner shown at the top - bannerFile = 'banner.png' - bannerFilename = baseDir + '/accounts/' + \ - nickname + '@' + domain + '/' + bannerFile - if not os.path.isfile(bannerFilename): - bannerFile = 'banner.jpg' + bannerExtensions = ('png', 'jpg', 'jpeg', 'gif', 'avif', 'webp') + bannerFile = '' + bannerFilename = '' + for ext in bannerExtensions: + bannerFile = 'banner.' + ext bannerFilename = baseDir + '/accounts/' + \ nickname + '@' + domain + '/' + bannerFile - if not os.path.isfile(bannerFilename): - bannerFile = 'banner.gif' + if os.path.isfile(bannerFilename): + 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/' + \ 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' + if os.path.isfile(bannerFilename): + break return bannerFile, bannerFilename @@ -6076,24 +6140,24 @@ def headerButtonsFrontScreen(translate: {}, ' ' + \ '\n' + '' if not authorized: headerStr += \ ' ' + \ '\n' + '' if iconsAsButtons: headerStr += \ ' ' + \ '\n' + '' headerStr += \ ' ' + \ '\n' + '' else: headerStr += \ ' ' + \ '\n' + '' if headerStr: headerStr = \ @@ -6156,32 +6220,32 @@ def headerButtonsTimeline(defaultTimeline: str, buttons for inbox, outbox, search, calendar, etc """ # start of the button header with inbox, outbox, etc - tlStr = '
\n' + tlStr = '
\n' # first button if defaultTimeline == 'tlmedia': tlStr += \ - ' \n' + '' elif defaultTimeline == 'tlblogs': tlStr += \ - ' \n' + '' elif defaultTimeline == 'tlnews': tlStr += \ - ' \n' + '' else: tlStr += \ - ' \n' + translate['Inbox'] + '' # if this is a news instance and we are viewing the news timeline newsHeader = False @@ -6190,32 +6254,32 @@ def headerButtonsTimeline(defaultTimeline: str, if not newsHeader: tlStr += \ - ' \n' + '' tlStr += \ - ' \n' + '' # typically the media button if defaultTimeline != 'tlmedia': if not minimal and not newsHeader: tlStr += \ - ' \n' + '' else: if not minimal: tlStr += \ - ' \n' + '' isFeaturesTimeline = \ defaultTimeline == 'tlnews' and boxName == 'tlnews' @@ -6229,41 +6293,41 @@ def headerButtonsTimeline(defaultTimeline: str, if defaultTimeline == 'tlnews': titleStr = translate['Article'] tlStr += \ - ' \n' + '' else: if not minimal: tlStr += \ - ' \n' + '' # typically the news button # but may change if this is a news oriented instance if defaultTimeline != 'tlnews': tlStr += \ - ' \n' + '' else: if not newsHeader: tlStr += \ - ' \n' + '' if not newsHeader: # button for the outbox tlStr += \ - ' \n' + '' # add other buttons tlStr += \ @@ -6278,44 +6342,44 @@ def headerButtonsTimeline(defaultTimeline: str, # happening today button if not iconsAsButtons: tlStr += \ - ' ' + \ '\n' + translate['Happening Today'] + '' else: tlStr += \ - ' ' + \ '\n' + translate['Happening Today'] + '' # happening this week button if thisWeeksEventsCheck(baseDir, nickname, domain): if not iconsAsButtons: tlStr += \ - ' \n' + translate['Happening This Week'] + '' else: tlStr += \ - ' \n' + translate['Happening This Week'] + '' else: # happening this week button if thisWeeksEventsCheck(baseDir, nickname, domain): if not iconsAsButtons: tlStr += \ - ' \n' + translate['Happening This Week'] + '' else: tlStr += \ - ' \n' + translate['Happening This Week'] + '' if not newsHeader: if not iconsAsButtons: @@ -6326,13 +6390,13 @@ def headerButtonsTimeline(defaultTimeline: str, iconsDir + '/search.png" title="' + \ translate['Search and follow'] + '" alt="| ' + \ translate['Search and follow'] + \ - '" class="timelineicon"/>\n' + '" class="timelineicon"/>' else: tlStr += \ - ' \n' + '' # benchmark 5 timeDiff = int((time.time() - timelineStartTime) * 1000) @@ -6355,10 +6419,10 @@ def headerButtonsTimeline(defaultTimeline: str, '" class="timelineicon"/>\n' else: tlStr += \ - ' \n' + '' if not newsHeader: # the show/hide button, for a simpler header appearance @@ -6372,50 +6436,58 @@ def headerButtonsTimeline(defaultTimeline: str, '" class="timelineicon"/>\n' else: tlStr += \ - ' \n' + '' if newsHeader: tlStr += \ - ' \n' + '' + \ + '' # the newswire button to show right column links if not iconsAsButtons: tlStr += \ - ' ' + \ '| ' + translate['News'] + \
-            '\n' + '" class="timelineicon"/>' else: + # NOTE: deliberately no \n at end of line tlStr += \ - ' \n' + '' # the links button to show left column links if not iconsAsButtons: tlStr += \ - ' ' + \ '| ' + translate['Edit Links'] + \
-            '\n' + '" class="timelineicon"/>' else: + # NOTE: deliberately no \n at end of line tlStr += \ - ' \n' + '' + + if newsHeader: + tlStr += \ + '' + \ + '' if not newsHeader: tlStr += followApprovals @@ -6517,10 +6589,6 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str, print('ERROR: css file not found ' + cssFilename) return None - # load css - profileStyle = \ - profileStyle.replace('banner.png', - '/users/' + nickname + '/' + bannerFile) # replace any https within the css with whatever prefix is needed if httpPrefix != 'https': profileStyle = \ @@ -6631,12 +6699,11 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str, moderationButtonStr = '' if moderator and not minimal: moderationButtonStr = \ - ' ' + \ '\n' + ' ' # shares, bookmarks and events buttons sharesButtonStr = '' @@ -6644,23 +6711,20 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str, eventsButtonStr = '' if not minimal: sharesButtonStr = \ - ' ' + \ '\n' + '' bookmarksButtonStr = \ - ' ' + \ '\n' + '' eventsButtonStr = \ - ' ' + \ '\n' + '' tlStr = htmlHeader(cssFilename, profileStyle) @@ -6673,7 +6737,7 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str, if boxName == 'dm': if not iconsAsButtons: newPostButtonStr = \ - ' ' + \ '\n' + translate['Post'] + ' ' elif boxName == 'tlblogs' or boxName == 'tlnews': if not iconsAsButtons: newPostButtonStr = \ - ' | ' + \
@@ -6697,11 +6761,11 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
             newPostButtonStr = \
                 '<a href=' + \ '\n' + translate['Post'] + '' elif boxName == 'tlevents': if not iconsAsButtons: newPostButtonStr = \ - ' | ' + \
@@ -6711,12 +6775,12 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
             newPostButtonStr = \
                 '<a href=' + \ '\n' + translate['Post'] + '' else: if not manuallyApproveFollowers: if not iconsAsButtons: newPostButtonStr = \ - ' | ' + \
@@ -6726,11 +6790,11 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
                 newPostButtonStr = \
                     '<a href=' + \ '\n' + translate['Post'] + '' else: if not iconsAsButtons: newPostButtonStr = \ - ' ' + \ '\n' + translate['Post'] + '' # This creates a link to the profile page when viewed # in lynx, but should be invisible in a graphical web browser tlStr += \ @@ -6754,7 +6818,7 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str, translate['Switch to profile view'] + '" alt="' + \ translate['Switch to profile view'] + '">\n' tlStr += '\n' + usersPath + '/' + bannerFile + '" />\n' if fullWidthTimelineButtonHeader: tlStr += \ @@ -6969,6 +7033,18 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str, if boxName == 'tlmedia': tlStr += '
\n' + # page down arrow + if itemCtr > 2: + tlStr += \ + '
\n' + \ + ' ' + \
+            translate['Page down'] + '\n' + \ + '
\n' + # end of column-center tlStr += '
\n' + \ - '
\n' + \ - ' ' + \
-            translate['Page down'] + '\n' + \ - '
\n' + \ - '
\n' tlStr += htmlFooter() @@ -7932,6 +7990,13 @@ def htmlPersonOptions(cssCache: {}, translate: {}, baseDir: str, profileStyle.replace('--follow-text-entry-width: 90%;', '--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 snoozeButtonStr = 'Snooze' if nickname: @@ -8041,26 +8106,26 @@ def htmlPersonOptions(cssCache: {}, translate: {}, baseDir: str, optionsStr += optionsLinkStr optionsStr += \ ' \n' + 'name="submitBack">' + translate['Go Back'] + '' optionsStr += \ ' \n' + translate['View'] + '' optionsStr += donateStr optionsStr += \ ' \n' + followStr + '">' + translate[followStr] + '' optionsStr += \ ' \n' + blockStr + '">' + translate[blockStr] + '' optionsStr += \ ' \n' + translate['DM'] + '' optionsStr += \ ' \n' + snoozeButtonStr + '">' + translate[snoozeButtonStr] + '' optionsStr += \ ' \n' + translate['Report'] + '' personNotes = '' personNotesFilename = \ @@ -8596,7 +8661,8 @@ def htmlHashTagSwarm(baseDir: str, actor: str) -> str: 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 """ actor = path.replace('/search', '') @@ -8613,26 +8679,44 @@ def htmlSearch(cssCache: {}, translate: {}, 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) # show a banner above the search box - searchBannerFilename = \ - baseDir + '/accounts/' + searchNickname + '@' + domain + \ - '/search_banner.png' + searchBannerFile, searchBannerFilename = \ + getSearchBannerFile(baseDir, searchNickname, domain) if not os.path.isfile(searchBannerFilename): + # get the default search banner for the theme theme = getConfigParam(baseDir, 'theme').lower() if theme == 'default': theme = '' else: theme = '_' + theme - themeSearchBannerFilename = \ - baseDir + '/img/search_banner' + theme + '.png' - if os.path.isfile(themeSearchBannerFilename): - copyfile(themeSearchBannerFilename, searchBannerFilename) + bannerExtensions = ('png', 'jpg', 'jpeg', 'gif', 'avif', 'webp') + for ext in bannerExtensions: + searchBannerFile = 'search_banner.' + ext + searchBannerFilename = \ + baseDir + '/accounts/' + \ + searchNickname + '@' + domain + '/' + searchBannerFile + themeSearchBannerFilename = \ + baseDir + '/img/search_banner' + theme + '.' + ext + if os.path.isfile(themeSearchBannerFilename): + copyfile(themeSearchBannerFilename, searchBannerFilename) + break if os.path.isfile(searchBannerFilename): - followStr += '
\n
\n' + \ - '







' + \ - '







\n
\n
\n' + usersPath = '/users/' + searchNickname + followStr += \ + '\n' + followStr += '\n' # show the search box followStr += '