feat: add clickable activity cards with comment anchor links to profile tab
Add `url` field to profile activity items so post cards link to `/posts/{slug}` and comment cards link to the parent post with a `#comment-{uid}` anchor, matching notification click behavior. Include the shared `_card_link.html` overlay in the template, fix XP bar rendering for missing `xp` key, and add API + e2e tests verifying the link structure and navigation.
This commit is contained in:
@@ -26,6 +26,7 @@ from devplacepy.database import (
|
||||
get_user_media,
|
||||
search_users_by_username,
|
||||
mark_notifications_read_by_target,
|
||||
resolve_object_url,
|
||||
)
|
||||
from devplacepy.content import can_view_project, enrich_items
|
||||
from devplacepy.utils import (
|
||||
@@ -209,6 +210,7 @@ async def profile_page(
|
||||
"time_ago": time_ago(p["created_at"]),
|
||||
"created_at": p["created_at"],
|
||||
"uid": p["uid"],
|
||||
"url": resolve_object_url("post", p["uid"]),
|
||||
}
|
||||
)
|
||||
comments_table = get_table("comments")
|
||||
@@ -228,6 +230,7 @@ async def profile_page(
|
||||
"created_at": c["created_at"],
|
||||
"uid": target_uid,
|
||||
"target_type": target_type,
|
||||
"url": f"{resolve_object_url(target_type, target_uid)}#comment-{c['uid']}",
|
||||
}
|
||||
)
|
||||
activities.sort(key=lambda a: a["created_at"], reverse=True)
|
||||
|
||||
Reference in New Issue
Block a user