From 2eec26aeaa1b370e8fbfc86521965c9027e1ccde Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 28 Jul 2021 12:26:03 +0100 Subject: [PATCH] Right column on shares timeline --- shares.py | 3 +- webapp_timeline.py | 88 ++++++++++++++++++++++++++++++++-------------- 2 files changed, 63 insertions(+), 28 deletions(-) diff --git a/shares.py b/shares.py index f4abd6096..42d4b0306 100644 --- a/shares.py +++ b/shares.py @@ -706,12 +706,13 @@ def outboxShareUpload(baseDir: str, httpPrefix: str, if debug: print('DEBUG: duration missing from Offer') return + itemQty = float(messageJson['object']['itemQty']) addShare(baseDir, httpPrefix, nickname, domain, port, messageJson['object']['displayName'], messageJson['object']['summary'], messageJson['object']['imageFilename'], - float(messageJson['object']['itemQty']), + itemQty, messageJson['object']['itemType'], messageJson['object']['itemCategory'], messageJson['object']['location'], diff --git a/webapp_timeline.py b/webapp_timeline.py index e65cc9217..d576376a7 100644 --- a/webapp_timeline.py +++ b/webapp_timeline.py @@ -333,6 +333,46 @@ def _htmlTimelineKeyboard(moderator: bool, textModeBanner: str, usersPath: str, None, usersPath, translate, followApprovals) +def _htmlTimelineEnd(baseDir: str, nickname: str, domainFull: str, + httpPrefix: str, translate: {}, + moderator: bool, editor: bool, + newswire: {}, positiveVoting: bool, + showPublishAsIcon: bool, + rssIconAtTop: bool, publishButtonAtTop: bool, + authorized: bool, theme: str, + defaultTimeline: str, accessKeys: {}, + boxName: str, + enableTimingLog: bool, timelineStartTime) -> str: + """Ending of the timeline, containing the right column + """ + # end of timeline-posts + tlStr = ' \n' + + # end of column-center + tlStr += ' \n' + + # right column + rightColumnStr = getRightColumnContent(baseDir, nickname, domainFull, + httpPrefix, translate, + moderator, editor, + newswire, positiveVoting, + False, None, True, + showPublishAsIcon, + rssIconAtTop, publishButtonAtTop, + authorized, True, theme, + defaultTimeline, accessKeys) + tlStr += ' ' + \ + rightColumnStr + ' \n' + tlStr += ' \n' + + _logTimelineTiming(enableTimingLog, timelineStartTime, boxName, '9') + + tlStr += ' \n' + tlStr += '\n' + return tlStr + + def htmlTimeline(cssCache: {}, defaultTimeline: str, recentPostsCache: {}, maxRecentPosts: int, translate: {}, pageNumber: int, @@ -659,8 +699,16 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str, baseDir, actor, nickname, domain, port, maxSharesPerAccount, httpPrefix, sharedItemsFederatedDomains) + - ' \n' + ' \n' + - ' \n' + ' \n' + ' \n' + + _htmlTimelineEnd(baseDir, nickname, domainFull, + httpPrefix, translate, + moderator, editor, + newswire, positiveVoting, + showPublishAsIcon, + rssIconAtTop, publishButtonAtTop, + authorized, theme, + defaultTimeline, accessKeys, + boxName, + enableTimingLog, timelineStartTime) + htmlFooter()) _logTimelineTiming(enableTimingLog, timelineStartTime, boxName, '7') @@ -786,31 +834,17 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str, elif itemCtr == 0: tlStr += _getHelpForTimeline(baseDir, boxName) - # end of timeline-posts - tlStr += ' \n' - - # end of column-center - tlStr += ' \n' - - # right column - rightColumnStr = getRightColumnContent(baseDir, nickname, domainFull, - httpPrefix, translate, - moderator, editor, - newswire, positiveVoting, - False, None, True, - showPublishAsIcon, - rssIconAtTop, publishButtonAtTop, - authorized, True, theme, - defaultTimeline, accessKeys) - tlStr += ' ' + \ - rightColumnStr + ' \n' - tlStr += ' \n' - - _logTimelineTiming(enableTimingLog, timelineStartTime, boxName, '9') - - tlStr += ' \n' - tlStr += '\n' + tlStr += \ + _htmlTimelineEnd(baseDir, nickname, domainFull, + httpPrefix, translate, + moderator, editor, + newswire, positiveVoting, + showPublishAsIcon, + rssIconAtTop, publishButtonAtTop, + authorized, theme, + defaultTimeline, accessKeys, + boxName, + enableTimingLog, timelineStartTime) tlStr += htmlFooter() return tlStr