Changeset ce8c8c2 in Klonkt for src/routes/hub.js
- Timestamp:
- 06/14/2026 06:46:13 PM (3 months ago)
- Branches:
- main
- Children:
- 74c2473
- Parents:
- a3169f5
- File:
-
- 1 edited
-
src/routes/hub.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/routes/hub.js
ra3169f5 rce8c8c2 35 35 `).all(); 36 36 37 // De hoofd-/labelsite (oudste = de bedrijfs-/hoofdaccount) is GEEN artiest; 38 // die tonen we apart bovenaan, niet in de Artiesten-roster. 39 const mainSite = db.prepare(` 40 SELECT s.id, s.slug, s.title, s.tagline, s.profile_photo, s.accent, 41 u.avatar_url AS owner_avatar, 42 (SELECT COUNT(*) FROM posts WHERE site_id = s.id AND status = 'published') AS post_count 43 FROM sites s 44 LEFT JOIN users u ON u.id = s.owner_id 45 ORDER BY s.created_at ASC 46 LIMIT 1 47 `).get() || null; 48 const mainId = mainSite ? mainSite.id : ''; 49 37 50 // Uitgelichte PrutFolio's voor de home-roster: meest-actief eerst (aantal 38 // gepubliceerde posts), dan nieuwste. Beperkt tot HOME_ROSTER_LIMIT zodat de39 // home schaalt — de volledige, doorzoekbare lijst staat op /artiesten.51 // gepubliceerde posts), dan nieuwste. Excl. de hoofdsite. Beperkt tot 52 // HOME_ROSTER_LIMIT zodat de home schaalt — volledige lijst staat op /artiesten. 40 53 const HOME_ROSTER_LIMIT = 24; 41 54 const artists = db.prepare(` … … 45 58 FROM sites s 46 59 LEFT JOIN users u ON u.id = s.owner_id 60 WHERE s.id != @mainId 47 61 ORDER BY post_count DESC, s.created_at DESC 48 LIMIT ?49 `).all( HOME_ROSTER_LIMIT);50 const totalArtists = db.prepare('SELECT COUNT(*) AS c FROM sites ').get().c;62 LIMIT @limit 63 `).all({ mainId, limit: HOME_ROSTER_LIMIT }); 64 const totalArtists = db.prepare('SELECT COUNT(*) AS c FROM sites WHERE id != ?').get(mainId).c; 51 65 52 66 // De hub-pagina is GENERIEK (van geen enkele user) — branding komt uit globale … … 64 78 bodyClass: 'on-home on-hub', 65 79 hub, 80 mainSite, 66 81 artists, 67 82 totalArtists,
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)