Merge pull request #3676 from harry-wood/notes-disappear-time

Display how long until a note will disappear
This commit is contained in:
Andy Allan 2022-11-23 15:44:26 +00:00 committed by GitHub
commit 067b0de439
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 51 additions and 5 deletions

View file

@ -23,4 +23,9 @@ module NoteHelper
link_to h(author.display_name), link_options.merge(:controller => "/users", :action => "show", :display_name => author.display_name)
end
end
def disappear_in(note)
date = note.freshly_closed_until
tag.span(distance_of_time_in_words(date, Time.now.utc), :title => l(date, :format => :friendly))
end
end