diff --git a/webinterface.py b/webinterface.py index d2d36467..cb7ecff6 100644 --- a/webinterface.py +++ b/webinterface.py @@ -183,7 +183,7 @@ def htmlSearchEmoji(translate: {},baseDir: str,searchStr: str) -> str: if not headingShown: emojiForm+='
'+translate['Copy the text then paste it into your post']+'
' headingShown=True - emojiForm+='

:'+emojiName+':

' + emojiForm+='

:'+emojiName+':

' emojiForm+='' emojiForm+=htmlFooter() @@ -266,7 +266,7 @@ def htmlSearchSharedItems(translate: {}, \ sharedItemsForm+='

'+sharedItem['displayName']+'

' if sharedItem.get('imageUrl'): sharedItemsForm+='' - sharedItemsForm+='Item image' + sharedItemsForm+='Item image' sharedItemsForm+='

'+sharedItem['summary']+'

' sharedItemsForm+='

'+translate['Type']+': '+sharedItem['itemType']+' ' sharedItemsForm+=''+translate['Category']+': '+sharedItem['category']+' ' @@ -283,7 +283,7 @@ def htmlSearchSharedItems(translate: {}, \ ' ' \ '
' \ '

' \ - ' '+translate['Page up']+'' \ + ' '+translate['Page up']+'' \ '
' \ '' resultsExist=True @@ -297,7 +297,7 @@ def htmlSearchSharedItems(translate: {}, \ ' ' \ '
' \ '
' \ - ' '+translate['Page down']+'' \ + ' '+translate['Page down']+'' \ '
' \ '' break @@ -380,7 +380,7 @@ def htmlHashtagSearch(translate: {}, \ hashtagSearchForm+='

#'+hashtag+'

' if startIndex!=len(lines)-1: # previous page link - hashtagSearchForm+='
'+translate['Page up']+'
' + hashtagSearchForm+='
'+translate['Page up']+'
' index=startIndex while index>=endIndex: postId=lines[index].strip('\n') @@ -423,7 +423,7 @@ def htmlHashtagSearch(translate: {}, \ if endIndex>0: # next page link - hashtagSearchForm+='
'+translate['Page down']+'
' + hashtagSearchForm+='
'+translate['Page down']+'
' hashtagSearchForm+=htmlFooter() return hashtagSearchForm @@ -543,7 +543,7 @@ def htmlSkillsSearch(translate: {},baseDir: str, \ actorName=skillMatchFields[2] avatarUrl=skillMatchFields[3] skillSearchForm+='
' - skillSearchForm+=''+actorName+'
' + skillSearchForm+=''+actorName+'' ctr+=1 if ctr>=postsPerPage: break @@ -775,7 +775,7 @@ def htmlLogin(translate: {},baseDir: str) -> str: loginForm+= \ '
' \ '
' \ - ' login image'+ \ + ' login image'+ \ loginText+TOSstr+ \ '
' \ '' \ @@ -788,7 +788,7 @@ def htmlLogin(translate: {},baseDir: str) -> str: registerButtonStr+loginButtonStr+ \ ' ' \ '
' - loginForm+='' + loginForm+='' loginForm+=htmlFooter() return loginForm @@ -972,7 +972,7 @@ def htmlNewPost(translate: {},baseDir: str, \ if endpoint!='newshare' and endpoint!='newreport': dateAndLocation= \ '
' \ - '

' \ + '

' \ '' \ '' \ '

