[Cleanup] Unify timestamp generation

This commit is contained in:
Earlopain 2023-05-16 21:14:57 +02:00
parent b339e84612
commit d1cf869744
No known key found for this signature in database
GPG Key ID: 6CFB948E15246897
17 changed files with 26 additions and 31 deletions

View File

@ -18,7 +18,7 @@
<tbody>
<% @exception_logs.each do |exception_log| %>
<tr>
<td><%= exception_log.created_at.strftime("%b %d, %Y %l:%M %p") %></td>
<td><%= compact_time exception_log.created_at %></td>
<td><%= exception_log.code %></td>
<td><%= link_to exception_log.version, GitHelper.commit_url(exception_log.version) %></td>
<td><%= exception_log.extra_params.dig("params", "controller") %>/<%= exception_log.extra_params.dig("params", "action") %></td>

View File

@ -5,7 +5,7 @@
<br>
<div>
Error Code: <%= @exception_log.code %><br/>
Created At: <%= @exception_log.created_at.strftime("%b %d, %Y %l:%M %p") %><br/>
Created At: <%= compact_time @exception_log.created_at %><br/>
Commit: <%= @exception_log.version %><br/>
IP Address: <%= link_to_ip @exception_log.ip_addr %><br/>
User: <%= link_to_user @exception_log.user %>

View File

@ -22,7 +22,7 @@
<tr id="edit-<%= edit.id %>">
<td><%= link_to "Show", action: "show", id: edit.versionable_id, type: edit.versionable_type %></td>
<td><%= edit.versionable_type %></td>
<td><%= edit.updated_at.strftime("%b %d, %Y %I:%M %p") %></td>
<td><%= compact_time edit.updated_at %></td>
<% if CurrentUser.is_admin? %>
<td><%= link_to_ip edit.ip_addr %></td>
<% end %>

View File

@ -7,7 +7,7 @@
<div class="edit-item box-section">
<div class="author">
<h6><%= link_to_user edit.user %></h6>
<span class="date" title="<%= time_ago_in_words(edit.created_at) + " ago" %>"><%= edit.created_at.strftime("%b %d, %Y %I:%M %p") %></span>
<%= compact_time edit.created_at %>
<% if CurrentUser.is_admin? %>
<div><%= link_to_ip edit.ip_addr %></div>
<% end %>

View File

@ -2,7 +2,7 @@
<div class="ui-state-highlight site-notice" style="display: none;" id="news" data-id="<%= news_update.id %>">
<div id="news-closebutton" class="closebutton">Dismiss</div>
<h6>News - <%= news_update.created_at.strftime("%b %d, %Y") %>
(<%= time_ago_in_words news_update.created_at %> ago)
(<%= time_ago_in_words_tagged news_update.created_at %>)
<span id="news-showtext" class="showtext">Click to show.</span>
</h6>
<div class="newsbody dtext-container"><%= format_text(news_update.message) %></div>

View File

@ -17,7 +17,7 @@
<tr id="blacklisted-domain-<%= report_reason.id %>">
<td><%= link_to "Delete", post_report_reason_path(report_reason), method: :delete, data: {confirm: "Do you really want to delete this reason?"} %></td>
<td><%= link_to_user report_reason.creator %></td>
<td><%= report_reason.updated_at.strftime("%b %d, %Y %I:%M %p") %></td>
<td><%= compact_time report_reason.updated_at %></td>
<td><%= link_to(report_reason.reason, edit_post_report_reason_path(report_reason)) %></td>
</tr>
<% end %>

View File

@ -14,14 +14,12 @@
<div class='set-status set-status-maintainer' title='You are a maintainer of this set and can add and remove posts'>Maint.</div>
<% end %>
</div>
<div class="set-shortname">Short
Name: <%= link_to @post_set.shortname, posts_path(tags: "set:#{@post_set.shortname}") %></div>
Created:
<span class="date" title="<%= @post_set.created_at.strftime("%b %d, %Y %I:%M %p") %>"><%= time_ago_in_words(@post_set.created_at) + " ago" %></span>
|
Updated:
<span class="date" title="<%= @post_set.updated_at.strftime("%b %d, %Y %I:%M %p") %>"><%= time_ago_in_words(@post_set.updated_at) + " ago" %></span><br/><br/>
<div class="set-shortname">
Short Name: <%= link_to @post_set.shortname, posts_path(tags: "set:#{@post_set.shortname}") %>
</div>
Created: <%= time_ago_in_words_tagged(@post_set.created_at) %> |
Updated: <%= time_ago_in_words_tagged(@post_set.updated_at) %>
<br/><br/>
<% if @post_set.description.blank? %>
<div class='set-description'>No description.</div>
<% else %>

View File

@ -76,13 +76,13 @@
<tr>
<td><label>Created</label></td>
<td style="cursor:help;" title="<%= @takedown.created_at.strftime("%b %d, %Y %I:%M %p") %>"><%= time_ago_in_words(@takedown.created_at) %> ago</td>
<td><%= time_ago_in_words_tagged(@takedown.created_at) %></td>
</tr>
<% if @takedown.created_at != @takedown.updated_at %>
<tr>
<td><label>Handled</label></td>
<td style="cursor:help;" title="<%= @takedown.updated_at.strftime("%b %d, %Y %I:%M %p") %>"><%= time_ago_in_words(@takedown.updated_at) %> ago</td>
<td><%= time_ago_in_words_tagged(@takedown.updated_at) %></td>
</tr>
<% end %>

View File

