FIX: Change /bookmarks URL back to topic list and add bookmark poster avatars (#9759)

* Changes the /bookmarks URL to show the original "topics filtered by bookmark" list instead of redirecting to user activity bookmarks (see https://meta.discourse.org/t/domain-com-bookmarks-is-showing-domain-com-u-user-activity-bookmarks-with-reminders/149252/12)
* Add the user avatar for the user who made the post that is bookmarked
This commit is contained in:
Martin Brennan
2020-05-13 14:03:24 +10:00
committed by GitHub
parent 811bc3544f
commit a64cf265fd
8 changed files with 59 additions and 17 deletions

View File

@@ -24,7 +24,9 @@ class UserBookmarkSerializer < ApplicationSerializer
:highest_post_number,
:bumped_at,
:slug,
:username
:post_user_username,
:post_user_avatar_template,
:post_user_name
def topic
@topic ||= object.topic || Topic.unscoped.find(object.topic_id)
@@ -94,7 +96,19 @@ class UserBookmarkSerializer < ApplicationSerializer
topic.slug
end
def username
post.user.username
def post_user
@post_user ||= post.user
end
def post_user_username
post_user.username
end
def post_user_avatar_template
post_user.avatar_template
end
def post_user_name
post_user.name
end
end