mirror of https://gitlab.com/bashrc2/epicyon
Move to external css
parent
96ed5f2696
commit
c9ef1cccb1
32
webapp.py
32
webapp.py
|
@ -8,7 +8,6 @@ __status__ = "Production"
|
||||||
|
|
||||||
import os
|
import os
|
||||||
from shutil import copyfile
|
from shutil import copyfile
|
||||||
from utils import getCSS
|
|
||||||
from utils import getNicknameFromActor
|
from utils import getNicknameFromActor
|
||||||
from utils import getDomainFromActor
|
from utils import getDomainFromActor
|
||||||
from utils import locatePost
|
from utils import locatePost
|
||||||
|
@ -16,7 +15,7 @@ from utils import loadJson
|
||||||
from shares import getValidSharedItemID
|
from shares import getValidSharedItemID
|
||||||
from webapp_utils import getAltPath
|
from webapp_utils import getAltPath
|
||||||
from webapp_utils import getIconsDir
|
from webapp_utils import getIconsDir
|
||||||
from webapp_utils import htmlHeader
|
from webapp_utils import htmlHeaderWithExternalStyle
|
||||||
from webapp_utils import htmlFooter
|
from webapp_utils import htmlFooter
|
||||||
from webapp_post import individualPostAsHtml
|
from webapp_post import individualPostAsHtml
|
||||||
|
|
||||||
|
@ -34,9 +33,7 @@ def htmlFollowingList(cssCache: {}, baseDir: str,
|
||||||
if os.path.isfile(baseDir + '/epicyon.css'):
|
if os.path.isfile(baseDir + '/epicyon.css'):
|
||||||
cssFilename = baseDir + '/epicyon.css'
|
cssFilename = baseDir + '/epicyon.css'
|
||||||
|
|
||||||
profileCSS = getCSS(baseDir, cssFilename, cssCache)
|
followingListHtml = htmlHeaderWithExternalStyle(cssFilename)
|
||||||
if profileCSS:
|
|
||||||
followingListHtml = htmlHeader(cssFilename, profileCSS)
|
|
||||||
for followingAddress in followingList:
|
for followingAddress in followingList:
|
||||||
if followingAddress:
|
if followingAddress:
|
||||||
followingListHtml += \
|
followingListHtml += \
|
||||||
|
@ -55,9 +52,7 @@ def htmlHashtagBlocked(cssCache: {}, baseDir: str, translate: {}) -> str:
|
||||||
if os.path.isfile(baseDir + '/suspended.css'):
|
if os.path.isfile(baseDir + '/suspended.css'):
|
||||||
cssFilename = baseDir + '/suspended.css'
|
cssFilename = baseDir + '/suspended.css'
|
||||||
|
|
||||||
blockedHashtagCSS = getCSS(baseDir, cssFilename, cssCache)
|
blockedHashtagForm = htmlHeaderWithExternalStyle(cssFilename)
|
||||||
if blockedHashtagCSS:
|
|
||||||
blockedHashtagForm = htmlHeader(cssFilename, blockedHashtagCSS)
|
|
||||||
blockedHashtagForm += '<div><center>\n'
|
blockedHashtagForm += '<div><center>\n'
|
||||||
blockedHashtagForm += \
|
blockedHashtagForm += \
|
||||||
' <p class="screentitle">' + \
|
' <p class="screentitle">' + \
|
||||||
|
@ -108,8 +103,7 @@ def htmlRemoveSharedItem(cssCache: {}, translate: {}, baseDir: str,
|
||||||
if os.path.isfile(baseDir + '/follow.css'):
|
if os.path.isfile(baseDir + '/follow.css'):
|
||||||
cssFilename = baseDir + '/follow.css'
|
cssFilename = baseDir + '/follow.css'
|
||||||
|
|
||||||
profileStyle = getCSS(baseDir, cssFilename, cssCache)
|
sharesStr = htmlHeaderWithExternalStyle(cssFilename)
|
||||||
sharesStr = htmlHeader(cssFilename, profileStyle)
|
|
||||||
sharesStr += '<div class="follow">\n'
|
sharesStr += '<div class="follow">\n'
|
||||||
sharesStr += ' <div class="followAvatar">\n'
|
sharesStr += ' <div class="followAvatar">\n'
|
||||||
sharesStr += ' <center>\n'
|
sharesStr += ' <center>\n'
|
||||||
|
@ -179,12 +173,7 @@ def htmlDeletePost(cssCache: {},
|
||||||
if os.path.isfile(baseDir + '/epicyon.css'):
|
if os.path.isfile(baseDir + '/epicyon.css'):
|
||||||
cssFilename = baseDir + '/epicyon.css'
|
cssFilename = baseDir + '/epicyon.css'
|
||||||
|
|
||||||
profileStyle = getCSS(baseDir, cssFilename, cssCache)
|
deletePostStr = htmlHeaderWithExternalStyle(cssFilename)
|
||||||
if profileStyle:
|
|
||||||
if httpPrefix != 'https':
|
|
||||||
profileStyle = profileStyle.replace('https://',
|
|
||||||
httpPrefix + '://')
|
|
||||||
deletePostStr = htmlHeader(cssFilename, profileStyle)
|
|
||||||
deletePostStr += \
|
deletePostStr += \
|
||||||
individualPostAsHtml(True, recentPostsCache, maxRecentPosts,
|
individualPostAsHtml(True, recentPostsCache, maxRecentPosts,
|
||||||
iconsDir, translate, pageNumber,
|
iconsDir, translate, pageNumber,
|
||||||
|
@ -238,8 +227,7 @@ def htmlFollowConfirm(cssCache: {}, translate: {}, baseDir: str,
|
||||||
if os.path.isfile(baseDir + '/follow.css'):
|
if os.path.isfile(baseDir + '/follow.css'):
|
||||||
cssFilename = baseDir + '/follow.css'
|
cssFilename = baseDir + '/follow.css'
|
||||||
|
|
||||||
profileStyle = getCSS(baseDir, cssFilename, cssCache)
|
followStr = htmlHeaderWithExternalStyle(cssFilename)
|
||||||
followStr = htmlHeader(cssFilename, profileStyle)
|
|
||||||
followStr += '<div class="follow">\n'
|
followStr += '<div class="follow">\n'
|
||||||
followStr += ' <div class="followAvatar">\n'
|
followStr += ' <div class="followAvatar">\n'
|
||||||
followStr += ' <center>\n'
|
followStr += ' <center>\n'
|
||||||
|
@ -283,9 +271,7 @@ def htmlUnfollowConfirm(cssCache: {}, translate: {}, baseDir: str,
|
||||||
if os.path.isfile(baseDir + '/follow.css'):
|
if os.path.isfile(baseDir + '/follow.css'):
|
||||||
cssFilename = baseDir + '/follow.css'
|
cssFilename = baseDir + '/follow.css'
|
||||||
|
|
||||||
profileStyle = getCSS(baseDir, cssFilename, cssCache)
|
followStr = htmlHeaderWithExternalStyle(cssFilename)
|
||||||
|
|
||||||
followStr = htmlHeader(cssFilename, profileStyle)
|
|
||||||
followStr += '<div class="follow">\n'
|
followStr += '<div class="follow">\n'
|
||||||
followStr += ' <div class="followAvatar">\n'
|
followStr += ' <div class="followAvatar">\n'
|
||||||
followStr += ' <center>\n'
|
followStr += ' <center>\n'
|
||||||
|
@ -330,9 +316,7 @@ def htmlUnblockConfirm(cssCache: {}, translate: {}, baseDir: str,
|
||||||
if os.path.isfile(baseDir + '/follow.css'):
|
if os.path.isfile(baseDir + '/follow.css'):
|
||||||
cssFilename = baseDir + '/follow.css'
|
cssFilename = baseDir + '/follow.css'
|
||||||
|
|
||||||
profileStyle = getCSS(baseDir, cssFilename, cssCache)
|
blockStr = htmlHeaderWithExternalStyle(cssFilename)
|
||||||
|
|
||||||
blockStr = htmlHeader(cssFilename, profileStyle)
|
|
||||||
blockStr += '<div class="block">\n'
|
blockStr += '<div class="block">\n'
|
||||||
blockStr += ' <div class="blockAvatar">\n'
|
blockStr += ' <div class="blockAvatar">\n'
|
||||||
blockStr += ' <center>\n'
|
blockStr += ' <center>\n'
|
||||||
|
|
|
@ -8,9 +8,8 @@ __status__ = "Production"
|
||||||
|
|
||||||
import os
|
import os
|
||||||
from shutil import copyfile
|
from shutil import copyfile
|
||||||
from utils import getCSS
|
|
||||||
from utils import getConfigParam
|
from utils import getConfigParam
|
||||||
from webapp_utils import htmlHeader
|
from webapp_utils import htmlHeaderWithExternalStyle
|
||||||
from webapp_utils import htmlFooter
|
from webapp_utils import htmlFooter
|
||||||
|
|
||||||
|
|
||||||
|
@ -38,13 +37,7 @@ def htmlAbout(cssCache: {}, baseDir: str, httpPrefix: str,
|
||||||
if os.path.isfile(baseDir + '/epicyon.css'):
|
if os.path.isfile(baseDir + '/epicyon.css'):
|
||||||
cssFilename = baseDir + '/epicyon.css'
|
cssFilename = baseDir + '/epicyon.css'
|
||||||
|
|
||||||
aboutCSS = getCSS(baseDir, cssFilename, cssCache)
|
aboutForm = htmlHeaderWithExternalStyle(cssFilename)
|
||||||
if aboutCSS:
|
|
||||||
if httpPrefix != 'http':
|
|
||||||
aboutCSS = aboutCSS.replace('https://',
|
|
||||||
httpPrefix + '://')
|
|
||||||
|
|
||||||
aboutForm = htmlHeader(cssFilename, aboutCSS)
|
|
||||||
aboutForm += '<div class="container">' + aboutText + '</div>'
|
aboutForm += '<div class="container">' + aboutText + '</div>'
|
||||||
if onionDomain:
|
if onionDomain:
|
||||||
aboutForm += \
|
aboutForm += \
|
||||||
|
|
|
@ -14,11 +14,10 @@ from utils import getNicknameFromActor
|
||||||
from utils import getDomainFromActor
|
from utils import getDomainFromActor
|
||||||
from utils import locatePost
|
from utils import locatePost
|
||||||
from utils import loadJson
|
from utils import loadJson
|
||||||
from utils import getCSS
|
|
||||||
from utils import weekDayOfMonthStart
|
from utils import weekDayOfMonthStart
|
||||||
from happening import getTodaysEvents
|
from happening import getTodaysEvents
|
||||||
from happening import getCalendarEvents
|
from happening import getCalendarEvents
|
||||||
from webapp_utils import htmlHeader
|
from webapp_utils import htmlHeaderWithExternalStyle
|
||||||
from webapp_utils import htmlFooter
|
from webapp_utils import htmlFooter
|
||||||
from webapp_utils import getAltPath
|
from webapp_utils import getAltPath
|
||||||
from webapp_utils import getIconsDir
|
from webapp_utils import getIconsDir
|
||||||
|
@ -54,12 +53,7 @@ def htmlCalendarDeleteConfirm(cssCache: {}, translate: {}, baseDir: str,
|
||||||
if os.path.isfile(baseDir + '/epicyon.css'):
|
if os.path.isfile(baseDir + '/epicyon.css'):
|
||||||
cssFilename = baseDir + '/epicyon.css'
|
cssFilename = baseDir + '/epicyon.css'
|
||||||
|
|
||||||
profileStyle = getCSS(baseDir, cssFilename, cssCache)
|
deletePostStr = htmlHeaderWithExternalStyle(cssFilename)
|
||||||
if profileStyle:
|
|
||||||
if httpPrefix != 'https':
|
|
||||||
profileStyle = profileStyle.replace('https://',
|
|
||||||
httpPrefix + '://')
|
|
||||||
deletePostStr = htmlHeader(cssFilename, profileStyle)
|
|
||||||
deletePostStr += \
|
deletePostStr += \
|
||||||
'<center><h1>' + postTime + ' ' + str(year) + '/' + \
|
'<center><h1>' + postTime + ' ' + str(year) + '/' + \
|
||||||
str(monthNumber) + \
|
str(monthNumber) + \
|
||||||
|
@ -112,13 +106,11 @@ def htmlCalendarDay(cssCache: {}, translate: {},
|
||||||
if os.path.isfile(baseDir + '/calendar.css'):
|
if os.path.isfile(baseDir + '/calendar.css'):
|
||||||
cssFilename = baseDir + '/calendar.css'
|
cssFilename = baseDir + '/calendar.css'
|
||||||
|
|
||||||
calendarStyle = getCSS(baseDir, cssFilename, cssCache)
|
|
||||||
|
|
||||||
calActor = actor
|
calActor = actor
|
||||||
if '/users/' in actor:
|
if '/users/' in actor:
|
||||||
calActor = '/users/' + actor.split('/users/')[1]
|
calActor = '/users/' + actor.split('/users/')[1]
|
||||||
|
|
||||||
calendarStr = htmlHeader(cssFilename, calendarStyle)
|
calendarStr = htmlHeaderWithExternalStyle(cssFilename)
|
||||||
calendarStr += '<main><table class="calendar">\n'
|
calendarStr += '<main><table class="calendar">\n'
|
||||||
calendarStr += '<caption class="calendar__banner--month">\n'
|
calendarStr += '<caption class="calendar__banner--month">\n'
|
||||||
calendarStr += \
|
calendarStr += \
|
||||||
|
@ -298,13 +290,11 @@ def htmlCalendar(cssCache: {}, translate: {},
|
||||||
if os.path.isfile(baseDir + '/calendar.css'):
|
if os.path.isfile(baseDir + '/calendar.css'):
|
||||||
cssFilename = baseDir + '/calendar.css'
|
cssFilename = baseDir + '/calendar.css'
|
||||||
|
|
||||||
calendarStyle = getCSS(baseDir, cssFilename, cssCache)
|
|
||||||
|
|
||||||
calActor = actor
|
calActor = actor
|
||||||
if '/users/' in actor:
|
if '/users/' in actor:
|
||||||
calActor = '/users/' + actor.split('/users/')[1]
|
calActor = '/users/' + actor.split('/users/')[1]
|
||||||
|
|
||||||
calendarStr = htmlHeader(cssFilename, calendarStyle)
|
calendarStr = htmlHeaderWithExternalStyle(cssFilename)
|
||||||
calendarStr += '<main><table class="calendar">\n'
|
calendarStr += '<main><table class="calendar">\n'
|
||||||
calendarStr += '<caption class="calendar__banner--month">\n'
|
calendarStr += '<caption class="calendar__banner--month">\n'
|
||||||
calendarStr += \
|
calendarStr += \
|
||||||
|
|
|
@ -11,8 +11,7 @@ import time
|
||||||
from shutil import copyfile
|
from shutil import copyfile
|
||||||
from utils import getConfigParam
|
from utils import getConfigParam
|
||||||
from utils import noOfAccounts
|
from utils import noOfAccounts
|
||||||
from utils import getCSS
|
from webapp_utils import htmlHeaderWithExternalStyle
|
||||||
from webapp_utils import htmlHeader
|
|
||||||
from webapp_utils import htmlFooter
|
from webapp_utils import htmlFooter
|
||||||
|
|
||||||
|
|
||||||
|
@ -100,11 +99,6 @@ def htmlLogin(cssCache: {}, translate: {},
|
||||||
if os.path.isfile(baseDir + '/login.css'):
|
if os.path.isfile(baseDir + '/login.css'):
|
||||||
cssFilename = baseDir + '/login.css'
|
cssFilename = baseDir + '/login.css'
|
||||||
|
|
||||||
loginCSS = getCSS(baseDir, cssFilename, cssCache)
|
|
||||||
if not loginCSS:
|
|
||||||
print('ERROR: login css file missing ' + cssFilename)
|
|
||||||
return None
|
|
||||||
|
|
||||||
# show the register button
|
# show the register button
|
||||||
registerButtonStr = ''
|
registerButtonStr = ''
|
||||||
if getConfigParam(baseDir, 'registration') == 'open':
|
if getConfigParam(baseDir, 'registration') == 'open':
|
||||||
|
@ -135,7 +129,7 @@ def htmlLogin(cssCache: {}, translate: {},
|
||||||
if not autocomplete:
|
if not autocomplete:
|
||||||
autocompleteStr = 'autocomplete="off" value=""'
|
autocompleteStr = 'autocomplete="off" value=""'
|
||||||
|
|
||||||
loginForm = htmlHeader(cssFilename, loginCSS)
|
loginForm = htmlHeaderWithExternalStyle(cssFilename)
|
||||||
loginForm += '<br>\n'
|
loginForm += '<br>\n'
|
||||||
loginForm += '<form method="POST" action="/login">\n'
|
loginForm += '<form method="POST" action="/login">\n'
|
||||||
loginForm += ' <div class="imgcontainer">\n'
|
loginForm += ' <div class="imgcontainer">\n'
|
||||||
|
|
|
@ -7,9 +7,8 @@ __email__ = "bob@freedombone.net"
|
||||||
__status__ = "Production"
|
__status__ = "Production"
|
||||||
|
|
||||||
import os
|
import os
|
||||||
from utils import getCSS
|
|
||||||
from webapp_timeline import htmlTimeline
|
from webapp_timeline import htmlTimeline
|
||||||
from webapp_utils import htmlHeader
|
from webapp_utils import htmlHeaderWithExternalStyle
|
||||||
from webapp_utils import htmlFooter
|
from webapp_utils import htmlFooter
|
||||||
|
|
||||||
|
|
||||||
|
@ -56,12 +55,7 @@ def htmlModerationInfo(cssCache: {}, translate: {},
|
||||||
if os.path.isfile(baseDir + '/epicyon.css'):
|
if os.path.isfile(baseDir + '/epicyon.css'):
|
||||||
cssFilename = baseDir + '/epicyon.css'
|
cssFilename = baseDir + '/epicyon.css'
|
||||||
|
|
||||||
infoCSS = getCSS(baseDir, cssFilename, cssCache)
|
infoForm = htmlHeaderWithExternalStyle(cssFilename)
|
||||||
if infoCSS:
|
|
||||||
if httpPrefix != 'https':
|
|
||||||
infoCSS = infoCSS.replace('https://',
|
|
||||||
httpPrefix + '://')
|
|
||||||
infoForm = htmlHeader(cssFilename, infoCSS)
|
|
||||||
|
|
||||||
infoForm += \
|
infoForm += \
|
||||||
'<center><h1>' + \
|
'<center><h1>' + \
|
||||||
|
|
|
@ -13,11 +13,10 @@ from person import isPersonSnoozed
|
||||||
from posts import isModerator
|
from posts import isModerator
|
||||||
from utils import getDomainFromActor
|
from utils import getDomainFromActor
|
||||||
from utils import getNicknameFromActor
|
from utils import getNicknameFromActor
|
||||||
from utils import getCSS
|
|
||||||
from blocking import isBlocked
|
from blocking import isBlocked
|
||||||
from follow import isFollowingActor
|
from follow import isFollowingActor
|
||||||
from followingCalendar import receivingCalendarEvents
|
from followingCalendar import receivingCalendarEvents
|
||||||
from webapp_utils import htmlHeader
|
from webapp_utils import htmlHeaderWithExternalStyle
|
||||||
from webapp_utils import htmlFooter
|
from webapp_utils import htmlFooter
|
||||||
|
|
||||||
|
|
||||||
|
@ -83,19 +82,6 @@ def htmlPersonOptions(defaultTimeline: str,
|
||||||
if os.path.isfile(baseDir + '/options.css'):
|
if os.path.isfile(baseDir + '/options.css'):
|
||||||
cssFilename = baseDir + '/options.css'
|
cssFilename = baseDir + '/options.css'
|
||||||
|
|
||||||
profileStyle = getCSS(baseDir, cssFilename, cssCache)
|
|
||||||
if profileStyle:
|
|
||||||
profileStyle = \
|
|
||||||
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
|
# To snooze, or not to snooze? That is the question
|
||||||
snoozeButtonStr = 'Snooze'
|
snoozeButtonStr = 'Snooze'
|
||||||
if nickname:
|
if nickname:
|
||||||
|
@ -109,7 +95,7 @@ def htmlPersonOptions(defaultTimeline: str,
|
||||||
'"><button class="button" name="submitDonate">' + \
|
'"><button class="button" name="submitDonate">' + \
|
||||||
translate['Donate'] + '</button></a>\n'
|
translate['Donate'] + '</button></a>\n'
|
||||||
|
|
||||||
optionsStr = htmlHeader(cssFilename, profileStyle)
|
optionsStr = htmlHeaderWithExternalStyle(cssFilename)
|
||||||
optionsStr += '<br><br>\n'
|
optionsStr += '<br><br>\n'
|
||||||
optionsStr += '<div class="options">\n'
|
optionsStr += '<div class="options">\n'
|
||||||
optionsStr += ' <div class="optionsAvatar">\n'
|
optionsStr += ' <div class="optionsAvatar">\n'
|
||||||
|
|
|
@ -25,7 +25,6 @@ from posts import downloadAnnounce
|
||||||
from posts import populateRepliesJson
|
from posts import populateRepliesJson
|
||||||
from utils import locatePost
|
from utils import locatePost
|
||||||
from utils import loadJson
|
from utils import loadJson
|
||||||
from utils import getCSS
|
|
||||||
from utils import getCachedPostDirectory
|
from utils import getCachedPostDirectory
|
||||||
from utils import getCachedPostFilename
|
from utils import getCachedPostFilename
|
||||||
from utils import getProtocolPrefixes
|
from utils import getProtocolPrefixes
|
||||||
|
@ -55,7 +54,7 @@ from webapp_utils import postContainsPublic
|
||||||
from webapp_utils import getContentWarningButton
|
from webapp_utils import getContentWarningButton
|
||||||
from webapp_utils import getPostAttachmentsAsHtml
|
from webapp_utils import getPostAttachmentsAsHtml
|
||||||
from webapp_utils import getIconsDir
|
from webapp_utils import getIconsDir
|
||||||
from webapp_utils import htmlHeader
|
from webapp_utils import htmlHeaderWithExternalStyle
|
||||||
from webapp_utils import htmlFooter
|
from webapp_utils import htmlFooter
|
||||||
from webapp_media import addEmbeddedElements
|
from webapp_media import addEmbeddedElements
|
||||||
from webapp_question import insertQuestion
|
from webapp_question import insertQuestion
|
||||||
|
@ -1338,12 +1337,7 @@ def htmlIndividualPost(cssCache: {},
|
||||||
if os.path.isfile(baseDir + '/epicyon.css'):
|
if os.path.isfile(baseDir + '/epicyon.css'):
|
||||||
cssFilename = baseDir + '/epicyon.css'
|
cssFilename = baseDir + '/epicyon.css'
|
||||||
|
|
||||||
postsCSS = getCSS(baseDir, cssFilename, cssCache)
|
return htmlHeaderWithExternalStyle(cssFilename) + postStr + htmlFooter()
|
||||||
if postsCSS:
|
|
||||||
if httpPrefix != 'https':
|
|
||||||
postsCSS = postsCSS.replace('https://',
|
|
||||||
httpPrefix + '://')
|
|
||||||
return htmlHeader(cssFilename, postsCSS) + postStr + htmlFooter()
|
|
||||||
|
|
||||||
|
|
||||||
def htmlPostReplies(cssCache: {},
|
def htmlPostReplies(cssCache: {},
|
||||||
|
@ -1376,9 +1370,4 @@ def htmlPostReplies(cssCache: {},
|
||||||
if os.path.isfile(baseDir + '/epicyon.css'):
|
if os.path.isfile(baseDir + '/epicyon.css'):
|
||||||
cssFilename = baseDir + '/epicyon.css'
|
cssFilename = baseDir + '/epicyon.css'
|
||||||
|
|
||||||
postsCSS = getCSS(baseDir, cssFilename, cssCache)
|
return htmlHeaderWithExternalStyle(cssFilename) + repliesStr + htmlFooter()
|
||||||
if postsCSS:
|
|
||||||
if httpPrefix != 'https':
|
|
||||||
postsCSS = postsCSS.replace('https://',
|
|
||||||
httpPrefix + '://')
|
|
||||||
return htmlHeader(cssFilename, postsCSS) + repliesStr + htmlFooter()
|
|
||||||
|
|
|
@ -10,7 +10,6 @@ import os
|
||||||
from pprint import pprint
|
from pprint import pprint
|
||||||
from utils import getNicknameFromActor
|
from utils import getNicknameFromActor
|
||||||
from utils import getDomainFromActor
|
from utils import getDomainFromActor
|
||||||
from utils import getCSS
|
|
||||||
from utils import isSystemAccount
|
from utils import isSystemAccount
|
||||||
from utils import removeHtml
|
from utils import removeHtml
|
||||||
from utils import loadJson
|
from utils import loadJson
|
||||||
|
@ -34,7 +33,7 @@ from tox import getToxAddress
|
||||||
from webapp_utils import scheduledPostsExist
|
from webapp_utils import scheduledPostsExist
|
||||||
from webapp_utils import getPersonAvatarUrl
|
from webapp_utils import getPersonAvatarUrl
|
||||||
from webapp_utils import getIconsDir
|
from webapp_utils import getIconsDir
|
||||||
from webapp_utils import htmlHeader
|
from webapp_utils import htmlHeaderWithExternalStyle
|
||||||
from webapp_utils import htmlFooter
|
from webapp_utils import htmlFooter
|
||||||
from webapp_utils import addEmojiToDisplayName
|
from webapp_utils import addEmojiToDisplayName
|
||||||
from webapp_utils import headerButtonsFrontScreen
|
from webapp_utils import headerButtonsFrontScreen
|
||||||
|
@ -108,8 +107,6 @@ def htmlProfileAfterSearch(cssCache: {},
|
||||||
if os.path.isfile(baseDir + '/epicyon.css'):
|
if os.path.isfile(baseDir + '/epicyon.css'):
|
||||||
cssFilename = baseDir + '/epicyon.css'
|
cssFilename = baseDir + '/epicyon.css'
|
||||||
|
|
||||||
profileStyle = getCSS(baseDir, cssFilename, cssCache)
|
|
||||||
if profileStyle:
|
|
||||||
wf = \
|
wf = \
|
||||||
webfingerHandle(session,
|
webfingerHandle(session,
|
||||||
searchNickname + '@' + searchDomainFull,
|
searchNickname + '@' + searchDomainFull,
|
||||||
|
@ -179,16 +176,12 @@ def htmlProfileAfterSearch(cssCache: {},
|
||||||
print('DEBUG: No outbox found')
|
print('DEBUG: No outbox found')
|
||||||
return None
|
return None
|
||||||
outboxUrl = profileJson['outbox']
|
outboxUrl = profileJson['outbox']
|
||||||
profileBackgroundImage = ''
|
|
||||||
if profileJson.get('image'):
|
|
||||||
if profileJson['image'].get('url'):
|
|
||||||
profileBackgroundImage = profileJson['image']['url']
|
|
||||||
|
|
||||||
profileStyle = profileStyle.replace('image.png',
|
# profileBackgroundImage = ''
|
||||||
profileBackgroundImage)
|
# if profileJson.get('image'):
|
||||||
if httpPrefix != 'https':
|
# if profileJson['image'].get('url'):
|
||||||
profileStyle = profileStyle.replace('https://',
|
# profileBackgroundImage = profileJson['image']['url']
|
||||||
httpPrefix + '://')
|
|
||||||
# url to return to
|
# url to return to
|
||||||
backUrl = path
|
backUrl = path
|
||||||
if not backUrl.endswith('/inbox'):
|
if not backUrl.endswith('/inbox'):
|
||||||
|
@ -272,7 +265,7 @@ def htmlProfileAfterSearch(cssCache: {},
|
||||||
if i >= 20:
|
if i >= 20:
|
||||||
break
|
break
|
||||||
|
|
||||||
return htmlHeader(cssFilename, profileStyle) + profileStr + htmlFooter()
|
return htmlHeaderWithExternalStyle(cssFilename) + profileStr + htmlFooter()
|
||||||
|
|
||||||
|
|
||||||
def htmlProfile(rssIconAtTop: bool,
|
def htmlProfile(rssIconAtTop: bool,
|
||||||
|
@ -566,17 +559,12 @@ def htmlProfile(rssIconAtTop: bool,
|
||||||
if os.path.isfile(baseDir + '/epicyon.css'):
|
if os.path.isfile(baseDir + '/epicyon.css'):
|
||||||
cssFilename = baseDir + '/epicyon.css'
|
cssFilename = baseDir + '/epicyon.css'
|
||||||
|
|
||||||
profileStyle = getCSS(baseDir, cssFilename, cssCache)
|
|
||||||
if profileStyle:
|
|
||||||
profileStyle = \
|
|
||||||
profileStyle.replace('image.png',
|
|
||||||
profileJson['image']['url'])
|
|
||||||
if isSystemAccount(nickname):
|
if isSystemAccount(nickname):
|
||||||
bannerFile, bannerFilename = \
|
bannerFile, bannerFilename = \
|
||||||
getBannerFile(baseDir, nickname, domain)
|
getBannerFile(baseDir, nickname, domain)
|
||||||
profileStyle = \
|
# profileStyle = \
|
||||||
profileStyle.replace('banner.png',
|
# profileStyle.replace('banner.png',
|
||||||
'/users/' + nickname + '/' + bannerFile)
|
# '/users/' + nickname + '/' + bannerFile)
|
||||||
|
|
||||||
licenseStr = \
|
licenseStr = \
|
||||||
'<a href="https://gitlab.com/bashrc2/epicyon">' + \
|
'<a href="https://gitlab.com/bashrc2/epicyon">' + \
|
||||||
|
@ -642,7 +630,7 @@ def htmlProfile(rssIconAtTop: bool,
|
||||||
profileFooterStr += '</table>\n'
|
profileFooterStr += '</table>\n'
|
||||||
|
|
||||||
profileStr = \
|
profileStr = \
|
||||||
htmlHeader(cssFilename, profileStyle) + \
|
htmlHeaderWithExternalStyle(cssFilename) + \
|
||||||
profileStr + profileFooterStr + htmlFooter()
|
profileStr + profileFooterStr + htmlFooter()
|
||||||
return profileStr
|
return profileStr
|
||||||
|
|
||||||
|
@ -989,12 +977,6 @@ def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str,
|
||||||
if os.path.isfile(baseDir + '/epicyon.css'):
|
if os.path.isfile(baseDir + '/epicyon.css'):
|
||||||
cssFilename = baseDir + '/epicyon.css'
|
cssFilename = baseDir + '/epicyon.css'
|
||||||
|
|
||||||
editProfileCSS = getCSS(baseDir, cssFilename, cssCache)
|
|
||||||
if editProfileCSS:
|
|
||||||
if httpPrefix != 'https':
|
|
||||||
editProfileCSS = \
|
|
||||||
editProfileCSS.replace('https://', httpPrefix + '://')
|
|
||||||
|
|
||||||
moderatorsStr = ''
|
moderatorsStr = ''
|
||||||
themesDropdown = ''
|
themesDropdown = ''
|
||||||
instanceStr = ''
|
instanceStr = ''
|
||||||
|
@ -1114,7 +1096,7 @@ def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str,
|
||||||
'<option value="' + themeName +
|
'<option value="' + themeName +
|
||||||
'" selected>')
|
'" selected>')
|
||||||
|
|
||||||
editProfileForm = htmlHeader(cssFilename, editProfileCSS)
|
editProfileForm = htmlHeaderWithExternalStyle(cssFilename)
|
||||||
|
|
||||||
# top banner
|
# top banner
|
||||||
editProfileForm += \
|
editProfileForm += \
|
||||||
|
|
|
@ -7,8 +7,7 @@ __email__ = "bob@freedombone.net"
|
||||||
__status__ = "Production"
|
__status__ = "Production"
|
||||||
|
|
||||||
import os
|
import os
|
||||||
from utils import getCSS
|
from webapp_utils import htmlHeaderWithExternalStyle
|
||||||
from webapp_utils import htmlHeader
|
|
||||||
from webapp_utils import htmlFooter
|
from webapp_utils import htmlFooter
|
||||||
|
|
||||||
|
|
||||||
|
@ -20,9 +19,7 @@ def htmlSuspended(cssCache: {}, baseDir: str) -> str:
|
||||||
if os.path.isfile(baseDir + '/suspended.css'):
|
if os.path.isfile(baseDir + '/suspended.css'):
|
||||||
cssFilename = baseDir + '/suspended.css'
|
cssFilename = baseDir + '/suspended.css'
|
||||||
|
|
||||||
suspendedCSS = getCSS(baseDir, cssFilename, cssCache)
|
suspendedForm = htmlHeaderWithExternalStyle(cssFilename)
|
||||||
if suspendedCSS:
|
|
||||||
suspendedForm = htmlHeader(cssFilename, suspendedCSS)
|
|
||||||
suspendedForm += '<div><center>\n'
|
suspendedForm += '<div><center>\n'
|
||||||
suspendedForm += ' <p class="screentitle">Account Suspended</p>\n'
|
suspendedForm += ' <p class="screentitle">Account Suspended</p>\n'
|
||||||
suspendedForm += ' <p>See <a href="/terms">Terms of Service</a></p>\n'
|
suspendedForm += ' <p>See <a href="/terms">Terms of Service</a></p>\n'
|
||||||
|
|
|
@ -8,9 +8,8 @@ __status__ = "Production"
|
||||||
|
|
||||||
import os
|
import os
|
||||||
from shutil import copyfile
|
from shutil import copyfile
|
||||||
from utils import getCSS
|
|
||||||
from utils import getConfigParam
|
from utils import getConfigParam
|
||||||
from webapp_utils import htmlHeader
|
from webapp_utils import htmlHeaderWithExternalStyle
|
||||||
from webapp_utils import htmlFooter
|
from webapp_utils import htmlFooter
|
||||||
|
|
||||||
|
|
||||||
|
@ -38,12 +37,7 @@ def htmlTermsOfService(cssCache: {}, baseDir: str,
|
||||||
if os.path.isfile(baseDir + '/epicyon.css'):
|
if os.path.isfile(baseDir + '/epicyon.css'):
|
||||||
cssFilename = baseDir + '/epicyon.css'
|
cssFilename = baseDir + '/epicyon.css'
|
||||||
|
|
||||||
termsCSS = getCSS(baseDir, cssFilename, cssCache)
|
TOSForm = htmlHeaderWithExternalStyle(cssFilename)
|
||||||
if termsCSS:
|
|
||||||
if httpPrefix != 'https':
|
|
||||||
termsCSS = termsCSS.replace('https://', httpPrefix+'://')
|
|
||||||
|
|
||||||
TOSForm = htmlHeader(cssFilename, termsCSS)
|
|
||||||
TOSForm += '<div class="container">' + TOSText + '</div>\n'
|
TOSForm += '<div class="container">' + TOSText + '</div>\n'
|
||||||
if adminNickname:
|
if adminNickname:
|
||||||
adminActor = httpPrefix + '://' + domainFull + \
|
adminActor = httpPrefix + '://' + domainFull + \
|
||||||
|
|
Loading…
Reference in New Issue