Changeset 520e477 in Klonkt for src/routes/circle.js
- Timestamp:
- 07/20/2026 07:35:55 AM (7 weeks ago)
- Branches:
- main
- Children:
- 22d2f5a8
- Parents:
- 1485933
- git-author:
- Robin <roboburr@…> (07/20/2026 07:26:51 AM)
- git-committer:
- Robin <roboburr@…> (07/20/2026 07:35:55 AM)
- File:
-
- 1 edited
-
src/routes/circle.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/routes/circle.js
r1485933 r520e477 42 42 } 43 43 44 const CIRKEL_PAGE = 72; // matches FEED_PAGE in posts.js: divisible by 2/3/4 45 44 46 router.get('/cirkel', (req, res, next) => { 45 47 const site = res.locals.site; 46 48 if (!site || !apEnabled() || (ActivityPubService.autoBoostCount(site.slug) === 0 && ActivityPubService.boostedCount(site.slug) === 0)) return next(); 47 49 48 const posts = ActivityPubService.getCirkelPosts(site.slug, 80).map((r) => { 50 const append = req.query.append === '1'; 51 const offset = Math.max(0, parseInt(req.query.offset, 10) || 0); 52 const rows = ActivityPubService.getCirkelPosts(site.slug, CIRKEL_PAGE + 1, offset); 53 const hasMore = rows.length > CIRKEL_PAGE; 54 const posts = rows.slice(0, CIRKEL_PAGE).map((r) => { 49 55 const text = tidySnippet(htmlToText(r.content)); 50 56 // Show ONLY the title (the bold first line a Klonkt note carries), not the whole … … 77 83 }); 78 84 85 const moreBase = res.locals.siteUrlBase || ''; 86 if (append) { 87 return renderPage(req, res, 'partials/home-append', { posts, hasMore, nextOffset: offset + CIRKEL_PAGE, moreBase, morePath: '/cirkel' }); 88 } 89 79 90 const sites = ActivityPubService.getCirkelMembers(site.slug) 80 91 .map((s) => ({ name: s.name || 'Onbekend', url: safeUrl(s.url), avatar: safeUrl(s.icon) })); 81 92 82 renderPage(req, res, 'pages/circle-feed', { pageTitle: 'Cirkel', bodyClass: 'on-cirkel', posts, sites }); 93 renderPage(req, res, 'pages/circle-feed', { 94 pageTitle: 'Cirkel', bodyClass: 'on-cirkel', posts, sites, 95 hasMore, nextOffset: offset + CIRKEL_PAGE, moreBase, 96 }); 83 97 }); 84 98
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)