Files
danbooru/app/views/news_updates/_listing.html.erb
evazion 6c7fbb96b3 news updates: use relative time instead of date.
Use relative time on site updates to show when a site update was posted
("5m ago"), instead of the date ("Oct 1").
2021-10-01 05:15:40 -05:00

12 lines
426 B
Plaintext

<% if NewsUpdate.recent.present? %>
<div id="news-updates" data-id="<%= NewsUpdate.recent.first.try(:id) %>" style="display: none;">
<ul>
<% NewsUpdate.recent.each do |news_update| %>
<li><%= time_ago_in_words_tagged(news_update.created_at, compact: true) %> ago: <%= news_update.message.html_safe %></li>
<% end %>
</ul>
<a href="#" id="close-news-ticker-link">close</a>
</div>
<% end %>