@ -1,7 +1,7 @@
<% @blip = @ticket.content %>
<h4>You are reporting the following blip:</h4>
<div class="author"><%= link_to_user(@blip.creator) %></div>
<span class="date" title="Posted on <%= @blip.created_at.strftime("%b %d, %Y %I:%M %p") %>"><%= time_ago_in_words(@blip.created_at) %> ago</span>
<span class="date"><%= time_ago_in_words_tagged(@blip.created_at) %></span>
<br><br>
<div class="dtext-container">
<%= format_text(@blip.body) %>

View File

@ -1,7 +1,7 @@
<% @comment = @ticket.content %>
<h4>You are reporting the following comment:</h4>
<div class="author"><%= link_to_user @comment.creator %></div>
<span class="date" title="Posted on <%= @comment.created_at.strftime("%b %d, %Y %I:%M %p") %>"><%= time_ago_in_words(@comment.created_at) %> ago</span>
<span class="date"><%= time_ago_in_words_tagged(@comment.created_at) %></span>
<br><br>
<div class="dtext-container">
<%= format_text(@comment.body) %>

View File

@ -1,8 +1,7 @@
<% @dmail = @ticket.content %>
<h4>You are reporting the following private message:</h4>
<div class='author'><%= link_to_user @dmail.from %></div>
<span class="date" title="Sent on <%= @dmail.created_at.strftime("%b %d, %Y %I:%M %p") %>"><%= time_ago_in_words(@dmail.created_at) %>
ago</span>
<span class="date"><%= time_ago_in_words_tagged(@dmail.created_at) %></span>
<br><br>
<div class="dtext-container">
<%= format_text(@dmail.body) %>

View File

@ -1,7 +1,7 @@
<% @forum = @ticket.content %>
<h4>You are reporting the following forum post:</h4>
<div class='author'><%= link_to_user(@forum.creator) %></div>
<span class="date" title="Posted on <%= @forum.created_at.strftime("%b %d, %Y %I:%M %p") %>"><%= time_ago_in_words(@forum.created_at) %> ago</span>
<span class="date"><%= time_ago_in_words_tagged(@forum.created_at) %></span>
<br><br>
<div class="dtext-container">
<%= format_text(@forum.body) %>

View File

@ -2,6 +2,4 @@
<h4>You are reporting the following pool:</h4>
<div class='page'><%= link_to(@pool.name, pool_path(@pool)) %></div>
<div class='author'><%= link_to_user(@pool.creator) %></div>
<span class="date" title="Created on <%= @pool.created_at.strftime("%b %d, %Y %I:%M %p") %>">
<%= time_ago_in_words(@pool.created_at) %> ago
</span>
<span class="date"><%= time_ago_in_words_tagged(@pool.created_at) %></span>

View File

@ -2,4 +2,4 @@
<h4>You are reporting the following set:</h4>
<div class='page'><%= link_to(@set.name, post_set_path(@set)) %></div>
<div class='author'><%= link_to_user(@set.creator) %></div>
<span class="date" title="Created on <%= @set.created_at.strftime("%b %d, %Y %I:%M %p") %>"><%= time_ago_in_words(@set.created_at) %> ago</span>
<span class="date"><%= time_ago_in_words_tagged(@set.created_at) %></span>

View File

@ -1,7 +1,7 @@
<% @wiki = @ticket.content %>
<h4>You are reporting the following wiki page:</h4>
<div class='page'><%= link_to_wiki @wiki.title %></div>
<span class="date" title="Posted on <%= @wiki.created_at.strftime("%b %d, %Y %I:%M %p") %>"><%= time_ago_in_words(@wiki.created_at) %> ago</span>
<span class="date"><%= time_ago_in_words_tagged(@wiki.created_at) %></span>
<br><br>
<div class="dtext-container">
<%= format_text(@wiki.body) %>

View File

@ -41,16 +41,16 @@
<td><%= link_to_user vote.send(type.model_type).send(type.model_creator_column) %></td>
<td><%= link_to_user vote.user %></td>
<% if CurrentUser.is_admin? %>
<td><%= vote.user.email %>
<td><%= vote.user.email %></td>
<% end %>
<td title="Signed up at <%= vote.user.created_at.strftime("%c") %>"><%= time_ago_in_words(vote.user.created_at) %> ago
<td><%= time_ago_in_words_tagged(vote.user.created_at) %></td>
<td>
<% if vote.is_positive? %><span class='greentext'>Up</span>
<% elsif vote.is_locked? %><span class='yellowtext'>Locked</span>
<% else %><span class='redtext'>Down</span>
<% end %></td>
<td title="Created at <%= vote.created_at.strftime("%c") %>"><%= time_ago_in_words(vote.created_at) %> ago
<% end %>
</td>
<td><%= time_ago_in_words_tagged(vote.created_at) %></td>
<% if CurrentUser.is_admin? %>
<td><%= link_to_ip vote.user_ip_addr %></td>
<% end %>

View File

@ -18,7 +18,7 @@
<% @wiki_pages.each do |wiki_page| %>
<tr>
<td class="category-<%= wiki_page.category_id %>"><%= link_to wiki_page.pretty_title, wiki_page_path(wiki_page) %></td>
<td><%= wiki_page.updated_at.strftime("%Y-%m-%d %H:%M") %> by <%= h link_to_user wiki_page.updater %></td>
<td><%= compact_time wiki_page.updated_at %> by <%= link_to_user wiki_page.updater %></td>
<td><%= link_to "History", wiki_page_versions_path(search: { wiki_page_id: wiki_page.id }) %></td>
</tr>
<% end %>