epicyon/webapp_timeline.py

1726 lines
75 KiB
Python
Raw Normal View History

2020-11-09 22:44:03 +00:00
__filename__ = "webapp_timeline.py"
__author__ = "Bob Mottram"
__license__ = "AGPL3+"
2021-01-26 10:07:42 +00:00
__version__ = "1.2.0"
2020-11-09 22:44:03 +00:00
__maintainer__ = "Bob Mottram"
2021-09-10 16:14:50 +00:00
__email__ = "bob@libreserver.org"
2020-11-09 22:44:03 +00:00
__status__ = "Production"
2021-06-15 15:08:12 +00:00
__module_group__ = "Timeline"
2020-11-09 22:44:03 +00:00
import os
import time
from shutil import copyfile
2021-12-26 14:17:13 +00:00
from utils import is_artist
from utils import dangerousMarkup
2021-12-26 14:08:58 +00:00
from utils import get_config_param
2021-12-26 12:45:03 +00:00
from utils import get_full_domain
2021-12-26 13:27:57 +00:00
from utils import is_editor
2021-12-27 11:20:57 +00:00
from utils import remove_id_ending
2021-12-26 12:02:29 +00:00
from utils import acct_dir
2021-12-26 18:03:39 +00:00
from utils import is_float
2021-12-26 10:19:59 +00:00
from utils import local_actor_url
2020-11-09 22:44:03 +00:00
from follow import followerApprovalActive
from person import isPersonSnoozed
from markdown import markdownToHtml
2021-02-05 17:05:53 +00:00
from webapp_utils import htmlKeyboardNavigation
2021-02-06 10:35:47 +00:00
from webapp_utils import htmlHideFromScreenReader
2020-11-09 22:44:03 +00:00
from webapp_utils import htmlPostSeparator
from webapp_utils import getBannerFile
2020-11-10 15:12:07 +00:00
from webapp_utils import htmlHeaderWithExternalStyle
2020-11-09 22:44:03 +00:00
from webapp_utils import htmlFooter
from webapp_utils import sharesTimelineJson
2020-11-17 20:40:36 +00:00
from webapp_utils import htmlHighlightLabel
2020-11-09 22:44:03 +00:00
from webapp_post import preparePostFromHtmlCache
from webapp_post import individualPostAsHtml
from webapp_column_left import getLeftColumnContent
from webapp_column_right import getRightColumnContent
2020-11-17 20:40:36 +00:00
from webapp_headerbuttons import headerButtonsTimeline
2020-11-09 22:44:03 +00:00
from posts import isModerator
from announce import isSelfAnnounce
2020-11-09 22:44:03 +00:00
def _logTimelineTiming(enableTimingLog: bool, timelineStartTime,
boxName: str, debugId: str) -> None:
2020-12-01 17:23:34 +00:00
"""Create a log of timings for performance tuning
"""
if not enableTimingLog:
return
timeDiff = int((time.time() - timelineStartTime) * 1000)
if timeDiff > 100:
print('TIMELINE TIMING ' +
boxName + ' ' + debugId + ' = ' + str(timeDiff))
2021-12-25 16:17:53 +00:00
def _getHelpForTimeline(base_dir: str, boxName: str) -> str:
"""Shows help text for the given timeline
"""
# get the filename for help for this timeline
2021-12-25 16:17:53 +00:00
helpFilename = base_dir + '/accounts/help_' + boxName + '.md'
if not os.path.isfile(helpFilename):
language = \
2021-12-26 14:08:58 +00:00
get_config_param(base_dir, 'language')
2021-02-26 12:24:55 +00:00
if not language:
language = 'en'
2021-12-25 23:35:50 +00:00
theme_name = \
2021-12-26 14:08:58 +00:00
get_config_param(base_dir, 'theme')
2021-02-27 10:10:05 +00:00
defaultFilename = None
2021-12-25 23:35:50 +00:00
if theme_name:
2021-02-27 10:10:05 +00:00
defaultFilename = \
2021-12-25 23:35:50 +00:00
base_dir + '/theme/' + theme_name + '/welcome/' + \
2021-02-27 10:10:05 +00:00
'help_' + boxName + '_' + language + '.md'
if not os.path.isfile(defaultFilename):
defaultFilename = None
if not defaultFilename:
defaultFilename = \
2021-12-25 16:17:53 +00:00
base_dir + '/defaultwelcome/' + \
2021-02-27 10:10:05 +00:00
'help_' + boxName + '_' + language + '.md'
if not os.path.isfile(defaultFilename):
defaultFilename = \
2021-12-25 16:17:53 +00:00
base_dir + '/defaultwelcome/help_' + boxName + '_en.md'
if os.path.isfile(defaultFilename):
copyfile(defaultFilename, helpFilename)
# show help text
if os.path.isfile(helpFilename):
instanceTitle = \
2021-12-26 14:08:58 +00:00
get_config_param(base_dir, 'instanceTitle')
if not instanceTitle:
instanceTitle = 'Epicyon'
with open(helpFilename, 'r') as helpFile:
helpText = helpFile.read()
if dangerousMarkup(helpText, False):
return ''
helpText = helpText.replace('INSTANCE', instanceTitle)
2021-02-26 12:29:42 +00:00
return '<div class="container">\n' + \
markdownToHtml(helpText) + '\n' + \
2021-02-26 12:42:29 +00:00
'</div>\n'
return ''
2021-06-27 21:40:12 +00:00
def _htmlTimelineNewPost(manuallyApproveFollowers: bool,
2021-12-25 19:19:14 +00:00
boxName: str, icons_as_buttons: bool,
2021-06-27 21:40:12 +00:00
usersPath: str, translate: {}) -> str:
"""Returns html for the new post button
"""
newPostButtonStr = ''
if boxName == 'dm':
2021-12-25 19:19:14 +00:00
if not icons_as_buttons:
2021-06-27 21:40:12 +00:00
newPostButtonStr += \
'<a class="imageAnchor" href="' + usersPath + \
'/newdm?nodropdown"><img loading="lazy" src="/' + \
'icons/newpost.png" title="' + \
translate['Create a new DM'] + \
'" alt="| ' + translate['Create a new DM'] + \
'" class="timelineicon"/></a>\n'
else:
newPostButtonStr += \
'<a href="' + usersPath + '/newdm?nodropdown">' + \
'<button class="button"><span>' + \
translate['Post'] + ' </span></button></a>'
elif (boxName == 'tlblogs' or
boxName == 'tlnews' or
boxName == 'tlfeatures'):
2021-12-25 19:19:14 +00:00
if not icons_as_buttons:
2021-06-27 21:40:12 +00:00
newPostButtonStr += \
'<a class="imageAnchor" href="' + usersPath + \
'/newblog"><img loading="lazy" src="/' + \
'icons/newpost.png" title="' + \
translate['Create a new post'] + '" alt="| ' + \
translate['Create a new post'] + \
'" class="timelineicon"/></a>\n'
else:
newPostButtonStr += \
'<a href="' + usersPath + '/newblog">' + \
'<button class="button"><span>' + \
translate['Post'] + '</span></button></a>'
elif boxName == 'tlshares':
2021-12-25 19:19:14 +00:00
if not icons_as_buttons:
2021-06-27 21:40:12 +00:00
newPostButtonStr += \
'<a class="imageAnchor" href="' + usersPath + \
'/newshare?nodropdown"><img loading="lazy" src="/' + \
'icons/newpost.png" title="' + \
translate['Create a new shared item'] + '" alt="| ' + \
translate['Create a new shared item'] + \
'" class="timelineicon"/></a>\n'
else:
newPostButtonStr += \
'<a href="' + usersPath + '/newshare?nodropdown">' + \
'<button class="button"><span>' + \
translate['Post'] + '</span></button></a>'
2021-08-09 18:41:05 +00:00
elif boxName == 'tlwanted':
2021-12-25 19:19:14 +00:00
if not icons_as_buttons:
2021-08-09 18:41:05 +00:00
newPostButtonStr += \
'<a class="imageAnchor" href="' + usersPath + \
'/newwanted?nodropdown"><img loading="lazy" src="/' + \
'icons/newpost.png" title="' + \
translate['Create a new wanted item'] + '" alt="| ' + \
translate['Create a new wanted item'] + \
'" class="timelineicon"/></a>\n'
else:
newPostButtonStr += \
'<a href="' + usersPath + '/newwanted?nodropdown">' + \
'<button class="button"><span>' + \
translate['Post'] + '</span></button></a>'
2021-06-27 21:40:12 +00:00
else:
if not manuallyApproveFollowers:
2021-12-25 19:19:14 +00:00
if not icons_as_buttons:
2021-06-27 21:40:12 +00:00
newPostButtonStr += \
'<a class="imageAnchor" href="' + usersPath + \
'/newpost"><img loading="lazy" src="/' + \
'icons/newpost.png" title="' + \
translate['Create a new post'] + '" alt="| ' + \
translate['Create a new post'] + \
'" class="timelineicon"/></a>\n'
else:
newPostButtonStr += \
'<a href="' + usersPath + '/newpost">' + \
'<button class="button"><span>' + \
translate['Post'] + '</span></button></a>'
else:
2021-12-25 19:19:14 +00:00
if not icons_as_buttons:
2021-06-27 21:40:12 +00:00
newPostButtonStr += \
'<a class="imageAnchor" href="' + usersPath + \
'/newfollowers"><img loading="lazy" src="/' + \
'icons/newpost.png" title="' + \
translate['Create a new post'] + \
'" alt="| ' + translate['Create a new post'] + \
'" class="timelineicon"/></a>\n'
else:
newPostButtonStr += \
'<a href="' + usersPath + '/newfollowers">' + \
'<button class="button"><span>' + \
translate['Post'] + '</span></button></a>'
return newPostButtonStr
2021-06-27 22:01:58 +00:00
def _htmlTimelineModerationButtons(moderator: bool, boxName: str,
nickname: str, moderationActionStr: str,
translate: {}) -> str:
"""Returns html for the moderation screen buttons
"""
tlStr = ''
if moderator and boxName == 'moderation':
tlStr += \
'<form id="modtimeline" method="POST" action="/users/' + \
nickname + '/moderationaction">'
tlStr += '<div class="container">\n'
idx = 'Nickname or URL. Block using *@domain or nickname@domain'
tlStr += \
' <b>' + translate[idx] + '</b><br>\n'
if moderationActionStr:
tlStr += ' <input type="text" ' + \
'name="moderationAction" value="' + \
moderationActionStr + '" autofocus><br>\n'
else:
tlStr += ' <input type="text" ' + \
'name="moderationAction" value="" autofocus><br>\n'
tlStr += \
' <input type="submit" title="' + \
translate['Information about current blocks/suspensions'] + \
'" alt="' + \
translate['Information about current blocks/suspensions'] + \
' | " ' + \
'name="submitInfo" value="' + translate['Info'] + '">\n'
tlStr += \
' <input type="submit" title="' + \
translate['Remove the above item'] + '" ' + \
'alt="' + translate['Remove the above item'] + ' | " ' + \
'name="submitRemove" value="' + \
translate['Remove'] + '">\n'
tlStr += \
' <input type="submit" title="' + \
translate['Suspend the above account nickname'] + '" ' + \
'alt="' + \
translate['Suspend the above account nickname'] + ' | " ' + \
'name="submitSuspend" value="' + translate['Suspend'] + '">\n'
tlStr += \
' <input type="submit" title="' + \
translate['Remove a suspension for an account nickname'] + '" ' + \
'alt="' + \
translate['Remove a suspension for an account nickname'] + \
' | " ' + \
'name="submitUnsuspend" value="' + \
translate['Unsuspend'] + '">\n'
tlStr += \
' <input type="submit" title="' + \
translate['Block an account on another instance'] + '" ' + \
'alt="' + \
translate['Block an account on another instance'] + ' | " ' + \
'name="submitBlock" value="' + translate['Block'] + '">\n'
tlStr += \
' <input type="submit" title="' + \
translate['Unblock an account on another instance'] + '" ' + \
'alt="' + \
translate['Unblock an account on another instance'] + ' | " ' + \
'name="submitUnblock" value="' + translate['Unblock'] + '">\n'
tlStr += \
' <input type="submit" title="' + \
translate['Filter out words'] + '" ' + \
'alt="' + \
translate['Filter out words'] + ' | " ' + \
'name="submitFilter" value="' + translate['Filter'] + '">\n'
tlStr += \
' <input type="submit" title="' + \
translate['Unfilter words'] + '" ' + \
'alt="' + \
translate['Unfilter words'] + ' | " ' + \
'name="submitUnfilter" value="' + translate['Unfilter'] + '">\n'
tlStr += '</div>\n</form>\n'
return tlStr
2021-12-25 23:09:49 +00:00
def _htmlTimelineKeyboard(moderator: bool, text_mode_banner: str,
usersPath: str,
2021-06-27 22:14:48 +00:00
nickname: str, newCalendarEvent: bool,
2021-08-09 18:41:05 +00:00
newDM: bool, newReply: bool,
newShare: bool, newWanted: bool,
2021-06-27 22:14:48 +00:00
followApprovals: bool,
accessKeys: {}, translate: {}) -> str:
"""Returns html for timeline keyboard navigation
"""
calendarStr = translate['Calendar']
if newCalendarEvent:
calendarStr = '<strong>' + calendarStr + '</strong>'
dmStr = translate['DM']
if newDM:
dmStr = '<strong>' + dmStr + '</strong>'
repliesStr = translate['Replies']
if newReply:
repliesStr = '<strong>' + repliesStr + '</strong>'
sharesStr = translate['Shares']
if newShare:
sharesStr = '<strong>' + sharesStr + '</strong>'
2021-08-09 18:41:05 +00:00
wantedStr = translate['Wanted']
if newWanted:
wantedStr = '<strong>' + wantedStr + '</strong>'
2021-06-27 22:14:48 +00:00
menuProfile = \
htmlHideFromScreenReader('👤') + ' ' + \
translate['Switch to profile view']
menuInbox = \
htmlHideFromScreenReader('📥') + ' ' + translate['Inbox']
menuOutbox = \
htmlHideFromScreenReader('📤') + ' ' + translate['Sent']
menuSearch = \
htmlHideFromScreenReader('🔍') + ' ' + \
translate['Search and follow']
menuCalendar = \
htmlHideFromScreenReader('📅') + ' ' + calendarStr
menuDM = \
htmlHideFromScreenReader('📩') + ' ' + dmStr
menuReplies = \
htmlHideFromScreenReader('📨') + ' ' + repliesStr
menuBookmarks = \
htmlHideFromScreenReader('🔖') + ' ' + translate['Bookmarks']
menuShares = \
htmlHideFromScreenReader('🤝') + ' ' + sharesStr
2021-08-09 18:41:05 +00:00
menuWanted = \
htmlHideFromScreenReader('') + ' ' + wantedStr
2021-06-27 22:14:48 +00:00
menuBlogs = \
htmlHideFromScreenReader('📝') + ' ' + translate['Blogs']
menuNewswire = \
htmlHideFromScreenReader('📰') + ' ' + translate['Newswire']
menuLinks = \
htmlHideFromScreenReader('🔗') + ' ' + translate['Links']
menuNewPost = \
htmlHideFromScreenReader('') + ' ' + translate['Create a new post']
menuModeration = \
htmlHideFromScreenReader('⚡️') + ' ' + translate['Mod']
navLinks = {
menuProfile: '/users/' + nickname,
menuInbox: usersPath + '/inbox#timelineposts',
menuSearch: usersPath + '/search',
menuNewPost: usersPath + '/newpost',
menuCalendar: usersPath + '/calendar',
menuDM: usersPath + '/dm#timelineposts',
menuReplies: usersPath + '/tlreplies#timelineposts',
menuOutbox: usersPath + '/outbox#timelineposts',
menuBookmarks: usersPath + '/tlbookmarks#timelineposts',
menuShares: usersPath + '/tlshares#timelineposts',
2021-08-09 18:41:05 +00:00
menuWanted: usersPath + '/tlwanted#timelineposts',
2021-06-27 22:14:48 +00:00
menuBlogs: usersPath + '/tlblogs#timelineposts',
menuNewswire: usersPath + '/newswiremobile',
menuLinks: usersPath + '/linksmobile'
}
navAccessKeys = {}
for variableName, key in accessKeys.items():
if not locals().get(variableName):
continue
navAccessKeys[locals()[variableName]] = key
if moderator:
navLinks[menuModeration] = usersPath + '/moderation#modtimeline'
2021-12-25 23:09:49 +00:00
return htmlKeyboardNavigation(text_mode_banner, navLinks, navAccessKeys,
2021-06-27 22:14:48 +00:00
None, usersPath, translate, followApprovals)
2021-12-26 10:00:46 +00:00
def _htmlTimelineEnd(base_dir: str, nickname: str, domain_full: str,
2021-12-25 17:09:22 +00:00
http_prefix: str, translate: {},
2021-07-28 11:26:03 +00:00
moderator: bool, editor: bool,
2021-12-25 20:14:45 +00:00
newswire: {}, positive_voting: bool,
2021-12-25 19:34:20 +00:00
show_publish_as_icon: bool,
2021-12-25 19:09:03 +00:00
rss_icon_at_top: bool, publish_button_at_top: bool,
2021-07-28 11:26:03 +00:00
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 = ' </div>\n'
# end of column-center
tlStr += ' </td>\n'
# right column
2021-12-26 10:00:46 +00:00
rightColumnStr = getRightColumnContent(base_dir, nickname, domain_full,
2021-12-25 17:09:22 +00:00
http_prefix, translate,
2021-07-28 11:26:03 +00:00
moderator, editor,
2021-12-25 20:14:45 +00:00
newswire, positive_voting,
2021-07-28 11:26:03 +00:00
False, None, True,
2021-12-25 19:34:20 +00:00
show_publish_as_icon,
2021-12-25 19:09:03 +00:00
rss_icon_at_top,
publish_button_at_top,
2021-07-28 11:26:03 +00:00
authorized, True, theme,
defaultTimeline, accessKeys)
tlStr += ' <td valign="top" class="col-right" ' + \
'id="newswire" tabindex="-1">' + \
rightColumnStr + ' </td>\n'
tlStr += ' </tr>\n'
_logTimelineTiming(enableTimingLog, timelineStartTime, boxName, '9')
tlStr += ' </tbody>\n'
tlStr += '</table>\n'
return tlStr
2021-09-24 17:26:21 +00:00
def _pageNumberButtons(usersPath: str, boxName: str, pageNumber: int) -> str:
"""Shows selactable page numbers at the bottom of the screen
"""
2021-09-24 17:37:46 +00:00
pagesWidth = 3
2021-09-24 17:26:21 +00:00
minPageNumber = pageNumber - pagesWidth
if minPageNumber < 1:
minPageNumber = 1
maxPageNumber = minPageNumber + 1 + (pagesWidth * 2)
numStr = ''
2021-09-24 17:42:14 +00:00
for page in range(minPageNumber, maxPageNumber):
2021-09-24 17:26:21 +00:00
if numStr:
2021-09-24 17:47:06 +00:00
numStr += ''
2021-09-24 17:26:21 +00:00
pageStr = str(page)
if page == pageNumber:
2021-09-24 21:41:27 +00:00
pageStr = '<mark>' + str(page) + '</mark>'
2021-09-24 17:26:21 +00:00
numStr += \
'<a href="' + usersPath + '/' + boxName + '?page=' + \
str(page) + '" class="pageslist">' + pageStr + '</a>'
2021-09-24 17:34:35 +00:00
return '<center>' + numStr + '</center>'
2021-09-24 17:26:21 +00:00
2020-11-10 15:12:07 +00:00
def htmlTimeline(cssCache: {}, defaultTimeline: str,
2021-12-26 20:01:37 +00:00
recent_posts_cache: {}, max_recent_posts: int,
2020-11-10 15:12:07 +00:00
translate: {}, pageNumber: int,
2021-12-25 16:17:53 +00:00
itemsPerPage: int, session, base_dir: str,
2021-12-25 22:28:18 +00:00
cached_webfingers: {}, person_cache: {},
2020-11-10 15:12:07 +00:00
nickname: str, domain: str, port: int, timelineJson: {},
2021-12-25 21:29:53 +00:00
boxName: str, allow_deletion: bool,
2021-12-25 20:34:38 +00:00
http_prefix: str, project_version: str,
2020-11-10 15:12:07 +00:00
manuallyApproveFollowers: bool,
minimal: bool,
2021-12-25 17:15:52 +00:00
yt_replace_domain: str,
2021-12-25 20:55:47 +00:00
twitter_replacement_domain: str,
2021-12-25 20:06:27 +00:00
show_published_date_only: bool,
2020-11-10 15:12:07 +00:00
newswire: {}, moderator: bool,
2021-12-04 16:59:50 +00:00
editor: bool, artist: bool,
2021-12-25 20:14:45 +00:00
positive_voting: bool,
2021-12-25 19:34:20 +00:00
show_publish_as_icon: bool,
2021-12-25 19:31:24 +00:00
full_width_tl_button_header: bool,
2021-12-25 19:19:14 +00:00
icons_as_buttons: bool,
2021-12-25 19:09:03 +00:00
rss_icon_at_top: bool,
2021-12-25 19:00:00 +00:00
publish_button_at_top: bool,
2020-12-09 23:30:15 +00:00
authorized: bool,
2020-12-20 17:26:38 +00:00
moderationActionStr: str,
2020-12-23 23:59:49 +00:00
theme: str,
2021-12-25 23:38:53 +00:00
peertube_instances: [],
2021-12-25 18:54:50 +00:00
allow_local_network_access: bool,
2021-12-25 23:09:49 +00:00
text_mode_banner: str,
2021-12-25 23:03:28 +00:00
accessKeys: {}, system_language: str,
2021-12-25 18:23:12 +00:00
max_like_count: int,
2021-12-25 18:05:01 +00:00
shared_items_federated_domains: [],
2021-12-25 23:03:28 +00:00
signing_priv_key_pem: str,
2021-12-25 23:26:38 +00:00
cw_lists: {}, lists_enabled: str) -> str:
2020-11-10 15:12:07 +00:00
"""Show the timeline as html
2020-11-09 22:44:03 +00:00
"""
2020-12-01 17:23:34 +00:00
enableTimingLog = False
2020-11-10 15:12:07 +00:00
timelineStartTime = time.time()
2020-11-09 22:44:03 +00:00
2021-12-26 12:02:29 +00:00
accountDir = acct_dir(base_dir, nickname, domain)
2020-11-09 22:44:03 +00:00
2020-11-10 15:12:07 +00:00
# should the calendar icon be highlighted?
newCalendarEvent = False
calendarImage = 'calendar.png'
calendarPath = '/calendar'
calendarFile = accountDir + '/.newCalendar'
if os.path.isfile(calendarFile):
newCalendarEvent = True
calendarImage = 'calendar_notify.png'
with open(calendarFile, 'r') as calfile:
calendarPath = calfile.read().replace('##sent##', '')
calendarPath = calendarPath.replace('\n', '').replace('\r', '')
2020-11-09 22:44:03 +00:00
2020-11-10 15:12:07 +00:00
# should the DM button be highlighted?
newDM = False
dmFile = accountDir + '/.newDM'
if os.path.isfile(dmFile):
newDM = True
if boxName == 'dm':
try:
os.remove(dmFile)
2021-11-25 18:42:38 +00:00
except OSError:
2021-10-29 18:48:15 +00:00
print('EX: htmlTimeline unable to delete ' + dmFile)
2020-11-09 22:44:03 +00:00
2020-11-10 15:12:07 +00:00
# should the Replies button be highlighted?
newReply = False
replyFile = accountDir + '/.newReply'
if os.path.isfile(replyFile):
newReply = True
if boxName == 'tlreplies':
try:
os.remove(replyFile)
2021-11-25 18:42:38 +00:00
except OSError:
2021-10-29 18:48:15 +00:00
print('EX: htmlTimeline unable to delete ' + replyFile)
2020-11-09 22:44:03 +00:00
2020-11-10 15:12:07 +00:00
# should the Shares button be highlighted?
newShare = False
newShareFile = accountDir + '/.newShare'
if os.path.isfile(newShareFile):
newShare = True
if boxName == 'tlshares':
try:
os.remove(newShareFile)
2021-11-25 18:42:38 +00:00
except OSError:
2021-10-29 18:48:15 +00:00
print('EX: htmlTimeline unable to delete ' + newShareFile)
2020-11-09 22:44:03 +00:00
2021-08-09 18:41:05 +00:00
# should the Wanted button be highlighted?
newWanted = False
newWantedFile = accountDir + '/.newWanted'
if os.path.isfile(newWantedFile):
newWanted = True
if boxName == 'tlwanted':
try:
os.remove(newWantedFile)
2021-11-25 18:42:38 +00:00
except OSError:
2021-10-29 18:48:15 +00:00
print('EX: htmlTimeline unable to delete ' + newWantedFile)
2021-08-09 18:41:05 +00:00
2020-11-10 15:12:07 +00:00
# should the Moderation/reports button be highlighted?
newReport = False
newReportFile = accountDir + '/.newReport'
if os.path.isfile(newReportFile):
newReport = True
if boxName == 'moderation':
try:
os.remove(newReportFile)
2021-11-25 18:42:38 +00:00
except OSError:
2021-10-29 18:48:15 +00:00
print('EX: htmlTimeline unable to delete ' + newReportFile)
2020-11-09 22:44:03 +00:00
2020-11-10 15:12:07 +00:00
separatorStr = ''
if boxName != 'tlmedia':
2021-12-25 16:17:53 +00:00
separatorStr = htmlPostSeparator(base_dir, None)
2020-11-09 22:44:03 +00:00
2020-11-10 15:12:07 +00:00
# the css filename
2021-12-25 16:17:53 +00:00
cssFilename = base_dir + '/epicyon-profile.css'
if os.path.isfile(base_dir + '/epicyon.css'):
cssFilename = base_dir + '/epicyon.css'
2020-11-09 22:44:03 +00:00
2020-11-10 15:12:07 +00:00
# filename of the banner shown at the top
2020-12-20 17:29:15 +00:00
bannerFile, bannerFilename = \
2021-12-25 16:17:53 +00:00
getBannerFile(base_dir, nickname, domain, theme)
2020-11-09 22:44:03 +00:00
_logTimelineTiming(enableTimingLog, timelineStartTime, boxName, '1')
2020-11-09 22:44:03 +00:00
2020-11-10 15:12:07 +00:00
# is the user a moderator?
if not moderator:
2021-12-25 16:17:53 +00:00
moderator = isModerator(base_dir, nickname)
2020-11-09 22:44:03 +00:00
2020-11-10 15:12:07 +00:00
# is the user a site editor?
if not editor:
2021-12-26 13:27:57 +00:00
editor = is_editor(base_dir, nickname)
2020-11-09 22:44:03 +00:00
_logTimelineTiming(enableTimingLog, timelineStartTime, boxName, '2')
2020-11-09 22:44:03 +00:00
2020-11-10 15:12:07 +00:00
# the appearance of buttons - highlighted or not
inboxButton = 'button'
blogsButton = 'button'
2020-11-27 12:42:51 +00:00
featuresButton = 'button'
2020-11-10 15:12:07 +00:00
newsButton = 'button'
dmButton = 'button'
if newDM:
dmButton = 'buttonhighlighted'
repliesButton = 'button'
if newReply:
repliesButton = 'buttonhighlighted'
mediaButton = 'button'
bookmarksButton = 'button'
# eventsButton = 'button'
2020-11-10 15:12:07 +00:00
sentButton = 'button'
sharesButton = 'button'
if newShare:
sharesButton = 'buttonhighlighted'
2021-08-09 18:41:05 +00:00
wantedButton = 'button'
if newWanted:
wantedButton = 'buttonhighlighted'
2020-11-10 15:12:07 +00:00
moderationButton = 'button'
if newReport:
moderationButton = 'buttonhighlighted'
if boxName == 'inbox':
inboxButton = 'buttonselected'
elif boxName == 'tlblogs':
blogsButton = 'buttonselected'
2020-11-27 12:42:51 +00:00
elif boxName == 'tlfeatures':
featuresButton = 'buttonselected'
2020-11-10 15:12:07 +00:00
elif boxName == 'tlnews':
newsButton = 'buttonselected'
elif boxName == 'dm':
dmButton = 'buttonselected'
if newDM:
dmButton = 'buttonselectedhighlighted'
elif boxName == 'tlreplies':
repliesButton = 'buttonselected'
if newReply:
repliesButton = 'buttonselectedhighlighted'
elif boxName == 'tlmedia':
mediaButton = 'buttonselected'
elif boxName == 'outbox':
sentButton = 'buttonselected'
elif boxName == 'moderation':
moderationButton = 'buttonselected'
if newReport:
moderationButton = 'buttonselectedhighlighted'
elif boxName == 'tlshares':
sharesButton = 'buttonselected'
if newShare:
sharesButton = 'buttonselectedhighlighted'
2021-08-09 18:41:05 +00:00
elif boxName == 'tlwanted':
wantedButton = 'buttonselected'
if newWanted:
wantedButton = 'buttonselectedhighlighted'
2020-11-10 15:12:07 +00:00
elif boxName == 'tlbookmarks' or boxName == 'bookmarks':
bookmarksButton = 'buttonselected'
2020-11-09 22:44:03 +00:00
2020-11-10 15:12:07 +00:00
# get the full domain, including any port number
2021-12-26 12:45:03 +00:00
fullDomain = get_full_domain(domain, port)
2020-11-09 22:44:03 +00:00
2020-11-10 15:12:07 +00:00
usersPath = '/users/' + nickname
2021-12-25 17:09:22 +00:00
actor = http_prefix + '://' + fullDomain + usersPath
2020-11-09 22:44:03 +00:00
2020-11-10 15:12:07 +00:00
showIndividualPostIcons = True
# show an icon for new follow approvals
followApprovals = ''
followRequestsFilename = \
2021-12-26 12:02:29 +00:00
acct_dir(base_dir, nickname, domain) + '/followrequests.txt'
2020-11-10 15:12:07 +00:00
if os.path.isfile(followRequestsFilename):
with open(followRequestsFilename, 'r') as f:
for line in f:
if len(line) > 0:
# show follow approvals icon
followApprovals = \
2020-11-09 22:44:03 +00:00
'<a href="' + usersPath + \
2021-04-23 12:24:34 +00:00
'/followers#buttonheader" ' + \
'accesskey="' + accessKeys['followButton'] + '">' + \
2020-11-10 15:12:07 +00:00
'<img loading="lazy" ' + \
'class="timelineicon" alt="' + \
translate['Approve follow requests'] + \
'" title="' + translate['Approve follow requests'] + \
2020-12-09 13:08:26 +00:00
'" src="/icons/person.png"/></a>\n'
2020-11-10 15:12:07 +00:00
break
2020-11-09 22:44:03 +00:00
_logTimelineTiming(enableTimingLog, timelineStartTime, boxName, '3')
2020-11-10 15:12:07 +00:00
# moderation / reports button
moderationButtonStr = ''
if moderator and not minimal:
moderationButtonStr = \
2020-11-09 22:44:03 +00:00
'<a href="' + usersPath + \
2020-11-10 15:12:07 +00:00
'/moderation"><button class="' + \
moderationButton + '"><span>' + \
htmlHighlightLabel(translate['Mod'], newReport) + \
' </span></button></a>'
# shares, bookmarks and events buttons
sharesButtonStr = ''
2021-08-09 18:53:27 +00:00
wantedButtonStr = ''
2020-11-10 15:12:07 +00:00
bookmarksButtonStr = ''
eventsButtonStr = ''
if not minimal:
sharesButtonStr = \
'<a href="' + usersPath + '/tlshares"><button class="' + \
sharesButton + '"><span>' + \
htmlHighlightLabel(translate['Shares'], newShare) + \
2020-11-09 22:44:03 +00:00
'</span></button></a>'
2021-08-09 18:41:05 +00:00
wantedButtonStr = \
'<a href="' + usersPath + '/tlwanted"><button class="' + \
wantedButton + '"><span>' + \
htmlHighlightLabel(translate['Wanted'], newWanted) + \
'</span></button></a>'
2020-11-10 15:12:07 +00:00
bookmarksButtonStr = \
'<a href="' + usersPath + '/tlbookmarks"><button class="' + \
bookmarksButton + '"><span>' + translate['Bookmarks'] + \
'</span></button></a>'
2020-11-09 22:44:03 +00:00
2021-01-11 19:46:21 +00:00
instanceTitle = \
2021-12-26 14:08:58 +00:00
get_config_param(base_dir, 'instanceTitle')
tlStr = htmlHeaderWithExternalStyle(cssFilename, instanceTitle, None)
2020-11-10 15:12:07 +00:00
_logTimelineTiming(enableTimingLog, timelineStartTime, boxName, '4')
2020-11-09 22:44:03 +00:00
2020-11-10 15:12:07 +00:00
# if this is a news instance and we are viewing the news timeline
newsHeader = False
2020-11-27 12:52:01 +00:00
if defaultTimeline == 'tlfeatures' and boxName == 'tlfeatures':
2020-11-10 15:12:07 +00:00
newsHeader = True
newPostButtonStr = ''
# start of headericons div
if not newsHeader:
2021-12-25 19:19:14 +00:00
if not icons_as_buttons:
2020-11-10 15:12:07 +00:00
newPostButtonStr += '<div class="headericons">'
# what screen to go to when a new post is created
2021-06-27 21:40:12 +00:00
newPostButtonStr += \
_htmlTimelineNewPost(manuallyApproveFollowers, boxName,
2021-12-25 19:19:14 +00:00
icons_as_buttons, usersPath, translate)
2020-11-09 22:44:03 +00:00
2021-02-05 15:30:51 +00:00
# keyboard navigation
2021-06-27 22:14:48 +00:00
tlStr += \
2021-12-25 23:09:49 +00:00
_htmlTimelineKeyboard(moderator, text_mode_banner, usersPath, nickname,
2021-08-09 18:41:05 +00:00
newCalendarEvent, newDM, newReply,
newShare, newWanted,
2021-06-27 22:14:48 +00:00
followApprovals, accessKeys, translate)
2020-11-09 22:44:03 +00:00
2020-11-10 15:12:07 +00:00
# banner and row of buttons
tlStr += \
2020-12-27 16:57:15 +00:00
'<header>\n' + \
2020-11-10 15:12:07 +00:00
'<a href="/users/' + nickname + '" title="' + \
translate['Switch to profile view'] + '" alt="' + \
translate['Switch to profile view'] + '">\n'
2021-02-01 18:38:08 +00:00
tlStr += '<img loading="lazy" class="timeline-banner" ' + \
2021-02-01 19:48:46 +00:00
'alt="" ' + \
2021-02-01 18:38:08 +00:00
'src="' + usersPath + '/' + bannerFile + '" /></a>\n' + \
2020-12-27 16:57:15 +00:00
'</header>\n'
2020-11-10 15:12:07 +00:00
2021-12-25 19:31:24 +00:00
if full_width_tl_button_header:
2020-11-09 22:44:03 +00:00
tlStr += \
2020-11-10 15:12:07 +00:00
headerButtonsTimeline(defaultTimeline, boxName, pageNumber,
translate, usersPath, mediaButton,
2020-11-27 12:42:51 +00:00
blogsButton, featuresButton,
newsButton, inboxButton,
2020-11-10 15:12:07 +00:00
dmButton, newDM, repliesButton,
newReply, minimal, sentButton,
2021-08-09 18:41:05 +00:00
sharesButtonStr, wantedButtonStr,
bookmarksButtonStr,
2020-11-10 15:12:07 +00:00
eventsButtonStr, moderationButtonStr,
2021-12-25 16:17:53 +00:00
newPostButtonStr, base_dir, nickname,
2020-12-09 13:31:54 +00:00
domain, timelineStartTime,
2020-11-10 15:12:07 +00:00
newCalendarEvent, calendarPath,
calendarImage, followApprovals,
2021-12-25 19:19:14 +00:00
icons_as_buttons, accessKeys)
2020-11-10 15:12:07 +00:00
# start the timeline
2021-07-06 12:50:38 +00:00
tlStr += \
'<table class="timeline">\n' + \
' <colgroup>\n' + \
' <col span="1" class="column-left">\n' + \
' <col span="1" class="column-center">\n' + \
' <col span="1" class="column-right">\n' + \
' </colgroup>\n' + \
' <tbody>\n' + \
' <tr>\n'
2020-11-10 15:12:07 +00:00
2021-12-26 12:45:03 +00:00
domain_full = get_full_domain(domain, port)
2020-11-10 15:12:07 +00:00
# left column
leftColumnStr = \
2021-12-26 10:00:46 +00:00
getLeftColumnContent(base_dir, nickname, domain_full,
2021-12-25 17:09:22 +00:00
http_prefix, translate,
2021-12-25 19:09:03 +00:00
editor, artist, False, None, rss_icon_at_top,
True, False, theme, accessKeys,
2021-12-25 18:05:01 +00:00
shared_items_federated_domains)
2021-02-01 13:31:49 +00:00
tlStr += ' <td valign="top" class="col-left" ' + \
'id="links" tabindex="-1">' + \
2020-11-10 15:12:07 +00:00
leftColumnStr + ' </td>\n'
# center column containing posts
2021-02-15 15:21:07 +00:00
tlStr += ' <td valign="top" class="col-center">\n'
2020-11-10 15:12:07 +00:00
2021-12-25 19:31:24 +00:00
if not full_width_tl_button_header:
2020-11-09 22:44:03 +00:00
tlStr += \
2020-11-10 15:12:07 +00:00
headerButtonsTimeline(defaultTimeline, boxName, pageNumber,
translate, usersPath, mediaButton,
2020-11-27 12:42:51 +00:00
blogsButton, featuresButton,
newsButton, inboxButton,
2020-11-10 15:12:07 +00:00
dmButton, newDM, repliesButton,
newReply, minimal, sentButton,
2021-08-09 18:41:05 +00:00
sharesButtonStr, wantedButtonStr,
bookmarksButtonStr,
2020-11-10 15:12:07 +00:00
eventsButtonStr, moderationButtonStr,
2021-12-25 16:17:53 +00:00
newPostButtonStr, base_dir, nickname,
2020-12-09 13:31:54 +00:00
domain, timelineStartTime,
2020-11-10 15:12:07 +00:00
newCalendarEvent, calendarPath,
calendarImage, followApprovals,
2021-12-25 19:19:14 +00:00
icons_as_buttons, accessKeys)
2020-11-09 22:44:03 +00:00
2021-02-15 15:21:07 +00:00
tlStr += ' <div id="timelineposts" class="timeline-posts">\n'
2020-11-18 18:22:05 +00:00
2020-11-10 15:12:07 +00:00
# second row of buttons for moderator actions
2021-06-27 22:01:58 +00:00
tlStr += \
_htmlTimelineModerationButtons(moderator, boxName, nickname,
moderationActionStr, translate)
2020-11-09 22:44:03 +00:00
_logTimelineTiming(enableTimingLog, timelineStartTime, boxName, '6')
2020-11-09 22:44:03 +00:00
2020-11-10 15:12:07 +00:00
if boxName == 'tlshares':
maxSharesPerAccount = itemsPerPage
return (tlStr +
_htmlSharesTimeline(translate, pageNumber, itemsPerPage,
2021-12-25 16:17:53 +00:00
base_dir, actor, nickname, domain, port,
2021-12-25 17:09:22 +00:00
maxSharesPerAccount, http_prefix,
2021-12-25 18:05:01 +00:00
shared_items_federated_domains, 'shares') +
2021-12-26 10:00:46 +00:00
_htmlTimelineEnd(base_dir, nickname, domain_full,
2021-12-25 17:09:22 +00:00
http_prefix, translate,
2021-07-28 11:26:03 +00:00
moderator, editor,
2021-12-25 20:14:45 +00:00
newswire, positive_voting,
2021-12-25 19:34:20 +00:00
show_publish_as_icon,
2021-12-25 19:09:03 +00:00
rss_icon_at_top, publish_button_at_top,
2021-07-28 11:26:03 +00:00
authorized, theme,
defaultTimeline, accessKeys,
boxName,
enableTimingLog, timelineStartTime) +
2020-11-10 15:12:07 +00:00
htmlFooter())
2021-08-09 18:41:05 +00:00
elif boxName == 'tlwanted':
maxSharesPerAccount = itemsPerPage
return (tlStr +
_htmlSharesTimeline(translate, pageNumber, itemsPerPage,
2021-12-25 16:17:53 +00:00
base_dir, actor, nickname, domain, port,
2021-12-25 17:09:22 +00:00
maxSharesPerAccount, http_prefix,
2021-12-25 18:05:01 +00:00
shared_items_federated_domains, 'wanted') +
2021-12-26 10:00:46 +00:00
_htmlTimelineEnd(base_dir, nickname, domain_full,
2021-12-25 17:09:22 +00:00
http_prefix, translate,
2021-08-09 18:41:05 +00:00
moderator, editor,
2021-12-25 20:14:45 +00:00
newswire, positive_voting,
2021-12-25 19:34:20 +00:00
show_publish_as_icon,
2021-12-25 19:09:03 +00:00
rss_icon_at_top, publish_button_at_top,
2021-08-09 18:41:05 +00:00
authorized, theme,
defaultTimeline, accessKeys,
boxName,
enableTimingLog, timelineStartTime) +
htmlFooter())
2020-11-09 22:44:03 +00:00
_logTimelineTiming(enableTimingLog, timelineStartTime, boxName, '7')
2020-11-09 22:44:03 +00:00
2021-02-07 21:45:31 +00:00
# separator between posts which only appears in shell browsers
# such as Lynx and is not read by screen readers
if boxName != 'tlmedia':
textModeSeparator = \
'<div class="transparent"><hr></div>'
2021-02-18 20:10:26 +00:00
else:
textModeSeparator = ''
2021-02-07 21:45:31 +00:00
2020-11-10 15:12:07 +00:00
# page up arrow
if pageNumber > 1:
2021-02-07 21:45:31 +00:00
tlStr += textModeSeparator
2021-09-24 17:49:35 +00:00
tlStr += '<br>' + _pageNumberButtons(usersPath, boxName, pageNumber)
2020-11-10 15:12:07 +00:00
tlStr += \
' <center>\n' + \
' <a href="' + usersPath + '/' + boxName + \
'?page=' + str(pageNumber - 1) + \
2021-04-23 13:20:28 +00:00
'" accesskey="' + accessKeys['Page up'] + '">' + \
'<img loading="lazy" class="pageicon" src="/' + \
2020-12-09 13:08:26 +00:00
'icons/pageup.png" title="' + \
2020-11-10 15:12:07 +00:00
translate['Page up'] + '" alt="' + \
translate['Page up'] + '"></a>\n' + \
' </center>\n'
2020-11-09 22:44:03 +00:00
2020-11-10 15:12:07 +00:00
# show the posts
itemCtr = 0
if timelineJson:
if 'orderedItems' not in timelineJson:
2021-08-01 19:43:20 +00:00
print('ERROR: no orderedItems in timeline for '
+ boxName + ' ' + str(timelineJson))
return ''
useCacheOnly = False
if boxName == 'inbox':
useCacheOnly = True
2020-11-10 15:12:07 +00:00
if timelineJson:
# if this is the media timeline then add an extra gallery container
if boxName == 'tlmedia':
if pageNumber > 1:
tlStr += '<br>'
tlStr += '<div class="galleryContainer">\n'
2020-11-09 22:44:03 +00:00
2020-11-10 15:12:07 +00:00
# show each post in the timeline
for item in timelineJson['orderedItems']:
if item['type'] == 'Create' or \
2021-03-05 15:45:03 +00:00
item['type'] == 'Announce':
2020-11-10 15:12:07 +00:00
# is the actor who sent this post snoozed?
2021-12-25 16:17:53 +00:00
if isPersonSnoozed(base_dir, nickname, domain, item['actor']):
2020-11-10 15:12:07 +00:00
continue
if isSelfAnnounce(item):
continue
2020-11-09 22:44:03 +00:00
2020-11-10 15:12:07 +00:00
# is the post in the memory cache of recent ones?
currTlStr = None
2021-12-26 20:01:37 +00:00
if boxName != 'tlmedia' and recent_posts_cache.get('html'):
2021-12-27 11:20:57 +00:00
post_id = remove_id_ending(item['id']).replace('/', '#')
2021-12-26 20:01:37 +00:00
if recent_posts_cache['html'].get(post_id):
currTlStr = recent_posts_cache['html'][post_id]
2021-09-28 09:26:19 +00:00
currTlStr = \
preparePostFromHtmlCache(nickname,
currTlStr,
boxName,
pageNumber)
_logTimelineTiming(enableTimingLog,
timelineStartTime,
boxName, '10')
2020-11-09 22:44:03 +00:00
2020-11-10 15:12:07 +00:00
if not currTlStr:
_logTimelineTiming(enableTimingLog,
timelineStartTime,
boxName, '11')
2020-11-09 22:44:03 +00:00
2020-11-10 15:12:07 +00:00
# read the post from disk
currTlStr = \
2021-12-25 23:03:28 +00:00
individualPostAsHtml(signing_priv_key_pem,
2021-12-26 20:01:37 +00:00
False, recent_posts_cache,
2021-12-25 20:28:06 +00:00
max_recent_posts,
2020-12-09 13:31:54 +00:00
translate, pageNumber,
2021-12-25 16:17:53 +00:00
base_dir, session,
2021-12-25 22:28:18 +00:00
cached_webfingers,
2021-12-25 22:17:49 +00:00
person_cache,
nickname, domain, port,
2020-11-10 15:12:07 +00:00
item, None, True,
2021-12-25 21:29:53 +00:00
allow_deletion,
2021-12-25 20:34:38 +00:00
http_prefix, project_version,
boxName,
2021-12-25 17:15:52 +00:00
yt_replace_domain,
2021-12-25 20:55:47 +00:00
twitter_replacement_domain,
2021-12-25 20:06:27 +00:00
show_published_date_only,
2021-12-25 23:38:53 +00:00
peertube_instances,
2021-12-25 18:54:50 +00:00
allow_local_network_access,
2021-12-25 23:03:28 +00:00
theme, system_language,
2021-12-25 18:23:12 +00:00
max_like_count,
2020-11-10 15:12:07 +00:00
boxName != 'dm',
showIndividualPostIcons,
manuallyApproveFollowers,
2021-10-21 13:08:21 +00:00
False, True, useCacheOnly,
2021-12-25 23:26:38 +00:00
cw_lists, lists_enabled)
_logTimelineTiming(enableTimingLog,
timelineStartTime, boxName, '12')
2020-11-09 22:44:03 +00:00
2020-11-10 15:12:07 +00:00
if currTlStr:
2021-09-06 09:00:10 +00:00
if currTlStr not in tlStr:
itemCtr += 1
tlStr += textModeSeparator + currTlStr
if separatorStr:
tlStr += separatorStr
2020-11-10 15:12:07 +00:00
if boxName == 'tlmedia':
tlStr += '</div>\n'
2020-11-09 22:44:03 +00:00
if itemCtr < 3:
print('Items added to html timeline ' + boxName + ': ' +
str(itemCtr) + ' ' + str(timelineJson['orderedItems']))
2020-11-10 15:12:07 +00:00
# page down arrow
2021-04-29 20:16:48 +00:00
if itemCtr > 0:
2021-02-07 21:41:57 +00:00
tlStr += textModeSeparator
2020-11-10 15:12:07 +00:00
tlStr += \
' <br>\n' + \
2020-11-10 15:12:07 +00:00
' <center>\n' + \
' <a href="' + usersPath + '/' + boxName + '?page=' + \
str(pageNumber + 1) + \
2021-04-23 13:20:28 +00:00
'" accesskey="' + accessKeys['Page down'] + '">' + \
'<img loading="lazy" class="pageicon" src="/' + \
2020-12-09 13:08:26 +00:00
'icons/pagedown.png" title="' + \
2020-11-10 15:12:07 +00:00
translate['Page down'] + '" alt="' + \
translate['Page down'] + '"></a>\n' + \
' </center>\n'
2021-09-24 17:26:21 +00:00
tlStr += _pageNumberButtons(usersPath, boxName, pageNumber)
2021-02-07 21:41:57 +00:00
tlStr += textModeSeparator
elif itemCtr == 0:
2021-12-25 16:17:53 +00:00
tlStr += _getHelpForTimeline(base_dir, boxName)
2020-11-18 18:22:05 +00:00
2021-07-28 11:26:03 +00:00
tlStr += \
2021-12-26 10:00:46 +00:00
_htmlTimelineEnd(base_dir, nickname, domain_full,
2021-12-25 17:09:22 +00:00
http_prefix, translate,
2021-07-28 11:26:03 +00:00
moderator, editor,
2021-12-25 20:14:45 +00:00
newswire, positive_voting,
2021-12-25 19:34:20 +00:00
show_publish_as_icon,
2021-12-25 19:09:03 +00:00
rss_icon_at_top, publish_button_at_top,
2021-07-28 11:26:03 +00:00
authorized, theme,
defaultTimeline, accessKeys,
boxName,
enableTimingLog, timelineStartTime)
2020-11-10 15:12:07 +00:00
tlStr += htmlFooter()
return tlStr
2020-11-09 22:44:03 +00:00
def htmlIndividualShare(domain: str, shareId: str,
2021-09-21 09:58:55 +00:00
actor: str, sharedItem: {}, translate: {},
2021-08-09 20:05:14 +00:00
showContact: bool, removeButton: bool,
sharesFileType: str) -> str:
2020-11-10 15:12:07 +00:00
"""Returns an individual shared item as html
"""
profileStr = '<div class="container">\n'
2021-09-21 09:58:55 +00:00
profileStr += \
'<p class="share-title">' + sharedItem['displayName'] + '</p>\n'
if sharedItem.get('imageUrl'):
profileStr += '<a href="' + sharedItem['imageUrl'] + '">\n'
2020-11-10 15:12:07 +00:00
profileStr += \
2021-09-21 09:58:55 +00:00
'<img loading="lazy" src="' + sharedItem['imageUrl'] + \
2020-11-10 15:12:07 +00:00
'" alt="' + translate['Item image'] + '">\n</a>\n'
2021-09-21 09:58:55 +00:00
profileStr += '<p>' + sharedItem['summary'] + '</p>\n<p>'
if sharedItem.get('itemQty'):
if sharedItem['itemQty'] > 1:
2021-07-27 20:31:14 +00:00
profileStr += \
'<b>' + translate['Quantity'] + ':</b> ' + \
2021-09-21 09:58:55 +00:00
str(sharedItem['itemQty']) + '<br>'
2021-07-24 11:30:46 +00:00
profileStr += \
2021-09-21 09:58:55 +00:00
'<b>' + translate['Type'] + ':</b> ' + sharedItem['itemType'] + '<br>'
2020-11-10 15:12:07 +00:00
profileStr += \
2021-09-21 09:58:55 +00:00
'<b>' + translate['Category'] + ':</b> ' + \
sharedItem['category'] + '<br>'
if sharedItem.get('location'):
2021-07-27 19:23:55 +00:00
profileStr += \
2021-07-27 20:29:29 +00:00
'<b>' + translate['Location'] + ':</b> ' + \
2021-09-21 09:58:55 +00:00
sharedItem['location'] + '<br>'
contactTitleStr = translate['Contact']
if sharedItem.get('itemPrice') and sharedItem.get('itemCurrency'):
2021-12-26 18:03:39 +00:00
if is_float(sharedItem['itemPrice']):
2021-09-21 09:58:55 +00:00
if float(sharedItem['itemPrice']) > 0:
2021-07-24 22:08:11 +00:00
profileStr += ' ' + \
'<b>' + translate['Price'] + ':</b> ' + \
2021-09-21 09:58:55 +00:00
sharedItem['itemPrice'] + ' ' + sharedItem['itemCurrency']
contactTitleStr = translate['Buy']
2021-07-24 22:08:11 +00:00
profileStr += '</p>\n'
2021-09-21 09:58:55 +00:00
sharedesc = sharedItem['displayName']
2021-09-19 16:20:12 +00:00
if '<' not in sharedesc and ';' not in sharedesc:
if showContact:
2021-09-21 09:58:55 +00:00
buttonStyleStr = 'button'
if sharedItem['category'] == 'accommodation':
contactTitleStr = translate['Request to stay']
buttonStyleStr = 'contactbutton'
contactActor = sharedItem['actor']
profileStr += \
'<p>' + \
'<a href="' + actor + \
'?replydm=sharedesc:' + sharedesc + \
2021-09-21 12:44:55 +00:00
'?mention=' + contactActor + '">' + \
2021-09-21 09:58:55 +00:00
'<button class="' + buttonStyleStr + '">' + \
contactTitleStr + '</button></a>\n'
profileStr += \
'<a href="' + contactActor + '"><button class="button">' + \
2021-09-19 16:20:12 +00:00
translate['Profile'] + '</button></a>\n'
if removeButton and domain in shareId:
2021-08-09 20:05:14 +00:00
if sharesFileType == 'shares':
profileStr += \
' <a href="' + actor + '?rmshare=' + shareId + \
'"><button class="button">' + \
translate['Remove'] + '</button></a>\n'
else:
profileStr += \
' <a href="' + actor + '?rmwanted=' + shareId + \
'"><button class="button">' + \
translate['Remove'] + '</button></a>\n'
2020-11-10 15:12:07 +00:00
profileStr += '</div>\n'
return profileStr
2020-11-09 22:44:03 +00:00
def _htmlSharesTimeline(translate: {}, pageNumber: int, itemsPerPage: int,
2021-12-25 16:17:53 +00:00
base_dir: str, actor: str,
nickname: str, domain: str, port: int,
2021-12-25 17:09:22 +00:00
maxSharesPerAccount: int, http_prefix: str,
2021-12-25 18:05:01 +00:00
shared_items_federated_domains: [],
sharesFileType: str) -> str:
2020-11-10 15:12:07 +00:00
"""Show shared items timeline as html
"""
sharesJson, lastPage = \
sharesTimelineJson(actor, pageNumber, itemsPerPage,
2021-12-25 16:17:53 +00:00
base_dir, domain, nickname, maxSharesPerAccount,
2021-12-25 18:05:01 +00:00
shared_items_federated_domains, sharesFileType)
2021-12-26 12:45:03 +00:00
domain_full = get_full_domain(domain, port)
2021-12-26 10:19:59 +00:00
actor = local_actor_url(http_prefix, nickname, domain_full)
2021-12-26 14:08:58 +00:00
adminNickname = get_config_param(base_dir, 'admin')
adminActor = ''
if adminNickname:
adminActor = \
2021-12-26 10:19:59 +00:00
local_actor_url(http_prefix, adminNickname, domain_full)
2020-11-10 15:12:07 +00:00
timelineStr = ''
2020-11-09 22:44:03 +00:00
2020-11-10 15:12:07 +00:00
if pageNumber > 1:
2021-09-24 17:49:35 +00:00
timelineStr += '<br>' + \
2021-09-24 17:32:23 +00:00
_pageNumberButtons(actor, 'tl' + sharesFileType, pageNumber)
2020-11-10 15:12:07 +00:00
timelineStr += \
' <center>\n' + \
' <a href="' + actor + '/tl' + sharesFileType + '?page=' + \
2020-11-10 15:12:07 +00:00
str(pageNumber - 1) + \
'"><img loading="lazy" class="pageicon" src="/' + \
2020-12-09 13:08:26 +00:00
'icons/pageup.png" title="' + translate['Page up'] + \
2020-11-10 15:12:07 +00:00
'" alt="' + translate['Page up'] + '"></a>\n' + \
' </center>\n'
2020-11-09 22:44:03 +00:00
2021-12-25 16:17:53 +00:00
separatorStr = htmlPostSeparator(base_dir, None)
2021-02-26 13:31:31 +00:00
ctr = 0
isAdminAccount = False
if adminActor and actor == adminActor:
isAdminAccount = True
isModeratorAccount = False
2021-12-25 16:17:53 +00:00
if isModerator(base_dir, nickname):
isModeratorAccount = True
2021-09-21 09:58:55 +00:00
for published, sharedItem in sharesJson.items():
2020-11-10 15:12:07 +00:00
showContactButton = False
2021-09-21 09:58:55 +00:00
if sharedItem['actor'] != actor:
2020-11-10 15:12:07 +00:00
showContactButton = True
showRemoveButton = False
2021-09-21 09:58:55 +00:00
if '___' + domain in sharedItem['shareId']:
if sharedItem['actor'] == actor or \
isAdminAccount or isModeratorAccount:
showRemoveButton = True
2020-11-18 19:28:33 +00:00
timelineStr += \
2021-09-21 09:58:55 +00:00
htmlIndividualShare(domain, sharedItem['shareId'],
actor, sharedItem, translate,
2021-08-09 20:05:14 +00:00
showContactButton, showRemoveButton,
sharesFileType)
2020-11-18 19:28:33 +00:00
timelineStr += separatorStr
2021-02-26 13:31:31 +00:00
ctr += 1
if ctr == 0:
2021-12-25 16:17:53 +00:00
timelineStr += _getHelpForTimeline(base_dir, 'tl' + sharesFileType)
2020-11-09 22:44:03 +00:00
2020-11-10 15:12:07 +00:00
if not lastPage:
timelineStr += \
' <center>\n' + \
' <a href="' + actor + '/tl' + sharesFileType + '?page=' + \
2020-11-10 15:12:07 +00:00
str(pageNumber + 1) + \
'"><img loading="lazy" class="pageicon" src="/' + \
2020-12-09 13:08:26 +00:00
'icons/pagedown.png" title="' + translate['Page down'] + \
2020-11-10 15:12:07 +00:00
'" alt="' + translate['Page down'] + '"></a>\n' + \
' </center>\n'
2021-09-24 17:32:23 +00:00
timelineStr += \
_pageNumberButtons(actor, 'tl' + sharesFileType, pageNumber)
2020-11-09 22:44:03 +00:00
2020-11-10 15:12:07 +00:00
return timelineStr
2020-11-09 22:44:03 +00:00
def htmlShares(cssCache: {}, defaultTimeline: str,
2021-12-26 20:01:37 +00:00
recent_posts_cache: {}, max_recent_posts: int,
2020-11-09 22:44:03 +00:00
translate: {}, pageNumber: int, itemsPerPage: int,
2021-12-25 16:17:53 +00:00
session, base_dir: str,
2021-12-25 22:28:18 +00:00
cached_webfingers: {}, person_cache: {},
2020-11-09 22:44:03 +00:00
nickname: str, domain: str, port: int,
2021-12-25 21:29:53 +00:00
allow_deletion: bool,
2021-12-25 20:34:38 +00:00
http_prefix: str, project_version: str,
2021-12-25 17:15:52 +00:00
yt_replace_domain: str,
2021-12-25 20:55:47 +00:00
twitter_replacement_domain: str,
2021-12-25 20:06:27 +00:00
show_published_date_only: bool,
2021-12-25 20:14:45 +00:00
newswire: {}, positive_voting: bool,
2021-12-25 19:34:20 +00:00
show_publish_as_icon: bool,
2021-12-25 19:31:24 +00:00
full_width_tl_button_header: bool,
2021-12-25 19:19:14 +00:00
icons_as_buttons: bool,
2021-12-25 19:09:03 +00:00
rss_icon_at_top: bool,
2021-12-25 19:00:00 +00:00
publish_button_at_top: bool,
2020-12-23 23:59:49 +00:00
authorized: bool, theme: str,
2021-12-25 23:38:53 +00:00
peertube_instances: [],
2021-12-25 18:54:50 +00:00
allow_local_network_access: bool,
2021-12-25 23:09:49 +00:00
text_mode_banner: str,
2021-12-25 23:03:28 +00:00
accessKeys: {}, system_language: str,
2021-12-25 18:23:12 +00:00
max_like_count: int,
2021-12-25 18:05:01 +00:00
shared_items_federated_domains: [],
2021-12-25 23:03:28 +00:00
signing_priv_key_pem: str,
2021-12-25 23:26:38 +00:00
cw_lists: {}, lists_enabled: str) -> str:
2020-11-09 22:44:03 +00:00
"""Show the shares timeline as html
"""
manuallyApproveFollowers = \
2021-12-25 16:17:53 +00:00
followerApprovalActive(base_dir, nickname, domain)
2021-12-26 14:17:13 +00:00
artist = is_artist(base_dir, nickname)
2020-11-09 22:44:03 +00:00
return htmlTimeline(cssCache, defaultTimeline,
2021-12-26 20:01:37 +00:00
recent_posts_cache, max_recent_posts,
2020-11-09 22:44:03 +00:00
translate, pageNumber,
2021-12-25 16:17:53 +00:00
itemsPerPage, session, base_dir,
2021-12-25 22:28:18 +00:00
cached_webfingers, person_cache,
2020-11-09 22:44:03 +00:00
nickname, domain, port, None,
2021-12-25 21:29:53 +00:00
'tlshares', allow_deletion,
2021-12-25 20:34:38 +00:00
http_prefix, project_version,
2021-12-25 19:31:24 +00:00
manuallyApproveFollowers,
2021-09-18 17:08:14 +00:00
False,
2021-12-25 17:15:52 +00:00
yt_replace_domain,
2021-12-25 20:55:47 +00:00
twitter_replacement_domain,
2021-12-25 20:06:27 +00:00
show_published_date_only,
2021-12-04 17:18:32 +00:00
newswire, False, False, artist,
2021-12-25 20:14:45 +00:00
positive_voting, show_publish_as_icon,
2021-12-25 19:31:24 +00:00
full_width_tl_button_header,
2021-12-25 19:19:14 +00:00
icons_as_buttons, rss_icon_at_top,
publish_button_at_top,
2021-12-25 23:38:53 +00:00
authorized, None, theme, peertube_instances,
2021-12-25 23:09:49 +00:00
allow_local_network_access, text_mode_banner,
2021-12-25 23:03:28 +00:00
accessKeys, system_language, max_like_count,
2021-12-25 19:31:24 +00:00
shared_items_federated_domains,
2021-12-25 23:03:28 +00:00
signing_priv_key_pem,
2021-12-25 23:26:38 +00:00
cw_lists, lists_enabled)
2021-08-09 18:41:05 +00:00
def htmlWanted(cssCache: {}, defaultTimeline: str,
2021-12-26 20:01:37 +00:00
recent_posts_cache: {}, max_recent_posts: int,
2021-08-09 18:41:05 +00:00
translate: {}, pageNumber: int, itemsPerPage: int,
2021-12-25 16:17:53 +00:00
session, base_dir: str,
2021-12-25 22:28:18 +00:00
cached_webfingers: {}, person_cache: {},
2021-08-09 18:41:05 +00:00
nickname: str, domain: str, port: int,
2021-12-25 21:29:53 +00:00
allow_deletion: bool,
2021-12-25 20:34:38 +00:00
http_prefix: str, project_version: str,
2021-12-25 17:15:52 +00:00
yt_replace_domain: str,
2021-12-25 20:55:47 +00:00
twitter_replacement_domain: str,
2021-12-25 20:06:27 +00:00
show_published_date_only: bool,
2021-12-25 20:14:45 +00:00
newswire: {}, positive_voting: bool,
2021-12-25 19:34:20 +00:00
show_publish_as_icon: bool,
2021-12-25 19:31:24 +00:00
full_width_tl_button_header: bool,
2021-12-25 19:19:14 +00:00
icons_as_buttons: bool,
2021-12-25 19:09:03 +00:00
rss_icon_at_top: bool,
2021-12-25 19:00:00 +00:00
publish_button_at_top: bool,
2021-08-09 18:41:05 +00:00
authorized: bool, theme: str,
2021-12-25 23:38:53 +00:00
peertube_instances: [],
2021-12-25 18:54:50 +00:00
allow_local_network_access: bool,
2021-12-25 23:09:49 +00:00
text_mode_banner: str,
2021-12-25 23:03:28 +00:00
accessKeys: {}, system_language: str,
2021-12-25 18:23:12 +00:00
max_like_count: int,
2021-12-25 18:05:01 +00:00
shared_items_federated_domains: [],
2021-12-25 23:03:28 +00:00
signing_priv_key_pem: str,
2021-12-25 23:26:38 +00:00
cw_lists: {}, lists_enabled: str) -> str:
2021-08-09 18:41:05 +00:00
"""Show the wanted timeline as html
"""
manuallyApproveFollowers = \
2021-12-25 16:17:53 +00:00
followerApprovalActive(base_dir, nickname, domain)
2021-12-26 14:17:13 +00:00
artist = is_artist(base_dir, nickname)
2021-08-09 18:41:05 +00:00
return htmlTimeline(cssCache, defaultTimeline,
2021-12-26 20:01:37 +00:00
recent_posts_cache, max_recent_posts,
2021-08-09 18:41:05 +00:00
translate, pageNumber,
2021-12-25 16:17:53 +00:00
itemsPerPage, session, base_dir,
2021-12-25 22:28:18 +00:00
cached_webfingers, person_cache,
2021-08-09 18:41:05 +00:00
nickname, domain, port, None,
2021-12-25 21:29:53 +00:00
'tlwanted', allow_deletion,
2021-12-25 20:34:38 +00:00
http_prefix, project_version,
2021-12-25 19:31:24 +00:00
manuallyApproveFollowers,
2021-09-18 17:08:14 +00:00
False,
2021-12-25 17:15:52 +00:00
yt_replace_domain,
2021-12-25 20:55:47 +00:00
twitter_replacement_domain,
2021-12-25 20:06:27 +00:00
show_published_date_only,
2021-12-04 17:18:32 +00:00
newswire, False, False, artist,
2021-12-25 20:14:45 +00:00
positive_voting, show_publish_as_icon,
2021-12-25 19:31:24 +00:00
full_width_tl_button_header,
2021-12-25 19:19:14 +00:00
icons_as_buttons, rss_icon_at_top,
publish_button_at_top,
2021-12-25 23:38:53 +00:00
authorized, None, theme, peertube_instances,
2021-12-25 23:09:49 +00:00
allow_local_network_access, text_mode_banner,
2021-12-25 23:03:28 +00:00
accessKeys, system_language, max_like_count,
2021-12-25 19:31:24 +00:00
shared_items_federated_domains,
2021-12-25 23:03:28 +00:00
signing_priv_key_pem,
2021-12-25 23:26:38 +00:00
cw_lists, lists_enabled)
2020-11-09 22:44:03 +00:00
def htmlInbox(cssCache: {}, defaultTimeline: str,
2021-12-26 20:01:37 +00:00
recent_posts_cache: {}, max_recent_posts: int,
2020-11-09 22:44:03 +00:00
translate: {}, pageNumber: int, itemsPerPage: int,
2021-12-25 16:17:53 +00:00
session, base_dir: str,
2021-12-25 22:28:18 +00:00
cached_webfingers: {}, person_cache: {},
2020-11-09 22:44:03 +00:00
nickname: str, domain: str, port: int, inboxJson: {},
2021-12-25 21:29:53 +00:00
allow_deletion: bool,
2021-12-25 20:34:38 +00:00
http_prefix: str, project_version: str,
2021-09-18 17:08:14 +00:00
minimal: bool,
2021-12-25 17:15:52 +00:00
yt_replace_domain: str,
2021-12-25 20:55:47 +00:00
twitter_replacement_domain: str,
2021-12-25 20:06:27 +00:00
show_published_date_only: bool,
2021-12-25 20:14:45 +00:00
newswire: {}, positive_voting: bool,
2021-12-25 19:34:20 +00:00
show_publish_as_icon: bool,
2021-12-25 19:31:24 +00:00
full_width_tl_button_header: bool,
2021-12-25 19:19:14 +00:00
icons_as_buttons: bool,
2021-12-25 19:09:03 +00:00
rss_icon_at_top: bool,
2021-12-25 19:00:00 +00:00
publish_button_at_top: bool,
2020-12-23 23:59:49 +00:00
authorized: bool, theme: str,
2021-12-25 23:38:53 +00:00
peertube_instances: [],
2021-12-25 18:54:50 +00:00
allow_local_network_access: bool,
2021-12-25 23:09:49 +00:00
text_mode_banner: str,
2021-12-25 23:03:28 +00:00
accessKeys: {}, system_language: str,
2021-12-25 18:23:12 +00:00
max_like_count: int,
2021-12-25 18:05:01 +00:00
shared_items_federated_domains: [],
2021-12-25 23:03:28 +00:00
signing_priv_key_pem: str,
2021-12-25 23:26:38 +00:00
cw_lists: {}, lists_enabled: str) -> str:
2020-11-09 22:44:03 +00:00
"""Show the inbox as html
"""
manuallyApproveFollowers = \
2021-12-25 16:17:53 +00:00
followerApprovalActive(base_dir, nickname, domain)
2021-12-26 14:17:13 +00:00
artist = is_artist(base_dir, nickname)
2020-11-09 22:44:03 +00:00
return htmlTimeline(cssCache, defaultTimeline,
2021-12-26 20:01:37 +00:00
recent_posts_cache, max_recent_posts,
2020-11-09 22:44:03 +00:00
translate, pageNumber,
2021-12-25 16:17:53 +00:00
itemsPerPage, session, base_dir,
2021-12-25 22:28:18 +00:00
cached_webfingers, person_cache,
2020-11-09 22:44:03 +00:00
nickname, domain, port, inboxJson,
2021-12-25 21:29:53 +00:00
'inbox', allow_deletion,
2021-12-25 20:34:38 +00:00
http_prefix, project_version,
2021-12-25 19:31:24 +00:00
manuallyApproveFollowers,
2021-09-18 17:08:14 +00:00
minimal,
2021-12-25 17:15:52 +00:00
yt_replace_domain,
2021-12-25 20:55:47 +00:00
twitter_replacement_domain,
2021-12-25 20:06:27 +00:00
show_published_date_only,
2021-12-04 17:18:32 +00:00
newswire, False, False, artist,
2021-12-25 20:14:45 +00:00
positive_voting, show_publish_as_icon,
2021-12-25 19:31:24 +00:00
full_width_tl_button_header,
2021-12-25 19:19:14 +00:00
icons_as_buttons, rss_icon_at_top,
publish_button_at_top,
2021-12-25 23:38:53 +00:00
authorized, None, theme, peertube_instances,
2021-12-25 23:09:49 +00:00
allow_local_network_access, text_mode_banner,
2021-12-25 23:03:28 +00:00
accessKeys, system_language, max_like_count,
2021-12-25 19:31:24 +00:00
shared_items_federated_domains,
2021-12-25 23:03:28 +00:00
signing_priv_key_pem,
2021-12-25 23:26:38 +00:00
cw_lists, lists_enabled)
2020-11-09 22:44:03 +00:00
def htmlBookmarks(cssCache: {}, defaultTimeline: str,
2021-12-26 20:01:37 +00:00
recent_posts_cache: {}, max_recent_posts: int,
2020-11-09 22:44:03 +00:00
translate: {}, pageNumber: int, itemsPerPage: int,
2021-12-25 16:17:53 +00:00
session, base_dir: str,
2021-12-25 22:28:18 +00:00
cached_webfingers: {}, person_cache: {},
2020-11-09 22:44:03 +00:00
nickname: str, domain: str, port: int, bookmarksJson: {},
2021-12-25 21:29:53 +00:00
allow_deletion: bool,
2021-12-25 20:34:38 +00:00
http_prefix: str, project_version: str,
2021-09-18 17:08:14 +00:00
minimal: bool,
2021-12-25 17:15:52 +00:00
yt_replace_domain: str,
2021-12-25 20:55:47 +00:00
twitter_replacement_domain: str,
2021-12-25 20:06:27 +00:00
show_published_date_only: bool,
2021-12-25 20:14:45 +00:00
newswire: {}, positive_voting: bool,
2021-12-25 19:34:20 +00:00
show_publish_as_icon: bool,
2021-12-25 19:31:24 +00:00
full_width_tl_button_header: bool,
2021-12-25 19:19:14 +00:00
icons_as_buttons: bool,
2021-12-25 19:09:03 +00:00
rss_icon_at_top: bool,
2021-12-25 19:00:00 +00:00
publish_button_at_top: bool,
2020-12-23 23:59:49 +00:00
authorized: bool, theme: str,
2021-12-25 23:38:53 +00:00
peertube_instances: [],
2021-12-25 18:54:50 +00:00
allow_local_network_access: bool,
2021-12-25 23:09:49 +00:00
text_mode_banner: str,
2021-12-25 23:03:28 +00:00
accessKeys: {}, system_language: str,
2021-12-25 18:23:12 +00:00
max_like_count: int,
2021-12-25 18:05:01 +00:00
shared_items_federated_domains: [],
2021-12-25 23:03:28 +00:00
signing_priv_key_pem: str,
2021-12-25 23:26:38 +00:00
cw_lists: {}, lists_enabled: str) -> str:
2020-11-09 22:44:03 +00:00
"""Show the bookmarks as html
"""
manuallyApproveFollowers = \
2021-12-25 16:17:53 +00:00
followerApprovalActive(base_dir, nickname, domain)
2021-12-26 14:17:13 +00:00
artist = is_artist(base_dir, nickname)
2020-11-09 22:44:03 +00:00
return htmlTimeline(cssCache, defaultTimeline,
2021-12-26 20:01:37 +00:00
recent_posts_cache, max_recent_posts,
2020-11-09 22:44:03 +00:00
translate, pageNumber,
2021-12-25 16:17:53 +00:00
itemsPerPage, session, base_dir,
2021-12-25 22:28:18 +00:00
cached_webfingers, person_cache,
2020-11-09 22:44:03 +00:00
nickname, domain, port, bookmarksJson,
2021-12-25 21:29:53 +00:00
'tlbookmarks', allow_deletion,
2021-12-25 20:34:38 +00:00
http_prefix, project_version,
2021-12-25 19:31:24 +00:00
manuallyApproveFollowers,
2021-09-18 17:08:14 +00:00
minimal,
2021-12-25 17:15:52 +00:00
yt_replace_domain,
2021-12-25 20:55:47 +00:00
twitter_replacement_domain,
2021-12-25 20:06:27 +00:00
show_published_date_only,
2021-12-04 17:18:32 +00:00
newswire, False, False, artist,
2021-12-25 20:14:45 +00:00
positive_voting, show_publish_as_icon,
2021-12-25 19:31:24 +00:00
full_width_tl_button_header,
2021-12-25 19:19:14 +00:00
icons_as_buttons, rss_icon_at_top,
publish_button_at_top,
2021-12-25 23:38:53 +00:00
authorized, None, theme, peertube_instances,
2021-12-25 23:09:49 +00:00
allow_local_network_access, text_mode_banner,
2021-12-25 23:03:28 +00:00
accessKeys, system_language, max_like_count,
shared_items_federated_domains, signing_priv_key_pem,
2021-12-25 23:26:38 +00:00
cw_lists, lists_enabled)
2020-11-09 22:44:03 +00:00
def htmlInboxDMs(cssCache: {}, defaultTimeline: str,
2021-12-26 20:01:37 +00:00
recent_posts_cache: {}, max_recent_posts: int,
2020-11-09 22:44:03 +00:00
translate: {}, pageNumber: int, itemsPerPage: int,
2021-12-25 16:17:53 +00:00
session, base_dir: str,
2021-12-25 22:28:18 +00:00
cached_webfingers: {}, person_cache: {},
2020-11-09 22:44:03 +00:00
nickname: str, domain: str, port: int, inboxJson: {},
2021-12-25 21:29:53 +00:00
allow_deletion: bool,
2021-12-25 20:34:38 +00:00
http_prefix: str, project_version: str,
2021-09-18 17:08:14 +00:00
minimal: bool,
2021-12-25 17:15:52 +00:00
yt_replace_domain: str,
2021-12-25 20:55:47 +00:00
twitter_replacement_domain: str,
2021-12-25 20:06:27 +00:00
show_published_date_only: bool,
2021-12-25 20:14:45 +00:00
newswire: {}, positive_voting: bool,
2021-12-25 19:34:20 +00:00
show_publish_as_icon: bool,
2021-12-25 19:31:24 +00:00
full_width_tl_button_header: bool,
2021-12-25 19:19:14 +00:00
icons_as_buttons: bool,
2021-12-25 19:09:03 +00:00
rss_icon_at_top: bool,
2021-12-25 19:00:00 +00:00
publish_button_at_top: bool,
2020-12-23 23:59:49 +00:00
authorized: bool, theme: str,
2021-12-25 23:38:53 +00:00
peertube_instances: [],
2021-12-25 18:54:50 +00:00
allow_local_network_access: bool,
2021-12-25 23:09:49 +00:00
text_mode_banner: str,
2021-12-25 23:03:28 +00:00
accessKeys: {}, system_language: str,
2021-12-25 18:23:12 +00:00
max_like_count: int,
2021-12-25 18:05:01 +00:00
shared_items_federated_domains: [],
2021-12-25 23:03:28 +00:00
signing_priv_key_pem: str,
2021-12-25 23:26:38 +00:00
cw_lists: {}, lists_enabled: str) -> str:
2020-11-09 22:44:03 +00:00
"""Show the DM timeline as html
"""
2021-12-26 14:17:13 +00:00
artist = is_artist(base_dir, nickname)
2020-11-09 22:44:03 +00:00
return htmlTimeline(cssCache, defaultTimeline,
2021-12-26 20:01:37 +00:00
recent_posts_cache, max_recent_posts,
2020-11-09 22:44:03 +00:00
translate, pageNumber,
2021-12-25 16:17:53 +00:00
itemsPerPage, session, base_dir,
2021-12-25 22:28:18 +00:00
cached_webfingers, person_cache,
2021-12-25 21:29:53 +00:00
nickname, domain, port, inboxJson,
'dm', allow_deletion,
2021-12-25 20:34:38 +00:00
http_prefix, project_version, False, minimal,
2021-12-25 17:15:52 +00:00
yt_replace_domain,
2021-12-25 20:55:47 +00:00
twitter_replacement_domain,
2021-12-25 20:06:27 +00:00
show_published_date_only,
2021-12-25 20:14:45 +00:00
newswire, False, False, artist, positive_voting,
2021-12-25 19:34:20 +00:00
show_publish_as_icon,
2021-12-25 19:31:24 +00:00
full_width_tl_button_header,
2021-12-25 19:19:14 +00:00
icons_as_buttons, rss_icon_at_top,
publish_button_at_top,
2021-12-25 23:38:53 +00:00
authorized, None, theme, peertube_instances,
2021-12-25 23:09:49 +00:00
allow_local_network_access, text_mode_banner,
2021-12-25 23:03:28 +00:00
accessKeys, system_language, max_like_count,
2021-12-25 21:29:53 +00:00
shared_items_federated_domains,
2021-12-25 23:03:28 +00:00
signing_priv_key_pem,
2021-12-25 23:26:38 +00:00
cw_lists, lists_enabled)
2020-11-09 22:44:03 +00:00
def htmlInboxReplies(cssCache: {}, defaultTimeline: str,
2021-12-26 20:01:37 +00:00
recent_posts_cache: {}, max_recent_posts: int,
2020-11-09 22:44:03 +00:00
translate: {}, pageNumber: int, itemsPerPage: int,
2021-12-25 16:17:53 +00:00
session, base_dir: str,
2021-12-25 22:28:18 +00:00
cached_webfingers: {}, person_cache: {},
2020-11-09 22:44:03 +00:00
nickname: str, domain: str, port: int, inboxJson: {},
2021-12-25 21:29:53 +00:00
allow_deletion: bool,
2021-12-25 20:34:38 +00:00
http_prefix: str, project_version: str,
2021-09-18 17:08:14 +00:00
minimal: bool,
2021-12-25 17:15:52 +00:00
yt_replace_domain: str,
2021-12-25 20:55:47 +00:00
twitter_replacement_domain: str,
2021-12-25 20:06:27 +00:00
show_published_date_only: bool,
2021-12-25 20:14:45 +00:00
newswire: {}, positive_voting: bool,
2021-12-25 19:34:20 +00:00
show_publish_as_icon: bool,
2021-12-25 19:31:24 +00:00
full_width_tl_button_header: bool,
2021-12-25 19:19:14 +00:00
icons_as_buttons: bool,
2021-12-25 19:09:03 +00:00
rss_icon_at_top: bool,
2021-12-25 19:00:00 +00:00
publish_button_at_top: bool,
2020-12-23 23:59:49 +00:00
authorized: bool, theme: str,
2021-12-25 23:38:53 +00:00
peertube_instances: [],
2021-12-25 18:54:50 +00:00
allow_local_network_access: bool,
2021-12-25 23:09:49 +00:00
text_mode_banner: str,
2021-12-25 23:03:28 +00:00
accessKeys: {}, system_language: str,
2021-12-25 18:23:12 +00:00
max_like_count: int,
2021-12-25 18:05:01 +00:00
shared_items_federated_domains: [],
2021-12-25 23:03:28 +00:00
signing_priv_key_pem: str,
2021-12-25 23:26:38 +00:00
cw_lists: {}, lists_enabled: str) -> str:
2020-11-09 22:44:03 +00:00
"""Show the replies timeline as html
"""
2021-12-26 14:17:13 +00:00
artist = is_artist(base_dir, nickname)
2020-11-09 22:44:03 +00:00
return htmlTimeline(cssCache, defaultTimeline,
2021-12-26 20:01:37 +00:00
recent_posts_cache, max_recent_posts,
2020-11-09 22:44:03 +00:00
translate, pageNumber,
2021-12-25 16:17:53 +00:00
itemsPerPage, session, base_dir,
2021-12-25 22:28:18 +00:00
cached_webfingers, person_cache,
2020-11-09 22:44:03 +00:00
nickname, domain, port, inboxJson, 'tlreplies',
2021-12-25 21:29:53 +00:00
allow_deletion, http_prefix, project_version, False,
2021-09-18 17:08:14 +00:00
minimal,
2021-12-25 17:15:52 +00:00
yt_replace_domain,
2021-12-25 20:55:47 +00:00
twitter_replacement_domain,
2021-12-25 20:06:27 +00:00
show_published_date_only,
2021-12-04 17:18:32 +00:00
newswire, False, False, artist,
2021-12-25 20:14:45 +00:00
positive_voting, show_publish_as_icon,
2021-12-25 19:31:24 +00:00
full_width_tl_button_header,
2021-12-25 19:19:14 +00:00
icons_as_buttons, rss_icon_at_top,
publish_button_at_top,
2021-12-25 23:38:53 +00:00
authorized, None, theme, peertube_instances,
2021-12-25 23:09:49 +00:00
allow_local_network_access, text_mode_banner,
2021-12-25 23:03:28 +00:00
accessKeys, system_language, max_like_count,
shared_items_federated_domains, signing_priv_key_pem,
2021-12-25 23:26:38 +00:00
cw_lists, lists_enabled)
2020-11-09 22:44:03 +00:00
def htmlInboxMedia(cssCache: {}, defaultTimeline: str,
2021-12-26 20:01:37 +00:00
recent_posts_cache: {}, max_recent_posts: int,
2020-11-09 22:44:03 +00:00
translate: {}, pageNumber: int, itemsPerPage: int,
2021-12-25 16:17:53 +00:00
session, base_dir: str,
2021-12-25 22:28:18 +00:00
cached_webfingers: {}, person_cache: {},
2020-11-09 22:44:03 +00:00
nickname: str, domain: str, port: int, inboxJson: {},
2021-12-25 21:29:53 +00:00
allow_deletion: bool,
2021-12-25 20:34:38 +00:00
http_prefix: str, project_version: str,
2021-09-18 17:08:14 +00:00
minimal: bool,
2021-12-25 17:15:52 +00:00
yt_replace_domain: str,
2021-12-25 20:55:47 +00:00
twitter_replacement_domain: str,
2021-12-25 20:06:27 +00:00
show_published_date_only: bool,
2021-12-25 20:14:45 +00:00
newswire: {}, positive_voting: bool,
2021-12-25 19:34:20 +00:00
show_publish_as_icon: bool,
2021-12-25 19:31:24 +00:00
full_width_tl_button_header: bool,
2021-12-25 19:19:14 +00:00
icons_as_buttons: bool,
2021-12-25 19:09:03 +00:00
rss_icon_at_top: bool,
2021-12-25 19:00:00 +00:00
publish_button_at_top: bool,
2020-12-23 23:59:49 +00:00
authorized: bool, theme: str,
2021-12-25 23:38:53 +00:00
peertube_instances: [],
2021-12-25 18:54:50 +00:00
allow_local_network_access: bool,
2021-12-25 23:09:49 +00:00
text_mode_banner: str,
2021-12-25 23:03:28 +00:00
accessKeys: {}, system_language: str,
2021-12-25 18:23:12 +00:00
max_like_count: int,
2021-12-25 18:05:01 +00:00
shared_items_federated_domains: [],
2021-12-25 23:03:28 +00:00
signing_priv_key_pem: str,
2021-12-25 23:26:38 +00:00
cw_lists: {}, lists_enabled: str) -> str:
2020-11-09 22:44:03 +00:00
"""Show the media timeline as html
"""
2021-12-26 14:17:13 +00:00
artist = is_artist(base_dir, nickname)
2020-11-09 22:44:03 +00:00
return htmlTimeline(cssCache, defaultTimeline,
2021-12-26 20:01:37 +00:00
recent_posts_cache, max_recent_posts,
2020-11-09 22:44:03 +00:00
translate, pageNumber,
2021-12-25 16:17:53 +00:00
itemsPerPage, session, base_dir,
2021-12-25 22:28:18 +00:00
cached_webfingers, person_cache,
2020-11-09 22:44:03 +00:00
nickname, domain, port, inboxJson, 'tlmedia',
2021-12-25 21:29:53 +00:00
allow_deletion, http_prefix, project_version, False,
2021-09-18 17:08:14 +00:00
minimal,
2021-12-25 17:15:52 +00:00
yt_replace_domain,
2021-12-25 20:55:47 +00:00
twitter_replacement_domain,
2021-12-25 20:06:27 +00:00
show_published_date_only,
2021-12-04 17:18:32 +00:00
newswire, False, False, artist,
2021-12-25 20:14:45 +00:00
positive_voting, show_publish_as_icon,
2021-12-25 19:31:24 +00:00
full_width_tl_button_header,
2021-12-25 19:19:14 +00:00
icons_as_buttons, rss_icon_at_top,
publish_button_at_top,
2021-12-25 23:38:53 +00:00
authorized, None, theme, peertube_instances,
2021-12-25 23:09:49 +00:00
allow_local_network_access, text_mode_banner,
2021-12-25 23:03:28 +00:00
accessKeys, system_language, max_like_count,
shared_items_federated_domains, signing_priv_key_pem,
2021-12-25 23:26:38 +00:00
cw_lists, lists_enabled)
2020-11-09 22:44:03 +00:00
def htmlInboxBlogs(cssCache: {}, defaultTimeline: str,
2021-12-26 20:01:37 +00:00
recent_posts_cache: {}, max_recent_posts: int,
2020-11-09 22:44:03 +00:00
translate: {}, pageNumber: int, itemsPerPage: int,
2021-12-25 16:17:53 +00:00
session, base_dir: str,
2021-12-25 22:28:18 +00:00
cached_webfingers: {}, person_cache: {},
2020-11-09 22:44:03 +00:00
nickname: str, domain: str, port: int, inboxJson: {},
2021-12-25 21:29:53 +00:00
allow_deletion: bool,
2021-12-25 20:34:38 +00:00
http_prefix: str, project_version: str,
2021-09-18 17:08:14 +00:00
minimal: bool,
2021-12-25 17:15:52 +00:00
yt_replace_domain: str,
2021-12-25 20:55:47 +00:00
twitter_replacement_domain: str,
2021-12-25 20:06:27 +00:00
show_published_date_only: bool,
2021-12-25 20:14:45 +00:00
newswire: {}, positive_voting: bool,
2021-12-25 19:34:20 +00:00
show_publish_as_icon: bool,
2021-12-25 19:31:24 +00:00
full_width_tl_button_header: bool,
2021-12-25 19:19:14 +00:00
icons_as_buttons: bool,
2021-12-25 19:09:03 +00:00
rss_icon_at_top: bool,
2021-12-25 19:00:00 +00:00
publish_button_at_top: bool,
2020-12-23 23:59:49 +00:00
authorized: bool, theme: str,
2021-12-25 23:38:53 +00:00
peertube_instances: [],
2021-12-25 18:54:50 +00:00
allow_local_network_access: bool,
2021-12-25 23:09:49 +00:00
text_mode_banner: str,
2021-12-25 23:03:28 +00:00
accessKeys: {}, system_language: str,
2021-12-25 18:23:12 +00:00
max_like_count: int,
2021-12-25 18:05:01 +00:00
shared_items_federated_domains: [],
2021-12-25 23:03:28 +00:00
signing_priv_key_pem: str,
2021-12-25 23:26:38 +00:00
cw_lists: {}, lists_enabled: str) -> str:
2020-11-09 22:44:03 +00:00
"""Show the blogs timeline as html
"""
2021-12-26 14:17:13 +00:00
artist = is_artist(base_dir, nickname)
2020-11-09 22:44:03 +00:00
return htmlTimeline(cssCache, defaultTimeline,
2021-12-26 20:01:37 +00:00
recent_posts_cache, max_recent_posts,
2020-11-09 22:44:03 +00:00
translate, pageNumber,
2021-12-25 16:17:53 +00:00
itemsPerPage, session, base_dir,
2021-12-25 22:28:18 +00:00
cached_webfingers, person_cache,
2020-11-09 22:44:03 +00:00
nickname, domain, port, inboxJson, 'tlblogs',
2021-12-25 21:29:53 +00:00
allow_deletion, http_prefix, project_version, False,
2021-09-18 17:08:14 +00:00
minimal,
2021-12-25 17:15:52 +00:00
yt_replace_domain,
2021-12-25 20:55:47 +00:00
twitter_replacement_domain,
2021-12-25 20:06:27 +00:00
show_published_date_only,
2021-12-04 17:18:32 +00:00
newswire, False, False, artist,
2021-12-25 20:14:45 +00:00
positive_voting, show_publish_as_icon,
2021-12-25 19:31:24 +00:00
full_width_tl_button_header,
2021-12-25 19:19:14 +00:00
icons_as_buttons, rss_icon_at_top,
publish_button_at_top,
2021-12-25 23:38:53 +00:00
authorized, None, theme, peertube_instances,
2021-12-25 23:09:49 +00:00
allow_local_network_access, text_mode_banner,
2021-12-25 23:03:28 +00:00
accessKeys, system_language, max_like_count,
shared_items_federated_domains, signing_priv_key_pem,
2021-12-25 23:26:38 +00:00
cw_lists, lists_enabled)
2020-11-09 22:44:03 +00:00
2020-11-27 11:22:47 +00:00
def htmlInboxFeatures(cssCache: {}, defaultTimeline: str,
2021-12-26 20:01:37 +00:00
recent_posts_cache: {}, max_recent_posts: int,
2020-11-27 11:22:47 +00:00
translate: {}, pageNumber: int, itemsPerPage: int,
2021-12-25 16:17:53 +00:00
session, base_dir: str,
2021-12-25 22:28:18 +00:00
cached_webfingers: {}, person_cache: {},
2020-11-27 11:22:47 +00:00
nickname: str, domain: str, port: int, inboxJson: {},
2021-12-25 21:29:53 +00:00
allow_deletion: bool,
2021-12-25 20:34:38 +00:00
http_prefix: str, project_version: str,
2021-09-18 17:08:14 +00:00
minimal: bool,
2021-12-25 17:15:52 +00:00
yt_replace_domain: str,
2021-12-25 20:55:47 +00:00
twitter_replacement_domain: str,
2021-12-25 20:06:27 +00:00
show_published_date_only: bool,
2021-12-25 20:14:45 +00:00
newswire: {}, positive_voting: bool,
2021-12-25 19:34:20 +00:00
show_publish_as_icon: bool,
2021-12-25 19:31:24 +00:00
full_width_tl_button_header: bool,
2021-12-25 19:19:14 +00:00
icons_as_buttons: bool,
2021-12-25 19:09:03 +00:00
rss_icon_at_top: bool,
2021-12-25 19:00:00 +00:00
publish_button_at_top: bool,
2020-12-20 17:26:38 +00:00
authorized: bool,
2020-12-23 23:59:49 +00:00
theme: str,
2021-12-25 23:38:53 +00:00
peertube_instances: [],
2021-12-25 18:54:50 +00:00
allow_local_network_access: bool,
2021-12-25 23:09:49 +00:00
text_mode_banner: str,
2021-12-25 23:03:28 +00:00
accessKeys: {}, system_language: str,
2021-12-25 18:23:12 +00:00
max_like_count: int,
2021-12-25 18:05:01 +00:00
shared_items_federated_domains: [],
2021-12-25 23:03:28 +00:00
signing_priv_key_pem: str,
2021-12-25 23:26:38 +00:00
cw_lists: {}, lists_enabled: str) -> str:
2020-11-27 11:22:47 +00:00
"""Show the features timeline as html
"""
return htmlTimeline(cssCache, defaultTimeline,
2021-12-26 20:01:37 +00:00
recent_posts_cache, max_recent_posts,
2020-11-27 11:22:47 +00:00
translate, pageNumber,
2021-12-25 16:17:53 +00:00
itemsPerPage, session, base_dir,
2021-12-25 22:28:18 +00:00
cached_webfingers, person_cache,
2020-11-27 15:05:22 +00:00
nickname, domain, port, inboxJson, 'tlfeatures',
2021-12-25 21:29:53 +00:00
allow_deletion, http_prefix, project_version, False,
2021-09-18 17:08:14 +00:00
minimal,
2021-12-25 17:15:52 +00:00
yt_replace_domain,
2021-12-25 20:55:47 +00:00
twitter_replacement_domain,
2021-12-25 20:06:27 +00:00
show_published_date_only,
2021-12-04 16:59:50 +00:00
newswire, False, False, False,
2021-12-25 20:14:45 +00:00
positive_voting, show_publish_as_icon,
2021-12-25 19:31:24 +00:00
full_width_tl_button_header,
2021-12-25 19:19:14 +00:00
icons_as_buttons, rss_icon_at_top,
publish_button_at_top,
2021-12-25 23:38:53 +00:00
authorized, None, theme, peertube_instances,
2021-12-25 23:09:49 +00:00
allow_local_network_access, text_mode_banner,
2021-12-25 23:03:28 +00:00
accessKeys, system_language, max_like_count,
shared_items_federated_domains, signing_priv_key_pem,
2021-12-25 23:26:38 +00:00
cw_lists, lists_enabled)
2020-11-27 11:22:47 +00:00
2020-11-09 22:44:03 +00:00
def htmlInboxNews(cssCache: {}, defaultTimeline: str,
2021-12-26 20:01:37 +00:00
recent_posts_cache: {}, max_recent_posts: int,
2020-11-09 22:44:03 +00:00
translate: {}, pageNumber: int, itemsPerPage: int,
2021-12-25 16:17:53 +00:00
session, base_dir: str,
2021-12-25 22:28:18 +00:00
cached_webfingers: {}, person_cache: {},
2020-11-09 22:44:03 +00:00
nickname: str, domain: str, port: int, inboxJson: {},
2021-12-25 21:29:53 +00:00
allow_deletion: bool,
2021-12-25 20:34:38 +00:00
http_prefix: str, project_version: str,
2021-09-18 17:08:14 +00:00
minimal: bool,
2021-12-25 17:15:52 +00:00
yt_replace_domain: str,
2021-12-25 20:55:47 +00:00
twitter_replacement_domain: str,
2021-12-25 20:06:27 +00:00
show_published_date_only: bool,
2021-12-04 16:59:50 +00:00
newswire: {}, moderator: bool, editor: bool, artist: bool,
2021-12-25 20:14:45 +00:00
positive_voting: bool, show_publish_as_icon: bool,
2021-12-25 19:31:24 +00:00
full_width_tl_button_header: bool,
2021-12-25 19:19:14 +00:00
icons_as_buttons: bool,
2021-12-25 19:09:03 +00:00
rss_icon_at_top: bool,
2021-12-25 19:00:00 +00:00
publish_button_at_top: bool,
2020-12-23 23:59:49 +00:00
authorized: bool, theme: str,
2021-12-25 23:38:53 +00:00
peertube_instances: [],
2021-12-25 18:54:50 +00:00
allow_local_network_access: bool,
2021-12-25 23:09:49 +00:00
text_mode_banner: str,
2021-12-25 23:03:28 +00:00
accessKeys: {}, system_language: str,
2021-12-25 18:23:12 +00:00
max_like_count: int,
2021-12-25 18:05:01 +00:00
shared_items_federated_domains: [],
2021-12-25 23:03:28 +00:00
signing_priv_key_pem: str,
2021-12-25 23:26:38 +00:00
cw_lists: {}, lists_enabled: str) -> str:
2020-11-09 22:44:03 +00:00
"""Show the news timeline as html
"""
return htmlTimeline(cssCache, defaultTimeline,
2021-12-26 20:01:37 +00:00
recent_posts_cache, max_recent_posts,
2020-11-09 22:44:03 +00:00
translate, pageNumber,
2021-12-25 16:17:53 +00:00
itemsPerPage, session, base_dir,
2021-12-25 22:28:18 +00:00
cached_webfingers, person_cache,
2020-11-09 22:44:03 +00:00
nickname, domain, port, inboxJson, 'tlnews',
2021-12-25 21:29:53 +00:00
allow_deletion, http_prefix, project_version, False,
2021-09-18 17:08:14 +00:00
minimal,
2021-12-25 17:15:52 +00:00
yt_replace_domain,
2021-12-25 20:55:47 +00:00
twitter_replacement_domain,
2021-12-25 20:06:27 +00:00
show_published_date_only,
2021-12-04 16:59:50 +00:00
newswire, moderator, editor, artist,
2021-12-25 20:14:45 +00:00
positive_voting, show_publish_as_icon,
2021-12-25 19:31:24 +00:00
full_width_tl_button_header,
2021-12-25 19:19:14 +00:00
icons_as_buttons, rss_icon_at_top,
publish_button_at_top,
2021-12-25 23:38:53 +00:00
authorized, None, theme, peertube_instances,
2021-12-25 23:09:49 +00:00
allow_local_network_access, text_mode_banner,
2021-12-25 23:03:28 +00:00
accessKeys, system_language, max_like_count,
shared_items_federated_domains, signing_priv_key_pem,
2021-12-25 23:26:38 +00:00
cw_lists, lists_enabled)
2020-11-09 22:44:03 +00:00
def htmlOutbox(cssCache: {}, defaultTimeline: str,
2021-12-26 20:01:37 +00:00
recent_posts_cache: {}, max_recent_posts: int,
2020-11-09 22:44:03 +00:00
translate: {}, pageNumber: int, itemsPerPage: int,
2021-12-25 16:17:53 +00:00
session, base_dir: str,
2021-12-25 22:28:18 +00:00
cached_webfingers: {}, person_cache: {},
2020-11-09 22:44:03 +00:00
nickname: str, domain: str, port: int, outboxJson: {},
2021-12-25 21:29:53 +00:00
allow_deletion: bool,
2021-12-25 20:34:38 +00:00
http_prefix: str, project_version: str,
2021-09-18 17:08:14 +00:00
minimal: bool,
2021-12-25 17:15:52 +00:00
yt_replace_domain: str,
2021-12-25 20:55:47 +00:00
twitter_replacement_domain: str,
2021-12-25 20:06:27 +00:00
show_published_date_only: bool,
2021-12-25 20:14:45 +00:00
newswire: {}, positive_voting: bool,
2021-12-25 19:34:20 +00:00
show_publish_as_icon: bool,
2021-12-25 19:31:24 +00:00
full_width_tl_button_header: bool,
2021-12-25 19:19:14 +00:00
icons_as_buttons: bool,
2021-12-25 19:09:03 +00:00
rss_icon_at_top: bool,
2021-12-25 19:00:00 +00:00
publish_button_at_top: bool,
2020-12-23 23:59:49 +00:00
authorized: bool, theme: str,
2021-12-25 23:38:53 +00:00
peertube_instances: [],
2021-12-25 18:54:50 +00:00
allow_local_network_access: bool,
2021-12-25 23:09:49 +00:00
text_mode_banner: str,
2021-12-25 23:03:28 +00:00
accessKeys: {}, system_language: str,
2021-12-25 18:23:12 +00:00
max_like_count: int,
2021-12-25 18:05:01 +00:00
shared_items_federated_domains: [],
2021-12-25 23:03:28 +00:00
signing_priv_key_pem: str,
2021-12-25 23:26:38 +00:00
cw_lists: {}, lists_enabled: str) -> str:
2020-11-09 22:44:03 +00:00
"""Show the Outbox as html
"""
manuallyApproveFollowers = \
2021-12-25 16:17:53 +00:00
followerApprovalActive(base_dir, nickname, domain)
2021-12-26 14:17:13 +00:00
artist = is_artist(base_dir, nickname)
2020-11-09 22:44:03 +00:00
return htmlTimeline(cssCache, defaultTimeline,
2021-12-26 20:01:37 +00:00
recent_posts_cache, max_recent_posts,
2020-11-09 22:44:03 +00:00
translate, pageNumber,
2021-12-25 16:17:53 +00:00
itemsPerPage, session, base_dir,
2021-12-25 22:28:18 +00:00
cached_webfingers, person_cache,
2020-11-09 22:44:03 +00:00
nickname, domain, port, outboxJson, 'outbox',
2021-12-25 21:29:53 +00:00
allow_deletion, http_prefix, project_version,
2020-11-09 22:44:03 +00:00
manuallyApproveFollowers, minimal,
2021-12-25 17:15:52 +00:00
yt_replace_domain,
2021-12-25 20:55:47 +00:00
twitter_replacement_domain,
2021-12-25 20:06:27 +00:00
show_published_date_only,
2021-12-25 20:14:45 +00:00
newswire, False, False, artist, positive_voting,
2021-12-25 19:34:20 +00:00
show_publish_as_icon,
2021-12-25 19:31:24 +00:00
full_width_tl_button_header,
2021-12-25 19:19:14 +00:00
icons_as_buttons, rss_icon_at_top,
publish_button_at_top,
2021-12-25 23:38:53 +00:00
authorized, None, theme, peertube_instances,
2021-12-25 23:09:49 +00:00
allow_local_network_access, text_mode_banner,
2021-12-25 23:03:28 +00:00
accessKeys, system_language, max_like_count,
shared_items_federated_domains, signing_priv_key_pem,
2021-12-25 23:26:38 +00:00
cw_lists, lists_enabled)