Connect feed posts to creator profiles

This commit is contained in:
nachbaisabel committed 2026-05-30 21:59:55 +02:00
1 parent 58d0c8a15a
commit 6ea5a386cf
4 files changed
+200 -24

No files matched your search

+6 -1
View File
@@ -151,12 +151,17 @@
function feedImg(id) {
return `/images/content/feed${(parseInt(id.slice(-1), 16) % 4) + 1}.png`;
}
function profileUrl(userId) {
return `/profile.html?id=${encodeURIComponent(userId)}`;
}
function renderCard(prompt) {
const locked = !prompt.canAccess;
const liked = prompt.isLiked;
const saved = prompt.isSaved;
return `
<div class="post-card${locked ? " post-locked" : ""}" onclick="location.href='/post-detail?id=${prompt.id}'">
<div class="post-card${locked ? " post-locked" : ""}" onclick="location.href='${profileUrl(prompt.creatorId)}'">
<div class="post-header">
<img class="post-avatar" src="${prompt.creatorAvatarUrl || '../images/content/cat.png'}" alt="${prompt.creatorName}">
<div class="post-author">