FEATURE: Decorate topic-level bookmark button with reminder time (#9426)

* Show the correct bookmark with clock icon when topic-level bookmark reminder time is set and show the time of the reminder in the title on hover.
* Add a new bookmark lib and reminder time formatting function to show time with today/tomorrow shorthand for readability. E.g. tomorrow at 8:00am instead of Apr 16 2020 at 8:00am. This only applies to today + tomorrow, future dates are still treated the same.
This commit is contained in:
Martin Brennan
2020-04-16 09:20:44 +10:00
committed by GitHub
parent 3c72cbc5de
commit d7f744490a
11 changed files with 137 additions and 25 deletions

View File

@@ -354,6 +354,10 @@ class TopicView
@topic.bookmarks.exists?(user_id: @user.id)
end
def first_post_bookmark_reminder_at
@topic.first_post.bookmarks.where(user: @user).pluck_first(:reminder_at)
end
MAX_PARTICIPANTS = 24
def post_counts_by_user