diff --git a/webinterface.py b/webinterface.py
index ca1789104..19a184c4a 100644
--- a/webinterface.py
+++ b/webinterface.py
@@ -98,6 +98,16 @@ def htmlSearchEmoji(translate: {},baseDir: str,searchStr: str) -> str:
emojiForm+=htmlFooter()
return emojiForm
+def getIconsDir(baseDir: str) -> str:
+ """Returns the directory where icons exist
+ """
+ iconsDir='icons'
+ theme=getConfigParam(baseDir,'theme')
+ if theme:
+ if os.path.isdir(baseDir+'img/icons/'+theme):
+ iconsDir='icons/'+theme
+ return iconsDir
+
def htmlSearchSharedItems(translate: {}, \
baseDir: str,searchStr: str, \
pageNumber: int, \
@@ -106,6 +116,7 @@ def htmlSearchSharedItems(translate: {}, \
domainFull: str,actor: str) -> str:
"""Search results for shared items
"""
+ iconsDir=getIconsDir(baseDir)
currPage=1
ctr=0
sharedItemsForm=''
@@ -168,7 +179,7 @@ def htmlSearchSharedItems(translate: {}, \
' ' \
' ' \
'
' \
'
' \
- '
'+scopeDescription+' '+ \
+ '
'+scopeDescription+' '+ \
dropDownContent+ \
'
' \
'
' \
@@ -932,6 +945,7 @@ def htmlProfilePosts(translate: {}, \
"""Shows posts on the profile screen
These should only be public posts
"""
+ iconsDir=getIconsDir(baseDir)
profileStr=''
maxItems=4
profileStr+=''
@@ -951,7 +965,7 @@ def htmlProfilePosts(translate: {}, \
break
for item in outboxFeed['orderedItems']:
if item['type']=='Create':
- postStr=individualPostAsHtml(translate,None, \
+ postStr=individualPostAsHtml(iconsDir,translate,None, \
baseDir,session,wfRequest,personCache, \
nickname,domain,port,item,None,True,False, \
httpPrefix,projectVersion, \
@@ -977,11 +991,12 @@ def htmlProfileFollowing(translate: {},baseDir: str,httpPrefix: str, \
"""
profileStr=''
+ iconsDir=getIconsDir(baseDir)
if authorized and pageNumber:
if authorized and pageNumber>1:
# page up arrow
profileStr+= \
- '
'
+ '
'
for item in followingJson['orderedItems']:
profileStr+= \
@@ -994,7 +1009,7 @@ def htmlProfileFollowing(translate: {},baseDir: str,httpPrefix: str, \
if len(followingJson['orderedItems'])>=maxItemsPerPage:
# page down arrow
profileStr+= \
- '
'
+ '
'
return profileStr
def htmlProfileRoles(translate: {},nickname: str,domain: str,rolesJson: {}) -> str:
@@ -1457,7 +1472,7 @@ def rejectAnnounce(announceFilename: str):
rejectAnnounceFile.write('\n')
rejectAnnounceFile.close()
-def individualPostAsHtml(translate: {}, \
+def individualPostAsHtml(iconsDir: str,translate: {}, \
pageNumber: int,baseDir: str, \
session,wfRequest: {},personCache: {}, \
nickname: str,domain: str,port: int, \
@@ -1594,7 +1609,7 @@ def individualPostAsHtml(translate: {}, \
# Show a DM icon for DMs in the inbox timeline
if showDMicon:
- titleStr=titleStr+'
'
+ titleStr=titleStr+'
'
if showRepeatIcon:
if isAnnounced:
@@ -1604,13 +1619,13 @@ def individualPostAsHtml(translate: {}, \
announceDomain,announcePort=getDomainFromActor(postJsonObject['object']['attributedTo'])
announceDisplayName=getDisplayName(postJsonObject['object']['attributedTo'],personCache)
if announceDisplayName:
- titleStr+='
'+announceDisplayName+' '
+ titleStr+='
'+announceDisplayName+' '
else:
- titleStr+='
@'+announceNickname+'@'+announceDomain+' '
+ titleStr+='
@'+announceNickname+'@'+announceDomain+' '
else:
- titleStr+='
@unattributed '
+ titleStr+='
@unattributed '
else:
- titleStr+='
@unattributed '
+ titleStr+='
@unattributed '
else:
if postJsonObject['object'].get('inReplyTo'):
containerClassIcons='containericons darker'
@@ -1623,17 +1638,17 @@ def individualPostAsHtml(translate: {}, \
if replyNickname and replyDomain:
replyDisplayName=getDisplayName(postJsonObject['object']['inReplyTo'],personCache)
if replyDisplayName:
- titleStr+='
'+replyDisplayName+' '
+ titleStr+='
'+replyDisplayName+' '
else:
- titleStr+='
@'+replyNickname+'@'+replyDomain+' '
+ titleStr+='
@'+replyNickname+'@'+replyDomain+' '
else:
- titleStr+='
@unknown '
+ titleStr+='
@unknown '
else:
postDomain=postJsonObject['object']['inReplyTo'].replace('https://','').replace('http://','').replace('dat://','')
if '/' in postDomain:
postDomain=postDomain.split('/',1)[0]
if postDomain:
- titleStr+='
'+postDomain+' '
+ titleStr+='
'+postDomain+' '
attachmentStr=''
if postJsonObject['object'].get('attachment'):
if isinstance(postJsonObject['object']['attachment'], list):
@@ -1756,7 +1771,7 @@ def individualPostAsHtml(translate: {}, \
announceTitle=translate['Undo the repeat']
announceStr= \
'
' \
- ' '
+ '
'
likeStr=''
if not isModerationPost:
@@ -1770,7 +1785,7 @@ def individualPostAsHtml(translate: {}, \
likeTitle=translate['Undo the like']
likeStr= \
'
' \
- ' '
+ '
'
deleteStr=''
if allowDeletion or \
@@ -1779,7 +1794,7 @@ def individualPostAsHtml(translate: {}, \
if '/users/'+nickname+'/' in postJsonObject['object']['id']:
deleteStr= \
'
' \
- ' '
+ '
'
# change the background color for DMs in inbox timeline
if showDMicon:
@@ -1808,7 +1823,7 @@ def individualPostAsHtml(translate: {}, \
footerStr+='
'
else:
footerStr+=' '
- footerStr+=' '
+ footerStr+='
'
footerStr+=announceStr+likeStr+deleteStr
footerStr+='
'+publishedStr+' '
footerStr+='
'
@@ -1866,6 +1881,7 @@ def htmlTimeline(translate: {},pageNumber: int, \
manuallyApproveFollowers: bool) -> str:
"""Show the timeline as html
"""
+ iconsDir=getIconsDir(baseDir)
cssFilename=baseDir+'/epicyon-profile.css'
if os.path.isfile(baseDir+'/epicyon.css'):
cssFilename=baseDir+'/epicyon.css'
@@ -1901,7 +1917,7 @@ def htmlTimeline(translate: {},pageNumber: int, \
for line in f:
if len(line)>0:
# show follow approvals icon
- followApprovals='