' else: @@ -1046,12 +1046,12 @@ def htmlNewPost(translate: {},baseDir: str, \ ' ' \ '
' \ '
' \ - ' '+scopeDescription+''+ \ + ' '+scopeDescription+''+ \ dropDownContent+ \ '
' \ ' ' \ ' ' \ - ' '+translate['Search for emoji']+''+ \ + ' '+translate['Search for emoji']+''+ \ '
'+ \ replyStr+ \ ' ' \ @@ -1167,7 +1167,7 @@ def htmlProfileFollowing(translate: {},baseDir: str,httpPrefix: str, \ if authorized and pageNumber>1: # page up arrow profileStr+= \ - '
'+translate['Page up']+'
' + '
'+translate['Page up']+'
' for item in followingJson['orderedItems']: profileStr+= \ @@ -1180,7 +1180,7 @@ def htmlProfileFollowing(translate: {},baseDir: str,httpPrefix: str, \ if len(followingJson['orderedItems'])>=maxItemsPerPage: # page down arrow profileStr+= \ - '
'+translate['Page down']+'
' + '
'+translate['Page down']+'
' return profileStr def htmlProfileRoles(translate: {},nickname: str,domain: str,rolesJson: {}) -> str: @@ -1217,7 +1217,7 @@ def htmlProfileShares(translate: {},nickname: str,domain: str,sharesJson: {}) -> profileStr+='

'+item['displayName']+'

' if item.get('imageUrl'): profileStr+='' - profileStr+=''+translate['Item image']+'' + profileStr+=''+translate['Item image']+'' profileStr+='

'+item['summary']+'

' profileStr+='

'+translate['Type']+': '+item['itemType']+' ' profileStr+=''+translate['Category']+': '+item['category']+' ' @@ -1319,7 +1319,7 @@ def htmlProfile(translate: {},projectVersion: str, \ linkToTimelineStart+ \ '

' \ '
'+ \ - ' '+nickname+'@'+domainFull+'' \ + ' '+nickname+'@'+domainFull+'' \ '

'+displayName+'

' \ '

@'+nickname+'@'+domainFull+'

' \ '

'+profileDescription+'

'+ \ @@ -1347,7 +1347,7 @@ def htmlProfile(translate: {},projectVersion: str, \ with open(cssFilename, 'r') as cssFile: profileStyle = cssFile.read().replace('image.png',actor+'/image.png') - licenseStr='' + licenseStr='' if selected=='posts': profileStr+= \ @@ -1425,7 +1425,7 @@ def individualFollowAsHtml(translate: {}, \ return \ '
\n' \ '' \ - '

Avatar\n'+ \ + '

Avatar\n'+ \ titleStr+''+buttonsStr+'

' \ '
\n' @@ -1784,7 +1784,7 @@ def individualPostAsHtml(iconsDir: str,translate: {}, \ # Show a DM icon for DMs in the inbox timeline if showDMicon: - titleStr=titleStr+' ' + titleStr=titleStr+' ' messageIdStr='' if messageId: @@ -1795,7 +1795,7 @@ def individualPostAsHtml(iconsDir: str,translate: {}, \ if isAnnounced: if postJsonObject['object'].get('attributedTo'): if postJsonObject['object']['attributedTo'].startswith(postJsonObject['actor']): - titleStr+=' ' + titleStr+=' ' else: announceNickname=getNicknameFromActor(postJsonObject['object']['attributedTo']) if announceNickname: @@ -1808,7 +1808,7 @@ def individualPostAsHtml(iconsDir: str,translate: {}, \ addEmojiToDisplayName(baseDir,httpPrefix, \ nickname,domain, \ announceDisplayName,False) - titleStr+=' '+announceDisplayName+'' + titleStr+=' '+announceDisplayName+'' # show avatar of person replied to announceActor=postJsonObject['object']['attributedTo'] announceAvatarUrl=getPersonAvatarUrl(baseDir,announceActor,personCache) @@ -1816,22 +1816,22 @@ def individualPostAsHtml(iconsDir: str,translate: {}, \ replyAvatarImageInPost= \ '
' \ '' \ - 'Avatar
' 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' containerClass='container darker' #avatarPosition=' class="right"' if postJsonObject['object']['inReplyTo'].startswith(postJsonObject['actor']): - titleStr+=' ' + titleStr+=' ' else: if '/statuses/' in postJsonObject['object']['inReplyTo']: replyActor=postJsonObject['object']['inReplyTo'].split('/statuses/')[0] @@ -1847,7 +1847,7 @@ def individualPostAsHtml(iconsDir: str,translate: {}, \ addEmojiToDisplayName(baseDir,httpPrefix, \ nickname,domain, \ replyDisplayName,False) - titleStr+=' '+replyDisplayName+'' + titleStr+=' '+replyDisplayName+'' # show avatar of person replied to replyAvatarUrl=getPersonAvatarUrl(baseDir,replyActor,personCache) @@ -1855,19 +1855,19 @@ def individualPostAsHtml(iconsDir: str,translate: {}, \ replyAvatarImageInPost= \ '
' \ '' \ - 'Avatar
' 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): @@ -1892,11 +1892,11 @@ def individualPostAsHtml(iconsDir: str,translate: {}, \ galleryStr+= \ '\n' attachmentStr+= \ '' \ - ''+imageDescription+'\n' + ''+imageDescription+'\n' attachmentCtr+=1 elif mediaType=='video/mp4' or \ mediaType=='video/webm' or \ @@ -1963,14 +1963,14 @@ def individualPostAsHtml(iconsDir: str,translate: {}, \ avatarImageInPost= \ '
' \ ' ' \ - ' Avatar' \ + ' Avatar' \ '
' if showAvatarDropdown and fullDomain+'/users/'+nickname not in postJsonObject['actor']: avatarImageInPost= \ '
' \ ' ' \ - ' ' \ + ' ' \ '
' publishedStr=postJsonObject['object']['published'] @@ -2001,7 +2001,7 @@ def individualPostAsHtml(iconsDir: str,translate: {}, \ announceTitle=translate['Undo the repeat'] announceStr= \ '' \ - '' + '' likeStr='' if not isModerationPost: @@ -2015,7 +2015,7 @@ def individualPostAsHtml(iconsDir: str,translate: {}, \ likeTitle=translate['Undo the like'] likeStr= \ '' \ - '' + '' deleteStr='' if allowDeletion or \ @@ -2024,7 +2024,7 @@ def individualPostAsHtml(iconsDir: str,translate: {}, \ if '/users/'+nickname+'/' in postJsonObject['object']['id']: deleteStr= \ '' \ - '' + '' # change the background color for DMs in inbox timeline if showDMicon: @@ -2053,7 +2053,7 @@ def individualPostAsHtml(iconsDir: str,translate: {}, \ footerStr+='' else: footerStr+='' - footerStr+='' + footerStr+='' footerStr+=announceStr+likeStr+deleteStr footerStr+=''+publishedStr+'' footerStr+='
' @@ -2197,7 +2197,7 @@ def htmlTimeline(translate: {},pageNumber: int, \ for line in f: if len(line)>0: # show follow approvals icon - followApprovals=''+translate['Approve follow requests']+'' + followApprovals=''+translate['Approve follow requests']+'' break moderationButtonStr='' @@ -2211,11 +2211,11 @@ def htmlTimeline(translate: {},pageNumber: int, \ if boxName!='dm': if not manuallyApproveFollowers: - newPostButtonStr=''+translate['Create a new post']+'' + newPostButtonStr=''+translate['Create a new post']+'' else: - newPostButtonStr=''+translate['Create a new post']+'' + newPostButtonStr=''+translate['Create a new post']+'' else: - newPostButtonStr=''+translate['Create a new DM']+'' + newPostButtonStr=''+translate['Create a new DM']+'' # banner and row of buttons tlStr+= \ @@ -2229,9 +2229,9 @@ def htmlTimeline(translate: {},pageNumber: int, \ ' ' \ ' '+ \ moderationButtonStr+newPostButtonStr+ \ - ' '+translate['Search and follow']+''+ \ - ' '+translate['Calendar']+''+ \ - ' '+translate['Refresh']+''+ \ + ' '+translate['Search and follow']+''+ \ + ' '+translate['Calendar']+''+ \ + ' '+translate['Refresh']+''+ \ followApprovals+ \ '
' @@ -2254,7 +2254,7 @@ def htmlTimeline(translate: {},pageNumber: int, \ # page up arrow if pageNumber>1: - tlStr+='
'+translate['Page up']+'
' + tlStr+='
'+translate['Page up']+'
' # show the posts itemCtr=0 @@ -2284,7 +2284,7 @@ def htmlTimeline(translate: {},pageNumber: int, \ # page down arrow if itemCtr>=itemsPerPage: - tlStr+='
'+translate['Page down']+'
' + tlStr+='
'+translate['Page down']+'
' tlStr+=htmlFooter() return tlStr @@ -2498,7 +2498,7 @@ def htmlRemoveSharedItem(translate: {},baseDir: str,actor: str,shareName: str) - sharesStr+='
' sharesStr+='
' if sharedItemImageUrl: - sharesStr+=' ' + sharesStr+=' ' sharesStr+='

