Display how long until a note will disappear

Modify the message displayed at the bottom of the notes sidepanel. For already resolved notes we don't want to say "please resolve it". Fixes https://github.com/openstreetmap/openstreetmap-website/issues/3663

Instead explain that it will disappear from the map (so reporting is probably not necessary) and display how long to go until that happens. Tackling https://github.com/openstreetmap/openstreetmap-website/issues/3071
This commit is contained in:
Harry Wood 2022-09-02 00:51:59 +01:00
parent bf11e06e63
commit d8e51614cb
5 changed files with 46 additions and 2 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