Features timeline function

main
Bob Mottram 2020-11-27 12:29:20 +00:00
parent 98f9ea15cc
commit 0014e5f6e1
3 changed files with 20 additions and 5 deletions

View File

@ -25,6 +25,7 @@ from posts import createRepliesTimeline
from posts import createMediaTimeline
from posts import createNewsTimeline
from posts import createBlogsTimeline
from posts import createFeaturesTimeline
from posts import createBookmarksTimeline
from posts import createEventsTimeline
from posts import createInbox
@ -628,6 +629,7 @@ def personBoxJson(recentPostsCache: {},
if boxname != 'inbox' and boxname != 'dm' and \
boxname != 'tlreplies' and boxname != 'tlmedia' and \
boxname != 'tlblogs' and boxname != 'tlnews' and \
boxname != 'tlfeatures' and \
boxname != 'outbox' and boxname != 'moderation' and \
boxname != 'tlbookmarks' and boxname != 'bookmarks' and \
boxname != 'tlevents':
@ -700,6 +702,10 @@ def personBoxJson(recentPostsCache: {},
httpPrefix, noOfItems, headerOnly,
newswireVotesThreshold, positiveVoting,
votingTimeMins, pageNumber)
elif boxname == 'tlfeatures':
return createFeaturesTimeline(session, baseDir, nickname, domain, port,
httpPrefix, noOfItems, headerOnly,
pageNumber)
elif boxname == 'tlblogs':
return createBlogsTimeline(session, baseDir, nickname, domain, port,
httpPrefix, noOfItems, headerOnly,

View File

@ -2587,6 +2587,15 @@ def createBlogsTimeline(session, baseDir: str, nickname: str, domain: str,
0, False, 0, pageNumber)
def createFeaturesTimeline(session, baseDir: str, nickname: str, domain: str,
port: int, httpPrefix: str, itemsPerPage: int,
headerOnly: bool, pageNumber=None) -> {}:
return createBoxIndexed({}, session, baseDir, 'tlblogs', 'news',
domain, port, httpPrefix,
itemsPerPage, headerOnly, True,
0, False, 0, pageNumber)
def createMediaTimeline(session, baseDir: str, nickname: str, domain: str,
port: int, httpPrefix: str, itemsPerPage: int,
headerOnly: bool, pageNumber=None) -> {}:

View File

@ -624,11 +624,10 @@ def htmlProfile(rssIconAtTop: bool,
cssFilename = baseDir + '/epicyon.css'
if isSystemAccount(nickname):
licenseStr = ''
bannerFile, bannerFilename = \
getBannerFile(baseDir, nickname, domain)
licenseStr = ''
if not isSystemAccount(nickname):
else:
licenseStr = \
'<a href="https://gitlab.com/bashrc2/epicyon">' + \
'<img loading="lazy" class="license" alt="' + \
@ -717,14 +716,15 @@ def htmlProfilePosts(recentPostsCache: {}, maxRecentPosts: int,
maxItems = 4
ctr = 0
currPage = 1
boxName = 'outbox'
while ctr < maxItems and currPage < 4:
outboxFeed = \
personBoxJson({}, session, baseDir, domain,
port,
'/users/' + nickname + '/outbox?page=' +
'/users/' + nickname + '/' + boxName + '?page=' +
str(currPage),
httpPrefix,
10, 'outbox',
10, boxName,
authorized, 0, False, 0)
if not outboxFeed:
break