mirror of https://gitlab.com/bashrc2/epicyon
Features timeline function
parent
98f9ea15cc
commit
0014e5f6e1
|
@ -25,6 +25,7 @@ from posts import createRepliesTimeline
|
||||||
from posts import createMediaTimeline
|
from posts import createMediaTimeline
|
||||||
from posts import createNewsTimeline
|
from posts import createNewsTimeline
|
||||||
from posts import createBlogsTimeline
|
from posts import createBlogsTimeline
|
||||||
|
from posts import createFeaturesTimeline
|
||||||
from posts import createBookmarksTimeline
|
from posts import createBookmarksTimeline
|
||||||
from posts import createEventsTimeline
|
from posts import createEventsTimeline
|
||||||
from posts import createInbox
|
from posts import createInbox
|
||||||
|
@ -628,6 +629,7 @@ def personBoxJson(recentPostsCache: {},
|
||||||
if boxname != 'inbox' and boxname != 'dm' and \
|
if boxname != 'inbox' and boxname != 'dm' and \
|
||||||
boxname != 'tlreplies' and boxname != 'tlmedia' and \
|
boxname != 'tlreplies' and boxname != 'tlmedia' and \
|
||||||
boxname != 'tlblogs' and boxname != 'tlnews' and \
|
boxname != 'tlblogs' and boxname != 'tlnews' and \
|
||||||
|
boxname != 'tlfeatures' and \
|
||||||
boxname != 'outbox' and boxname != 'moderation' and \
|
boxname != 'outbox' and boxname != 'moderation' and \
|
||||||
boxname != 'tlbookmarks' and boxname != 'bookmarks' and \
|
boxname != 'tlbookmarks' and boxname != 'bookmarks' and \
|
||||||
boxname != 'tlevents':
|
boxname != 'tlevents':
|
||||||
|
@ -700,6 +702,10 @@ def personBoxJson(recentPostsCache: {},
|
||||||
httpPrefix, noOfItems, headerOnly,
|
httpPrefix, noOfItems, headerOnly,
|
||||||
newswireVotesThreshold, positiveVoting,
|
newswireVotesThreshold, positiveVoting,
|
||||||
votingTimeMins, pageNumber)
|
votingTimeMins, pageNumber)
|
||||||
|
elif boxname == 'tlfeatures':
|
||||||
|
return createFeaturesTimeline(session, baseDir, nickname, domain, port,
|
||||||
|
httpPrefix, noOfItems, headerOnly,
|
||||||
|
pageNumber)
|
||||||
elif boxname == 'tlblogs':
|
elif boxname == 'tlblogs':
|
||||||
return createBlogsTimeline(session, baseDir, nickname, domain, port,
|
return createBlogsTimeline(session, baseDir, nickname, domain, port,
|
||||||
httpPrefix, noOfItems, headerOnly,
|
httpPrefix, noOfItems, headerOnly,
|
||||||
|
|
9
posts.py
9
posts.py
|
@ -2587,6 +2587,15 @@ def createBlogsTimeline(session, baseDir: str, nickname: str, domain: str,
|
||||||
0, False, 0, pageNumber)
|
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,
|
def createMediaTimeline(session, baseDir: str, nickname: str, domain: str,
|
||||||
port: int, httpPrefix: str, itemsPerPage: int,
|
port: int, httpPrefix: str, itemsPerPage: int,
|
||||||
headerOnly: bool, pageNumber=None) -> {}:
|
headerOnly: bool, pageNumber=None) -> {}:
|
||||||
|
|
|
@ -624,11 +624,10 @@ def htmlProfile(rssIconAtTop: bool,
|
||||||
cssFilename = baseDir + '/epicyon.css'
|
cssFilename = baseDir + '/epicyon.css'
|
||||||
|
|
||||||
if isSystemAccount(nickname):
|
if isSystemAccount(nickname):
|
||||||
|
licenseStr = ''
|
||||||
bannerFile, bannerFilename = \
|
bannerFile, bannerFilename = \
|
||||||
getBannerFile(baseDir, nickname, domain)
|
getBannerFile(baseDir, nickname, domain)
|
||||||
|
else:
|
||||||
licenseStr = ''
|
|
||||||
if not isSystemAccount(nickname):
|
|
||||||
licenseStr = \
|
licenseStr = \
|
||||||
'<a href="https://gitlab.com/bashrc2/epicyon">' + \
|
'<a href="https://gitlab.com/bashrc2/epicyon">' + \
|
||||||
'<img loading="lazy" class="license" alt="' + \
|
'<img loading="lazy" class="license" alt="' + \
|
||||||
|
@ -717,14 +716,15 @@ def htmlProfilePosts(recentPostsCache: {}, maxRecentPosts: int,
|
||||||
maxItems = 4
|
maxItems = 4
|
||||||
ctr = 0
|
ctr = 0
|
||||||
currPage = 1
|
currPage = 1
|
||||||
|
boxName = 'outbox'
|
||||||
while ctr < maxItems and currPage < 4:
|
while ctr < maxItems and currPage < 4:
|
||||||
outboxFeed = \
|
outboxFeed = \
|
||||||
personBoxJson({}, session, baseDir, domain,
|
personBoxJson({}, session, baseDir, domain,
|
||||||
port,
|
port,
|
||||||
'/users/' + nickname + '/outbox?page=' +
|
'/users/' + nickname + '/' + boxName + '?page=' +
|
||||||
str(currPage),
|
str(currPage),
|
||||||
httpPrefix,
|
httpPrefix,
|
||||||
10, 'outbox',
|
10, boxName,
|
||||||
authorized, 0, False, 0)
|
authorized, 0, False, 0)
|
||||||
if not outboxFeed:
|
if not outboxFeed:
|
||||||
break
|
break
|
||||||
|
|
Loading…
Reference in New Issue