diff --git a/daemon.py b/daemon.py index f815b859b..18435d919 100644 --- a/daemon.py +++ b/daemon.py @@ -118,8 +118,8 @@ from webapp_utils import getBlogAddress from webapp_calendar import htmlCalendarDeleteConfirm from webapp_calendar import htmlCalendar from webapp_about import htmlAbout +from webapp_deleteconfirm import htmlDeletePost from webapp import htmlFollowingList -from webapp import htmlDeletePost from webapp import htmlRemoveSharedItem from webapp import htmlUnblockConfirm from webapp_person_options import htmlPersonOptions diff --git a/webapp.py b/webapp.py index 821816d49..a0e6cb12a 100644 --- a/webapp.py +++ b/webapp.py @@ -10,14 +10,11 @@ import os from shutil import copyfile from utils import getNicknameFromActor from utils import getDomainFromActor -from utils import locatePost from utils import loadJson from shares import getValidSharedItemID from webapp_utils import getAltPath -from webapp_utils import getIconsWebPath from webapp_utils import htmlHeaderWithExternalStyle from webapp_utils import htmlFooter -from webapp_post import individualPostAsHtml def htmlFollowingList(cssCache: {}, baseDir: str, @@ -133,83 +130,6 @@ def htmlRemoveSharedItem(cssCache: {}, translate: {}, baseDir: str, return sharesStr -def htmlDeletePost(cssCache: {}, - recentPostsCache: {}, maxRecentPosts: int, - translate, pageNumber: int, - session, baseDir: str, messageId: str, - httpPrefix: str, projectVersion: str, - wfRequest: {}, personCache: {}, - callingDomain: str, - YTReplacementDomain: str, - showPublishedDateOnly: bool) -> str: - """Shows a screen asking to confirm the deletion of a post - """ - if '/statuses/' not in messageId: - return None - iconsPath = getIconsWebPath(baseDir) - actor = messageId.split('/statuses/')[0] - nickname = getNicknameFromActor(actor) - domain, port = getDomainFromActor(actor) - domainFull = domain - if port: - if port != 80 and port != 443: - domainFull = domain + ':' + str(port) - - postFilename = locatePost(baseDir, nickname, domain, messageId) - if not postFilename: - return None - - postJsonObject = loadJson(postFilename) - if not postJsonObject: - return None - - if os.path.isfile(baseDir + '/img/delete-background.png'): - if not os.path.isfile(baseDir + '/accounts/delete-background.png'): - copyfile(baseDir + '/img/delete-background.png', - baseDir + '/accounts/delete-background.png') - - deletePostStr = None - cssFilename = baseDir + '/epicyon-profile.css' - if os.path.isfile(baseDir + '/epicyon.css'): - cssFilename = baseDir + '/epicyon.css' - - deletePostStr = htmlHeaderWithExternalStyle(cssFilename) - deletePostStr += \ - individualPostAsHtml(True, recentPostsCache, maxRecentPosts, - iconsPath, translate, pageNumber, - baseDir, session, wfRequest, personCache, - nickname, domain, port, postJsonObject, - None, True, False, - httpPrefix, projectVersion, 'outbox', - YTReplacementDomain, - showPublishedDateOnly, - False, False, False, False, False) - deletePostStr += '
' + \ - translate['Delete this post?'] + '
' - - postActor = getAltPath(actor, domainFull, callingDomain) - deletePostStr += \ - ' \n' - deletePostStr += '' + \ + translate['Delete this post?'] + '
' + + postActor = getAltPath(actor, domainFull, callingDomain) + deletePostStr += \ + ' \n' + deletePostStr += '