'+translate['Remove']+' '+sharedItemDisplayName+' ?

' sharesStr+= \ '
' \ @@ -2599,7 +2599,7 @@ def htmlFollowConfirm(translate: {},baseDir: str, \ followStr+='
' followStr+='
' followStr+=' ' - followStr+=' ' + followStr+=' ' followStr+='

'+translate['Follow']+' '+getNicknameFromActor(followActor)+'@'+followDomain+' ?

' followStr+= \ ' ' \ @@ -2635,7 +2635,7 @@ def htmlUnfollowConfirm(translate: {},baseDir: str, \ followStr+='
' followStr+='
' followStr+=' ' - followStr+=' ' + followStr+=' ' followStr+='

'+translate['Stop following']+' '+getNicknameFromActor(followActor)+'@'+followDomain+' ?

' followStr+= \ ' ' \ @@ -2696,7 +2696,7 @@ def htmlPersonOptions(translate: {},baseDir: str, \ optionsStr+='
' optionsStr+='
' optionsStr+=' ' - optionsStr+=' ' + optionsStr+=' ' optionsStr+='

'+translate['Options for']+' @'+getNicknameFromActor(optionsActor)+'@'+optionsDomain+'

' optionsStr+= \ ' ' \ @@ -2735,7 +2735,7 @@ def htmlPersonOptions(translate: {},baseDir: str, \ # blockStr+='
' # blockStr+='
' # blockStr+=' ' -# blockStr+=' ' +# blockStr+=' ' # blockStr+='

'+translate['Block']+' '+getNicknameFromActor(blockActor)+'@'+blockDomain+' ?

' # blockStr+= \ # ' ' \ @@ -2771,7 +2771,7 @@ def htmlUnblockConfirm(translate: {},baseDir: str, \ blockStr+='
' blockStr+='
' blockStr+=' ' - blockStr+=' ' + blockStr+=' ' blockStr+='

'+translate['Stop blocking']+' '+getNicknameFromActor(blockActor)+'@'+blockDomain+' ?

' blockStr+= \ ' ' \ @@ -3042,11 +3042,11 @@ def htmlCalendar(translate: {}, \ calendarStr+='
\n' calendarStr+='\n' calendarStr+='\n' calendarStr+='\n' @@ -3241,7 +3241,7 @@ def htmlProfileAfterSearch(translate: {}, \ profileStr= \ '
' \ '
' \ - ' '+searchNickname+'@'+searchDomainFull+'' \ + ' '+searchNickname+'@'+searchDomainFull+'' \ '

'+displayName+'

' \ '

@'+searchNickname+'@'+searchDomainFull+'

' \ '

'+profileDescription+'

'+ \
\n' calendarStr+=' ' - calendarStr+=' \n' + calendarStr+=' \n' calendarStr+=' ' calendarStr+='

'+monthName+'

\n' calendarStr+=' ' - calendarStr+=' \n' + calendarStr+=' \n' calendarStr+='