diff --git a/webapp_person_options.py b/webapp_person_options.py index 5f824b3bc..176d75bdc 100644 --- a/webapp_person_options.py +++ b/webapp_person_options.py @@ -227,90 +227,94 @@ def htmlPersonOptions(defaultTimeline: str, optionsStr += ' \n' if authorized: - if optionsNickname: - handle = optionsNickname + '@' + optionsDomainFull - petname = getPetName(baseDir, nickname, domain, handle) - optionsStr += \ - ' ' + translate['Petname'] + ': \n' + \ - ' \n' \ - '
\n' + if originPathStr == '/users/' + nickname: + if optionsNickname: + handle = optionsNickname + '@' + optionsDomainFull + petname = getPetName(baseDir, nickname, domain, handle) + optionsStr += \ + ' ' + translate['Petname'] + ': \n' + \ + ' \n' \ + '
\n' - # checkbox for receiving calendar events - if isFollowingActor(baseDir, nickname, domain, optionsActor): - checkboxStr = \ - ' ' + \ - translate['Receive calendar events from this account'] + \ - '\n
\n' - if not receivingCalendarEvents(baseDir, nickname, domain, - optionsNickname, - optionsDomainFull): - checkboxStr = checkboxStr.replace(' checked>', '>') - optionsStr += checkboxStr + # checkbox for receiving calendar events + if isFollowingActor(baseDir, nickname, domain, optionsActor): + checkboxStr = \ + ' ' + \ + translate['Receive calendar events from this account'] + \ + '\n
\n' + if not receivingCalendarEvents(baseDir, nickname, domain, + optionsNickname, + optionsDomainFull): + checkboxStr = checkboxStr.replace(' checked>', '>') + optionsStr += checkboxStr - # checkbox for permission to post to newswire - newswirePostsPermitted = False - if optionsDomainFull == domainFull: - adminNickname = getConfigParam(baseDir, 'admin') - if (nickname == adminNickname or - (isModerator(baseDir, nickname) and - not isModerator(baseDir, optionsNickname))): - newswireBlockedFilename = \ + # checkbox for permission to post to newswire + newswirePostsPermitted = False + if optionsDomainFull == domainFull: + adminNickname = getConfigParam(baseDir, 'admin') + if (nickname == adminNickname or + (isModerator(baseDir, nickname) and + not isModerator(baseDir, optionsNickname))): + newswireBlockedFilename = \ + baseDir + '/accounts/' + \ + optionsNickname + '@' + optionsDomain + '/.nonewswire' + checkboxStr = \ + ' ' + \ + translate['Allow news posts'] + \ + '\n
\n' + if os.path.isfile(newswireBlockedFilename): + checkboxStr = checkboxStr.replace(' checked>', '>') + else: + newswirePostsPermitted = True + optionsStr += checkboxStr + + # whether blogs created by this account are moderated on + # the newswire + if newswirePostsPermitted: + moderatedFilename = \ baseDir + '/accounts/' + \ - optionsNickname + '@' + optionsDomain + '/.nonewswire' + optionsNickname + '@' + \ + optionsDomain + '/.newswiremoderated' checkboxStr = \ ' ' + \ - translate['Allow news posts'] + \ + 'class="profilecheckbox" name="modNewsPosts" checked> ' + \ + translate['News posts are moderated'] + \ '\n
\n' - if os.path.isfile(newswireBlockedFilename): - checkboxStr = checkboxStr.replace(' checked>', '>') - else: - newswirePostsPermitted = True - optionsStr += checkboxStr - - # whether blogs created by this account are moderated on the newswire - if newswirePostsPermitted: - moderatedFilename = \ - baseDir + '/accounts/' + \ - optionsNickname + '@' + optionsDomain + '/.newswiremoderated' - checkboxStr = \ - ' ' + \ - translate['News posts are moderated'] + \ - '\n
\n' - if not os.path.isfile(moderatedFilename): - checkboxStr = checkboxStr.replace(' checked>', '>') - optionsStr += checkboxStr - - # checkbox for permission to post to featured articles - if newsInstance and optionsDomainFull == domainFull: - adminNickname = getConfigParam(baseDir, 'admin') - if (nickname == adminNickname or - (isModerator(baseDir, nickname) and - not isModerator(baseDir, optionsNickname))): - checkboxStr = \ - ' ' + \ - translate['Featured writer'] + \ - '\n
\n' - if not isFeaturedWriter(baseDir, optionsNickname, - optionsDomain): + if not os.path.isfile(moderatedFilename): checkboxStr = checkboxStr.replace(' checked>', '>') optionsStr += checkboxStr + # checkbox for permission to post to featured articles + if newsInstance and optionsDomainFull == domainFull: + adminNickname = getConfigParam(baseDir, 'admin') + if (nickname == adminNickname or + (isModerator(baseDir, nickname) and + not isModerator(baseDir, optionsNickname))): + checkboxStr = \ + ' ' + \ + translate['Featured writer'] + \ + '\n
\n' + if not isFeaturedWriter(baseDir, optionsNickname, + optionsDomain): + checkboxStr = checkboxStr.replace(' checked>', '>') + optionsStr += checkboxStr + optionsStr += optionsLinkStr backPath = '/' if nickname: