mirror of https://gitlab.com/bashrc2/epicyon
css can be customised
parent
e311fdebb2
commit
191c7e1725
182
webinterface.py
182
webinterface.py
|
@ -59,12 +59,15 @@ def htmlSearchEmoji(translate: {},baseDir: str,searchStr: str) -> str:
|
||||||
copyfile(baseDir+'/emoji/default_emoji.json',baseDir+'/emoji/emoji.json')
|
copyfile(baseDir+'/emoji/default_emoji.json',baseDir+'/emoji/emoji.json')
|
||||||
|
|
||||||
searchStr=searchStr.lower().replace(':','').strip('\n')
|
searchStr=searchStr.lower().replace(':','').strip('\n')
|
||||||
with open(baseDir+'/epicyon-profile.css', 'r') as cssFile:
|
cssFilename=baseDir+'/epicyon-profile.css'
|
||||||
|
if os.path.isfile(baseDir+'/epicyon.css'):
|
||||||
|
cssFilename=baseDir+'/epicyon.css'
|
||||||
|
with open(cssFilename, 'r') as cssFile:
|
||||||
emojiCSS=cssFile.read()
|
emojiCSS=cssFile.read()
|
||||||
emojiLookupFilename=baseDir+'/emoji/emoji.json'
|
emojiLookupFilename=baseDir+'/emoji/emoji.json'
|
||||||
|
|
||||||
# create header
|
# create header
|
||||||
emojiForm=htmlHeader(emojiCSS)
|
emojiForm=htmlHeader(cssFilename,emojiCSS)
|
||||||
emojiForm+='<center><h1>'+translate['Emoji Search']+'</h1></center>'
|
emojiForm+='<center><h1>'+translate['Emoji Search']+'</h1></center>'
|
||||||
|
|
||||||
# does the lookup file exist?
|
# does the lookup file exist?
|
||||||
|
@ -108,9 +111,12 @@ def htmlSearchSharedItems(translate: {}, \
|
||||||
sharedItemsForm=''
|
sharedItemsForm=''
|
||||||
searchStrLower=searchStr.replace('%2B','+').replace('%40','@').replace('%3A',':').replace('%23','#').lower().strip('\n')
|
searchStrLower=searchStr.replace('%2B','+').replace('%40','@').replace('%3A',':').replace('%23','#').lower().strip('\n')
|
||||||
searchStrLowerList=searchStrLower.split('+')
|
searchStrLowerList=searchStrLower.split('+')
|
||||||
with open(baseDir+'/epicyon-profile.css', 'r') as cssFile:
|
cssFilename=baseDir+'/epicyon.css'
|
||||||
|
if os.path.isfile(baseDir+'/epicyon.css'):
|
||||||
|
cssFilename=baseDir+'/epicyon.css'
|
||||||
|
with open(cssFilename, 'r') as cssFile:
|
||||||
sharedItemsCSS=cssFile.read()
|
sharedItemsCSS=cssFile.read()
|
||||||
sharedItemsForm=htmlHeader(sharedItemsCSS)
|
sharedItemsForm=htmlHeader(cssFilename,sharedItemsCSS)
|
||||||
sharedItemsForm+='<center><h1>'+translate['Shared Items Search']+'</h1></center>'
|
sharedItemsForm+='<center><h1>'+translate['Shared Items Search']+'</h1></center>'
|
||||||
resultsExist=False
|
resultsExist=False
|
||||||
for subdir, dirs, files in os.walk(baseDir+'/accounts'):
|
for subdir, dirs, files in os.walk(baseDir+'/accounts'):
|
||||||
|
@ -188,9 +194,12 @@ def htmlSearchSharedItems(translate: {}, \
|
||||||
|
|
||||||
def htmlModerationInfo(translate: {},baseDir: str) -> str:
|
def htmlModerationInfo(translate: {},baseDir: str) -> str:
|
||||||
infoForm=''
|
infoForm=''
|
||||||
with open(baseDir+'/epicyon-profile.css', 'r') as cssFile:
|
cssFilename=baseDir+'/epicyon-profile.css'
|
||||||
|
if os.path.isfile(baseDir+'/epicyon.css'):
|
||||||
|
cssFilename=baseDir+'/epicyon.css'
|
||||||
|
with open(cssFilename, 'r') as cssFile:
|
||||||
infoCSS=cssFile.read()
|
infoCSS=cssFile.read()
|
||||||
infoForm=htmlHeader(infoCSS)
|
infoForm=htmlHeader(cssFilename,infoCSS)
|
||||||
|
|
||||||
infoForm+='<center><h1>'+translate['Moderation Information']+'</h1></center>'
|
infoForm+='<center><h1>'+translate['Moderation Information']+'</h1></center>'
|
||||||
|
|
||||||
|
@ -238,8 +247,10 @@ def htmlHashtagSearch(translate: {}, \
|
||||||
# read the index
|
# read the index
|
||||||
with open(hashtagIndexFile, "r") as f:
|
with open(hashtagIndexFile, "r") as f:
|
||||||
lines = f.readlines()
|
lines = f.readlines()
|
||||||
|
cssFilename=baseDir+'/epicyon-profile.css'
|
||||||
with open(baseDir+'/epicyon-profile.css', 'r') as cssFile:
|
if os.path.isfile(baseDir+'/epicyon.css'):
|
||||||
|
cssFilename=baseDir+'/epicyon.css'
|
||||||
|
with open(cssFilename, 'r') as cssFile:
|
||||||
hashtagSearchCSS = cssFile.read()
|
hashtagSearchCSS = cssFile.read()
|
||||||
|
|
||||||
startIndex=len(lines)-1-int(pageNumber*postsPerPage)
|
startIndex=len(lines)-1-int(pageNumber*postsPerPage)
|
||||||
|
@ -249,7 +260,7 @@ def htmlHashtagSearch(translate: {}, \
|
||||||
if endIndex<0:
|
if endIndex<0:
|
||||||
endIndex=0
|
endIndex=0
|
||||||
|
|
||||||
hashtagSearchForm=htmlHeader(hashtagSearchCSS)
|
hashtagSearchForm=htmlHeader(cssFilename,hashtagSearchCSS)
|
||||||
hashtagSearchForm+='<center><h1>#'+hashtag+'</h1></center>'
|
hashtagSearchForm+='<center><h1>#'+hashtag+'</h1></center>'
|
||||||
if startIndex!=len(lines)-1:
|
if startIndex!=len(lines)-1:
|
||||||
# previous page link
|
# previous page link
|
||||||
|
@ -362,10 +373,13 @@ def htmlSkillsSearch(translate: {},baseDir: str, \
|
||||||
|
|
||||||
results.sort(reverse=True)
|
results.sort(reverse=True)
|
||||||
|
|
||||||
with open(baseDir+'/epicyon-profile.css', 'r') as cssFile:
|
cssFilename=baseDir+'/epicyon-profile.css'
|
||||||
|
if os.path.isfile(baseDir+'/epicyon.css'):
|
||||||
|
cssFilename=baseDir+'/epicyon.css'
|
||||||
|
with open(cssFilename, 'r') as cssFile:
|
||||||
skillSearchCSS = cssFile.read()
|
skillSearchCSS = cssFile.read()
|
||||||
|
|
||||||
skillSearchForm=htmlHeader(skillSearchCSS)
|
skillSearchForm=htmlHeader(cssFilename,skillSearchCSS)
|
||||||
skillSearchForm+='<center><h1>'+translate['Skills search']+': '+skillsearch+'</h1></center>'
|
skillSearchForm+='<center><h1>'+translate['Skills search']+': '+skillsearch+'</h1></center>'
|
||||||
|
|
||||||
if len(results)==0:
|
if len(results)==0:
|
||||||
|
@ -454,8 +468,11 @@ def htmlEditProfile(translate: {},baseDir: str,path: str,domain: str,port: int)
|
||||||
|
|
||||||
skillsStr+='<p><input type="text" placeholder="Skill '+str(skillCtr)+'" name="skillName'+str(skillCtr)+'" value="" style="width:40%">'
|
skillsStr+='<p><input type="text" placeholder="Skill '+str(skillCtr)+'" name="skillName'+str(skillCtr)+'" value="" style="width:40%">'
|
||||||
skillsStr+='<input type="range" min="1" max="100" class="slider" name="skillValue'+str(skillCtr)+'" value="50"></p>' \
|
skillsStr+='<input type="range" min="1" max="100" class="slider" name="skillValue'+str(skillCtr)+'" value="50"></p>' \
|
||||||
|
|
||||||
with open(baseDir+'/epicyon-profile.css', 'r') as cssFile:
|
cssFilename=baseDir+'/epicyon-profile.css'
|
||||||
|
if os.path.isfile(baseDir+'/epicyon.css'):
|
||||||
|
cssFilename=baseDir+'/epicyon.css'
|
||||||
|
with open(cssFilename, 'r') as cssFile:
|
||||||
editProfileCSS = cssFile.read()
|
editProfileCSS = cssFile.read()
|
||||||
|
|
||||||
moderatorsStr=''
|
moderatorsStr=''
|
||||||
|
@ -473,7 +490,7 @@ def htmlEditProfile(translate: {},baseDir: str,path: str,domain: str,port: int)
|
||||||
' <textarea id="message" name="moderators" placeholder="'+translate['List of moderator nicknames']+'..." style="height:200px">'+moderators+'</textarea>' \
|
' <textarea id="message" name="moderators" placeholder="'+translate['List of moderator nicknames']+'..." style="height:200px">'+moderators+'</textarea>' \
|
||||||
'</div>'
|
'</div>'
|
||||||
|
|
||||||
editProfileForm=htmlHeader(editProfileCSS)
|
editProfileForm=htmlHeader(cssFilename,editProfileCSS)
|
||||||
editProfileForm+= \
|
editProfileForm+= \
|
||||||
'<form enctype="multipart/form-data" method="POST" action="'+path+'/profiledata">' \
|
'<form enctype="multipart/form-data" method="POST" action="'+path+'/profiledata">' \
|
||||||
' <div class="vertical-center">' \
|
' <div class="vertical-center">' \
|
||||||
|
@ -567,7 +584,10 @@ def htmlLogin(translate: {},baseDir: str) -> str:
|
||||||
with open(baseDir+'/accounts/login.txt', 'r') as file:
|
with open(baseDir+'/accounts/login.txt', 'r') as file:
|
||||||
loginText = '<p class="login-text">'+file.read()+'</p>'
|
loginText = '<p class="login-text">'+file.read()+'</p>'
|
||||||
|
|
||||||
with open(baseDir+'/epicyon-login.css', 'r') as cssFile:
|
cssFilename=baseDir+'/epicyon-login.css'
|
||||||
|
if os.path.isfile(baseDir+'/login.css'):
|
||||||
|
cssFilename=baseDir+'/login.css'
|
||||||
|
with open(cssFilename, 'r') as cssFile:
|
||||||
loginCSS = cssFile.read()
|
loginCSS = cssFile.read()
|
||||||
|
|
||||||
# show the register button
|
# show the register button
|
||||||
|
@ -585,7 +605,7 @@ def htmlLogin(translate: {},baseDir: str) -> str:
|
||||||
if accounts>0:
|
if accounts>0:
|
||||||
loginButtonStr='<button type="submit" name="submit">'+translate['Login']+'</button>'
|
loginButtonStr='<button type="submit" name="submit">'+translate['Login']+'</button>'
|
||||||
|
|
||||||
loginForm=htmlHeader(loginCSS)
|
loginForm=htmlHeader(cssFilename,loginCSS)
|
||||||
loginForm+= \
|
loginForm+= \
|
||||||
'<form method="POST" action="/login">' \
|
'<form method="POST" action="/login">' \
|
||||||
' <div class="imgcontainer">' \
|
' <div class="imgcontainer">' \
|
||||||
|
@ -621,10 +641,13 @@ def htmlTermsOfService(baseDir: str,httpPrefix: str,domainFull: str) -> str:
|
||||||
TOSText = file.read()
|
TOSText = file.read()
|
||||||
|
|
||||||
TOSForm=''
|
TOSForm=''
|
||||||
with open(baseDir+'/epicyon-profile.css', 'r') as cssFile:
|
cssFilename=baseDir+'/epicyon-profile.css'
|
||||||
|
if os.path.isfile(baseDir+'/epicyon.css'):
|
||||||
|
cssFilename=baseDir+'/epicyon.css'
|
||||||
|
with open(cssFilename, 'r') as cssFile:
|
||||||
termsCSS = cssFile.read()
|
termsCSS = cssFile.read()
|
||||||
|
|
||||||
TOSForm=htmlHeader(termsCSS)
|
TOSForm=htmlHeader(cssFilename,termsCSS)
|
||||||
TOSForm+='<div class="container">'+TOSText+'</div>'
|
TOSForm+='<div class="container">'+TOSText+'</div>'
|
||||||
if adminNickname:
|
if adminNickname:
|
||||||
adminActor=httpPrefix+'://'+domainFull+'/users/'+adminNickname
|
adminActor=httpPrefix+'://'+domainFull+'/users/'+adminNickname
|
||||||
|
@ -648,10 +671,13 @@ def htmlAbout(baseDir: str,httpPrefix: str,domainFull: str) -> str:
|
||||||
aboutText = file.read()
|
aboutText = file.read()
|
||||||
|
|
||||||
aboutForm=''
|
aboutForm=''
|
||||||
with open(baseDir+'/epicyon-profile.css', 'r') as cssFile:
|
cssFilename=baseDir+'/epicyon-profile.css'
|
||||||
|
if os.path.isfile(baseDir+'/epicyon.css'):
|
||||||
|
cssFilename=baseDir+'/epicyon.css'
|
||||||
|
with open(cssFilename, 'r') as cssFile:
|
||||||
termsCSS = cssFile.read()
|
termsCSS = cssFile.read()
|
||||||
|
|
||||||
aboutForm=htmlHeader(termsCSS)
|
aboutForm=htmlHeader(cssFilename,termsCSS)
|
||||||
aboutForm+='<div class="container">'+aboutText+'</div>'
|
aboutForm+='<div class="container">'+aboutText+'</div>'
|
||||||
if adminNickname:
|
if adminNickname:
|
||||||
adminActor=httpPrefix+'://'+domainFull+'/users/'+adminNickname
|
adminActor=httpPrefix+'://'+domainFull+'/users/'+adminNickname
|
||||||
|
@ -663,9 +689,12 @@ def htmlHashtagBlocked(baseDir: str) -> str:
|
||||||
"""Show the screen for a blocked hashtag
|
"""Show the screen for a blocked hashtag
|
||||||
"""
|
"""
|
||||||
blockedHashtagForm=''
|
blockedHashtagForm=''
|
||||||
with open(baseDir+'/epicyon-suspended.css', 'r') as cssFile:
|
cssFilename=baseDir+'/epicyon-suspended.css'
|
||||||
|
if os.path.isfile(baseDir+'/suspended.css'):
|
||||||
|
cssFilename=baseDir+'/suspended.css'
|
||||||
|
with open(cssFilename, 'r') as cssFile:
|
||||||
blockedHashtagCSS=cssFile.read()
|
blockedHashtagCSS=cssFile.read()
|
||||||
blockedHashtagForm=htmlHeader(blockedHashtagCSS)
|
blockedHashtagForm=htmlHeader(cssFilename,blockedHashtagCSS)
|
||||||
blockedHashtagForm+='<div><center>'
|
blockedHashtagForm+='<div><center>'
|
||||||
blockedHashtagForm+=' <p class="screentitle">Hashtag Blocked</p>'
|
blockedHashtagForm+=' <p class="screentitle">Hashtag Blocked</p>'
|
||||||
blockedHashtagForm+=' <p>See <a href="/terms">Terms of Service</a></p>'
|
blockedHashtagForm+=' <p>See <a href="/terms">Terms of Service</a></p>'
|
||||||
|
@ -677,9 +706,12 @@ def htmlSuspended(baseDir: str) -> str:
|
||||||
"""Show the screen for suspended accounts
|
"""Show the screen for suspended accounts
|
||||||
"""
|
"""
|
||||||
suspendedForm=''
|
suspendedForm=''
|
||||||
with open(baseDir+'/epicyon-suspended.css', 'r') as cssFile:
|
cssFilename=baseDir+'/epicyon-suspended.css'
|
||||||
|
if os.path.isfile(baseDir+'/suspended.css'):
|
||||||
|
cssFilename=baseDir+'/suspended.css'
|
||||||
|
with open(cssFilename, 'r') as cssFile:
|
||||||
suspendedCSS=cssFile.read()
|
suspendedCSS=cssFile.read()
|
||||||
suspendedForm=htmlHeader(suspendedCSS)
|
suspendedForm=htmlHeader(cssFilename,suspendedCSS)
|
||||||
suspendedForm+='<div><center>'
|
suspendedForm+='<div><center>'
|
||||||
suspendedForm+=' <p class="screentitle">Account Suspended</p>'
|
suspendedForm+=' <p class="screentitle">Account Suspended</p>'
|
||||||
suspendedForm+=' <p>See <a href="/terms">Terms of Service</a></p>'
|
suspendedForm+=' <p>See <a href="/terms">Terms of Service</a></p>'
|
||||||
|
@ -722,7 +754,10 @@ def htmlNewPost(translate: {},baseDir: str, \
|
||||||
with open(baseDir+'/accounts/newpost.txt', 'r') as file:
|
with open(baseDir+'/accounts/newpost.txt', 'r') as file:
|
||||||
newPostText = '<p class="new-post-text">'+file.read()+'</p>'
|
newPostText = '<p class="new-post-text">'+file.read()+'</p>'
|
||||||
|
|
||||||
with open(baseDir+'/epicyon-profile.css', 'r') as cssFile:
|
cssFilename=baseDir+'/epicyon-profile.css'
|
||||||
|
if os.path.isfile(baseDir+'/epicyon.css'):
|
||||||
|
cssFilename=baseDir+'/epicyon.css'
|
||||||
|
with open(cssFilename, 'r') as cssFile:
|
||||||
newPostCSS = cssFile.read()
|
newPostCSS = cssFile.read()
|
||||||
|
|
||||||
if '?' in path:
|
if '?' in path:
|
||||||
|
@ -765,7 +800,7 @@ def htmlNewPost(translate: {},baseDir: str, \
|
||||||
'</div>' \
|
'</div>' \
|
||||||
'<input type="text" placeholder="'+translate['City or location of the shared item']+'" name="location">'
|
'<input type="text" placeholder="'+translate['City or location of the shared item']+'" name="location">'
|
||||||
|
|
||||||
newPostForm=htmlHeader(newPostCSS)
|
newPostForm=htmlHeader(cssFilename,newPostCSS)
|
||||||
|
|
||||||
# only show the share option if this is not a reply
|
# only show the share option if this is not a reply
|
||||||
shareOptionOnDropdown=''
|
shareOptionOnDropdown=''
|
||||||
|
@ -855,19 +890,21 @@ def htmlNewPost(translate: {},baseDir: str, \
|
||||||
newPostForm+=htmlFooter()
|
newPostForm+=htmlFooter()
|
||||||
return newPostForm
|
return newPostForm
|
||||||
|
|
||||||
def htmlHeader(css=None,refreshSec=0,lang='en') -> str:
|
def htmlHeader(cssFilename: str,css=None,refreshSec=0,lang='en') -> str:
|
||||||
if refreshSec==0:
|
if refreshSec==0:
|
||||||
meta=' <meta charset="utf-8">\n'
|
meta=' <meta charset="utf-8">\n'
|
||||||
else:
|
else:
|
||||||
meta=' <meta http-equiv="Refresh" content="'+str(refreshSec)+'" charset="utf-8">\n'
|
meta=' <meta http-equiv="Refresh" content="'+str(refreshSec)+'" charset="utf-8">\n'
|
||||||
|
|
||||||
if not css:
|
if not css:
|
||||||
|
if '/' in cssFilename:
|
||||||
|
cssFilename=cssFilename.split('/')[-1]
|
||||||
htmlStr= \
|
htmlStr= \
|
||||||
'<!DOCTYPE html>\n' \
|
'<!DOCTYPE html>\n' \
|
||||||
'<html lang="'+lang+'">\n'+ \
|
'<html lang="'+lang+'">\n'+ \
|
||||||
meta+ \
|
meta+ \
|
||||||
' <style>\n' \
|
' <style>\n' \
|
||||||
' @import url("epicyon-profile.css");\n'+ \
|
' @import url("'+cssFilename+'");\n'+ \
|
||||||
' background-color: #282c37' \
|
' background-color: #282c37' \
|
||||||
' </style>\n' \
|
' </style>\n' \
|
||||||
' <body>\n'
|
' <body>\n'
|
||||||
|
@ -1112,7 +1149,10 @@ def htmlProfile(translate: {},projectVersion: str, \
|
||||||
|
|
||||||
profileStr+=followApprovalsSection
|
profileStr+=followApprovalsSection
|
||||||
|
|
||||||
with open(baseDir+'/epicyon-profile.css', 'r') as cssFile:
|
cssFilename=baseDir+'/epicyon-profile.css'
|
||||||
|
if os.path.isfile(baseDir+'/epicyon.css'):
|
||||||
|
cssFilename=baseDir+'/epicyon.css'
|
||||||
|
with open(cssFilename, 'r') as cssFile:
|
||||||
profileStyle = cssFile.read().replace('image.png',actor+'/image.png')
|
profileStyle = cssFile.read().replace('image.png',actor+'/image.png')
|
||||||
|
|
||||||
if selected=='posts':
|
if selected=='posts':
|
||||||
|
@ -1151,7 +1191,7 @@ def htmlProfile(translate: {},projectVersion: str, \
|
||||||
if selected=='shares':
|
if selected=='shares':
|
||||||
profileStr+= \
|
profileStr+= \
|
||||||
htmlProfileShares(translate,nickname,domainFull,extraJson)
|
htmlProfileShares(translate,nickname,domainFull,extraJson)
|
||||||
profileStr=htmlHeader(profileStyle)+profileStr+htmlFooter()
|
profileStr=htmlHeader(cssFilename,profileStyle)+profileStr+htmlFooter()
|
||||||
return profileStr
|
return profileStr
|
||||||
|
|
||||||
def individualFollowAsHtml(translate: {}, \
|
def individualFollowAsHtml(translate: {}, \
|
||||||
|
@ -1825,7 +1865,10 @@ def htmlTimeline(translate: {},pageNumber: int, \
|
||||||
manuallyApproveFollowers: bool) -> str:
|
manuallyApproveFollowers: bool) -> str:
|
||||||
"""Show the timeline as html
|
"""Show the timeline as html
|
||||||
"""
|
"""
|
||||||
with open(baseDir+'/epicyon-profile.css', 'r') as cssFile:
|
cssFilename=baseDir+'/epicyon-profile.css'
|
||||||
|
if os.path.isfile(baseDir+'/epicyon.css'):
|
||||||
|
cssFilename=baseDir+'/epicyon.css'
|
||||||
|
with open(cssFilename, 'r') as cssFile:
|
||||||
profileStyle = \
|
profileStyle = \
|
||||||
cssFile.read().replace('banner.png', \
|
cssFile.read().replace('banner.png', \
|
||||||
'/users/'+nickname+'/banner.png')
|
'/users/'+nickname+'/banner.png')
|
||||||
|
@ -1864,10 +1907,10 @@ def htmlTimeline(translate: {},pageNumber: int, \
|
||||||
if moderator:
|
if moderator:
|
||||||
moderationButtonStr='<a href="'+actor+'/moderation"><button class="'+moderationButton+'"><span>'+translate['Mod']+' </span></button></a>'
|
moderationButtonStr='<a href="'+actor+'/moderation"><button class="'+moderationButton+'"><span>'+translate['Mod']+' </span></button></a>'
|
||||||
|
|
||||||
tlStr=htmlHeader(profileStyle)
|
tlStr=htmlHeader(cssFilename,profileStyle)
|
||||||
#if (boxName=='inbox' or boxName=='dm') and pageNumber==1:
|
#if (boxName=='inbox' or boxName=='dm') and pageNumber==1:
|
||||||
# refresh if on the first page of the inbox and dm timeline
|
# refresh if on the first page of the inbox and dm timeline
|
||||||
#tlStr=htmlHeader(profileStyle,240)
|
#tlStr=htmlHeader(cssFilename,profileStyle,240)
|
||||||
|
|
||||||
if boxName!='dm':
|
if boxName!='dm':
|
||||||
if not manuallyApproveFollowers:
|
if not manuallyApproveFollowers:
|
||||||
|
@ -2033,7 +2076,8 @@ def htmlIndividualPost(translate: {}, \
|
||||||
nickname,domain,port,item,None,True,False, \
|
nickname,domain,port,item,None,True,False, \
|
||||||
httpPrefix,projectVersion, \
|
httpPrefix,projectVersion, \
|
||||||
False,authorized,False,False)
|
False,authorized,False,False)
|
||||||
return htmlHeader()+postStr+htmlFooter()
|
cssFilename=baseDir+'/epicyon-profile.css'
|
||||||
|
return htmlHeader(cssFilename)+postStr+htmlFooter()
|
||||||
|
|
||||||
def htmlPostReplies(translate: {},baseDir: str, \
|
def htmlPostReplies(translate: {},baseDir: str, \
|
||||||
session,wfRequest: {},personCache: {}, \
|
session,wfRequest: {},personCache: {}, \
|
||||||
|
@ -2051,7 +2095,8 @@ def htmlPostReplies(translate: {},baseDir: str, \
|
||||||
httpPrefix,projectVersion, \
|
httpPrefix,projectVersion, \
|
||||||
False,False,False,False)
|
False,False,False,False)
|
||||||
|
|
||||||
return htmlHeader()+repliesStr+htmlFooter()
|
cssFilename=baseDir+'/epicyon-profile.css'
|
||||||
|
return htmlHeader(cssFilename)+repliesStr+htmlFooter()
|
||||||
|
|
||||||
def htmlRemoveSharedItem(translate: {},baseDir: str,actor: str,shareName: str) -> str:
|
def htmlRemoveSharedItem(translate: {},baseDir: str,actor: str,shareName: str) -> str:
|
||||||
"""Shows a screen asking to confirm the removal of a shared item
|
"""Shows a screen asking to confirm the removal of a shared item
|
||||||
|
@ -2077,9 +2122,12 @@ def htmlRemoveSharedItem(translate: {},baseDir: str,actor: str,shareName: str) -
|
||||||
if not os.path.isfile(baseDir+'/accounts/shares-background.png'):
|
if not os.path.isfile(baseDir+'/accounts/shares-background.png'):
|
||||||
copyfile(baseDir+'/img/shares-background.png',baseDir+'/accounts/shares-background.png')
|
copyfile(baseDir+'/img/shares-background.png',baseDir+'/accounts/shares-background.png')
|
||||||
|
|
||||||
with open(baseDir+'/epicyon-follow.css', 'r') as cssFile:
|
cssFilename=baseDir+'/epicyon-follow.css'
|
||||||
|
if os.path.isfile(baseDir+'/follow.css'):
|
||||||
|
cssFilename=baseDir+'/follow.css'
|
||||||
|
with open(cssFilename, 'r') as cssFile:
|
||||||
profileStyle = cssFile.read()
|
profileStyle = cssFile.read()
|
||||||
sharesStr=htmlHeader(profileStyle)
|
sharesStr=htmlHeader(cssFilename,profileStyle)
|
||||||
sharesStr+='<div class="follow">'
|
sharesStr+='<div class="follow">'
|
||||||
sharesStr+=' <div class="followAvatar">'
|
sharesStr+=' <div class="followAvatar">'
|
||||||
sharesStr+=' <center>'
|
sharesStr+=' <center>'
|
||||||
|
@ -2124,9 +2172,12 @@ def htmlDeletePost(translate,pageNumber: int, \
|
||||||
baseDir+'/accounts/delete-background.png')
|
baseDir+'/accounts/delete-background.png')
|
||||||
|
|
||||||
deletePostStr=None
|
deletePostStr=None
|
||||||
with open(baseDir+'/epicyon-profile.css', 'r') as cssFile:
|
cssFilename=baseDir+'/epicyon-profile.css'
|
||||||
|
if os.path.isfile(baseDir+'/epicyon.css'):
|
||||||
|
cssFilename=baseDir+'/epicyon.css'
|
||||||
|
with open(cssFilename, 'r') as cssFile:
|
||||||
profileStyle = cssFile.read()
|
profileStyle = cssFile.read()
|
||||||
deletePostStr=htmlHeader(profileStyle)
|
deletePostStr=htmlHeader(cssFilename,profileStyle)
|
||||||
deletePostStr+='<script>'+contentWarningScript()+'</script>'
|
deletePostStr+='<script>'+contentWarningScript()+'</script>'
|
||||||
deletePostStr+= \
|
deletePostStr+= \
|
||||||
individualPostAsHtml(translate,pageNumber, \
|
individualPostAsHtml(translate,pageNumber, \
|
||||||
|
@ -2160,9 +2211,12 @@ def htmlFollowConfirm(translate: {},baseDir: str, \
|
||||||
if not os.path.isfile(baseDir+'/accounts/follow-background.png'):
|
if not os.path.isfile(baseDir+'/accounts/follow-background.png'):
|
||||||
copyfile(baseDir+'/img/follow-background.png',baseDir+'/accounts/follow-background.png')
|
copyfile(baseDir+'/img/follow-background.png',baseDir+'/accounts/follow-background.png')
|
||||||
|
|
||||||
with open(baseDir+'/epicyon-follow.css', 'r') as cssFile:
|
cssFilename=baseDir+'/epicyon-follow.css'
|
||||||
|
if os.path.isfile(baseDir+'/follow.css'):
|
||||||
|
cssFilename=baseDir+'/follow.css'
|
||||||
|
with open(cssFilename, 'r') as cssFile:
|
||||||
profileStyle = cssFile.read()
|
profileStyle = cssFile.read()
|
||||||
followStr=htmlHeader(profileStyle)
|
followStr=htmlHeader(cssFilename,profileStyle)
|
||||||
followStr+='<div class="follow">'
|
followStr+='<div class="follow">'
|
||||||
followStr+=' <div class="followAvatar">'
|
followStr+=' <div class="followAvatar">'
|
||||||
followStr+=' <center>'
|
followStr+=' <center>'
|
||||||
|
@ -2193,9 +2247,12 @@ def htmlUnfollowConfirm(translate: {},baseDir: str, \
|
||||||
if not os.path.isfile(baseDir+'/accounts/follow-background.png'):
|
if not os.path.isfile(baseDir+'/accounts/follow-background.png'):
|
||||||
copyfile(baseDir+'/img/follow-background.png',baseDir+'/accounts/follow-background.png')
|
copyfile(baseDir+'/img/follow-background.png',baseDir+'/accounts/follow-background.png')
|
||||||
|
|
||||||
with open(baseDir+'/epicyon-follow.css', 'r') as cssFile:
|
cssFilename=baseDir+'/epicyon-follow.css'
|
||||||
|
if os.path.isfile(baseDir+'/follow.css'):
|
||||||
|
cssFilename=baseDir+'/follow.css'
|
||||||
|
with open(cssFilename, 'r') as cssFile:
|
||||||
profileStyle = cssFile.read()
|
profileStyle = cssFile.read()
|
||||||
followStr=htmlHeader(profileStyle)
|
followStr=htmlHeader(cssFilename,profileStyle)
|
||||||
followStr+='<div class="follow">'
|
followStr+='<div class="follow">'
|
||||||
followStr+=' <div class="followAvatar">'
|
followStr+=' <div class="followAvatar">'
|
||||||
followStr+=' <center>'
|
followStr+=' <center>'
|
||||||
|
@ -2251,9 +2308,12 @@ def htmlPersonOptions(translate: {},baseDir: str, \
|
||||||
optionsLinkStr=''
|
optionsLinkStr=''
|
||||||
if optionsLink:
|
if optionsLink:
|
||||||
optionsLinkStr=' <input type="hidden" name="postUrl" value="'+optionsLink+'">'
|
optionsLinkStr=' <input type="hidden" name="postUrl" value="'+optionsLink+'">'
|
||||||
with open(baseDir+'/epicyon-follow.css', 'r') as cssFile:
|
cssFilename=baseDir+'/epicyon-follow.css'
|
||||||
|
if os.path.isfile(baseDir+'/follow.css'):
|
||||||
|
cssFilename=baseDir+'/follow.css'
|
||||||
|
with open(cssFilename, 'r') as cssFile:
|
||||||
profileStyle = cssFile.read()
|
profileStyle = cssFile.read()
|
||||||
optionsStr=htmlHeader(profileStyle)
|
optionsStr=htmlHeader(cssFilename,profileStyle)
|
||||||
optionsStr+='<div class="options">'
|
optionsStr+='<div class="options">'
|
||||||
optionsStr+=' <div class="optionsAvatar">'
|
optionsStr+=' <div class="optionsAvatar">'
|
||||||
optionsStr+=' <center>'
|
optionsStr+=' <center>'
|
||||||
|
@ -2292,7 +2352,7 @@ def htmlPersonOptions(translate: {},baseDir: str, \
|
||||||
#
|
#
|
||||||
# with open(baseDir+'/epicyon-follow.css', 'r') as cssFile:
|
# with open(baseDir+'/epicyon-follow.css', 'r') as cssFile:
|
||||||
# profileStyle = cssFile.read()
|
# profileStyle = cssFile.read()
|
||||||
# blockStr=htmlHeader(profileStyle)
|
# blockStr=htmlHeader(cssFilename,profileStyle)
|
||||||
# blockStr+='<div class="block">'
|
# blockStr+='<div class="block">'
|
||||||
# blockStr+=' <div class="blockAvatar">'
|
# blockStr+=' <div class="blockAvatar">'
|
||||||
# blockStr+=' <center>'
|
# blockStr+=' <center>'
|
||||||
|
@ -2323,9 +2383,12 @@ def htmlUnblockConfirm(translate: {},baseDir: str, \
|
||||||
if not os.path.isfile(baseDir+'/accounts/block-background.png'):
|
if not os.path.isfile(baseDir+'/accounts/block-background.png'):
|
||||||
copyfile(baseDir+'/img/block-background.png',baseDir+'/accounts/block-background.png')
|
copyfile(baseDir+'/img/block-background.png',baseDir+'/accounts/block-background.png')
|
||||||
|
|
||||||
with open(baseDir+'/epicyon-follow.css', 'r') as cssFile:
|
cssFilename=baseDir+'/epicyon-follow.css'
|
||||||
|
if os.path.isfile(baseDir+'/follow.css'):
|
||||||
|
cssFilename=baseDir+'/follow.css'
|
||||||
|
with open(cssFilename, 'r') as cssFile:
|
||||||
profileStyle = cssFile.read()
|
profileStyle = cssFile.read()
|
||||||
blockStr=htmlHeader(profileStyle)
|
blockStr=htmlHeader(cssFilename,profileStyle)
|
||||||
blockStr+='<div class="block">'
|
blockStr+='<div class="block">'
|
||||||
blockStr+=' <div class="blockAvatar">'
|
blockStr+=' <div class="blockAvatar">'
|
||||||
blockStr+=' <center>'
|
blockStr+=' <center>'
|
||||||
|
@ -2359,9 +2422,12 @@ def htmlSearchEmojiTextEntry(translate: {}, \
|
||||||
if not os.path.isfile(baseDir+'/accounts/search-background.png'):
|
if not os.path.isfile(baseDir+'/accounts/search-background.png'):
|
||||||
copyfile(baseDir+'/img/search-background.png',baseDir+'/accounts/search-background.png')
|
copyfile(baseDir+'/img/search-background.png',baseDir+'/accounts/search-background.png')
|
||||||
|
|
||||||
with open(baseDir+'/epicyon-follow.css', 'r') as cssFile:
|
cssFilename=baseDir+'/epicyon-follow.css'
|
||||||
|
if os.path.isfile(baseDir+'/follow.css'):
|
||||||
|
cssFilename=baseDir+'/follow.css'
|
||||||
|
with open(cssFilename, 'r') as cssFile:
|
||||||
profileStyle = cssFile.read()
|
profileStyle = cssFile.read()
|
||||||
emojiStr=htmlHeader(profileStyle)
|
emojiStr=htmlHeader(cssFilename,profileStyle)
|
||||||
emojiStr+='<div class="follow">'
|
emojiStr+='<div class="follow">'
|
||||||
emojiStr+=' <div class="followAvatar">'
|
emojiStr+=' <div class="followAvatar">'
|
||||||
emojiStr+=' <center>'
|
emojiStr+=' <center>'
|
||||||
|
@ -2390,9 +2456,12 @@ def htmlSearch(translate: {}, \
|
||||||
if not os.path.isfile(baseDir+'/accounts/search-background.png'):
|
if not os.path.isfile(baseDir+'/accounts/search-background.png'):
|
||||||
copyfile(baseDir+'/img/search-background.png',baseDir+'/accounts/search-background.png')
|
copyfile(baseDir+'/img/search-background.png',baseDir+'/accounts/search-background.png')
|
||||||
|
|
||||||
with open(baseDir+'/epicyon-follow.css', 'r') as cssFile:
|
cssFilename=baseDir+'/epicyon-follow.css'
|
||||||
|
if os.path.isfile(baseDir+'/follow.css'):
|
||||||
|
cssFilename=baseDir+'/follow.css'
|
||||||
|
with open(cssFilename, 'r') as cssFile:
|
||||||
profileStyle = cssFile.read()
|
profileStyle = cssFile.read()
|
||||||
followStr=htmlHeader(profileStyle)
|
followStr=htmlHeader(cssFilename,profileStyle)
|
||||||
followStr+='<div class="follow">'
|
followStr+='<div class="follow">'
|
||||||
followStr+=' <div class="followAvatar">'
|
followStr+=' <div class="followAvatar">'
|
||||||
followStr+=' <center>'
|
followStr+=' <center>'
|
||||||
|
@ -2452,7 +2521,10 @@ def htmlProfileAfterSearch(translate: {}, \
|
||||||
searchDomainFull=searchDomain+':'+str(searchPort)
|
searchDomainFull=searchDomain+':'+str(searchPort)
|
||||||
|
|
||||||
profileStr=''
|
profileStr=''
|
||||||
with open(baseDir+'/epicyon-profile.css', 'r') as cssFile:
|
cssFilename=baseDir+'/epicyon-profile.css'
|
||||||
|
if os.path.isfile(baseDir+'/epicyon.css'):
|
||||||
|
cssFilename=baseDir+'/epicyon.css'
|
||||||
|
with open(cssFilename, 'r') as cssFile:
|
||||||
wf = webfingerHandle(session,searchNickname+'@'+searchDomainFull,httpPrefix,wfRequest, \
|
wf = webfingerHandle(session,searchNickname+'@'+searchDomainFull,httpPrefix,wfRequest, \
|
||||||
domain,projectVersion)
|
domain,projectVersion)
|
||||||
if not wf:
|
if not wf:
|
||||||
|
@ -2543,4 +2615,4 @@ def htmlProfileAfterSearch(translate: {}, \
|
||||||
if i>=20:
|
if i>=20:
|
||||||
break
|
break
|
||||||
|
|
||||||
return htmlHeader(profileStyle)+profileStr+htmlFooter()
|
return htmlHeader(cssFilename,profileStyle)+profileStr+htmlFooter()
|
||||||
|
|
Loading…
Reference in New Issue