mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
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:
@@ -61,6 +61,7 @@ class TopicViewSerializer < ApplicationSerializer
|
||||
:is_warning,
|
||||
:chunk_size,
|
||||
:bookmarked,
|
||||
:bookmark_reminder_at,
|
||||
:message_archived,
|
||||
:topic_timer,
|
||||
:private_topic_timer,
|
||||
@@ -192,6 +193,14 @@ class TopicViewSerializer < ApplicationSerializer
|
||||
end
|
||||
end
|
||||
|
||||
def include_bookmark_reminder_at?
|
||||
SiteSetting.enable_bookmarks_with_reminders? && bookmarked
|
||||
end
|
||||
|
||||
def bookmark_reminder_at
|
||||
object.first_post_bookmark_reminder_at
|
||||
end
|
||||
|
||||
def topic_timer
|
||||
TopicTimerSerializer.new(object.topic.public_topic_timer, root: false)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user