add ubiquitous time tags
This commit is contained in:
@@ -62,6 +62,10 @@ module ApplicationHelper
|
||||
content_tag(:time, content || datetime, :datetime => datetime, :title => time.to_formatted_s)
|
||||
end
|
||||
|
||||
def time_ago_in_words_tagged(time)
|
||||
time_tag(time_ago_in_words(time) + " ago", time)
|
||||
end
|
||||
|
||||
def compact_time(time)
|
||||
if time > Time.now.end_of_day
|
||||
time_tag(time.strftime("%b %e, %Y"), time)
|
||||
|
||||
@@ -4,7 +4,7 @@ module PostAppealsHelper
|
||||
html << '<ul>'
|
||||
|
||||
post.appeals.each do |appeal|
|
||||
html << '<li>' + appeal.reason + ' - ' + link_to(appeal.creator.name, user_path(appeal.creator)) + ' ' + time_ago_in_words(appeal.created_at) + ' ago</li>'
|
||||
html << '<li>' + appeal.reason + ' - ' + link_to(appeal.creator.name, user_path(appeal.creator)) + ' ' + time_ago_in_words_tagged(appeal.created_at) + ' ago</li>'
|
||||
end
|
||||
|
||||
html << '</ul>'
|
||||
|
||||
@@ -10,7 +10,7 @@ module PostFlagsHelper
|
||||
html << ' - ' + link_to(flag.creator.name, user_path(flag.creator))
|
||||
end
|
||||
|
||||
html << ' ' + time_ago_in_words(flag.created_at) + ' ago</li>'
|
||||
html << ' ' + time_ago_in_words_tagged(flag.created_at) + ' ago</li>'
|
||||
end
|
||||
|
||||
html << '</ul>'
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<td><%= link_to h(artist_version.name), artist_versions_path(:artist_id => artist_version.artist_id) %></td>
|
||||
<td><%= h artist_version.other_names %></td>
|
||||
<td><%= h artist_version.group_name %></td>
|
||||
<td><%= time_ago_in_words artist_version.created_at %> ago</td>
|
||||
<td><%= time_ago_in_words_tagged artist_version.created_at %> ago</td>
|
||||
<td><%= link_to artist_version.updater_name, user_path(artist_version.updater_id) %></td>
|
||||
<td><%= artist_version.is_active? %></td>
|
||||
<td><%= artist_version.url_string %></td>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div class="author">
|
||||
<h1><%= link_to comment.creator_name, user_path(comment.creator_id) %></h1>
|
||||
<p>
|
||||
<%= time_ago_in_words(comment.created_at) %> ago
|
||||
<%= time_ago_in_words_tagged(comment.created_at) %> ago
|
||||
</p>
|
||||
</div>
|
||||
<div class="content">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<% end %>
|
||||
</h4>
|
||||
<p>
|
||||
<%= time_ago_in_words(forum_post.created_at) %> ago
|
||||
<%= time_ago_in_words_tagged(forum_post.created_at) %> ago
|
||||
</p>
|
||||
</div>
|
||||
<div class="content">
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<td><%= link_to forum_post.topic.title, forum_topic_path(forum_post.topic) %></td>
|
||||
<td><%= link_to truncate(forum_post.body, :length => 50), forum_post_path(forum_post) %></td>
|
||||
<td><%= forum_post.creator.name %></td>
|
||||
<td><%= time_ago_in_words forum_post.created_at %> ago</td>
|
||||
<td><%= time_ago_in_words_tagged forum_post.created_at %> ago</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<% @janitor_trials.each do |janitor_trial| %>
|
||||
<tr>
|
||||
<td><%= link_to janitor_trial.user.name, user_path(janitor_trial.user) %></td>
|
||||
<td><%= time_ago_in_words janitor_trial.created_at %></td>
|
||||
<td><%= time_ago_in_words_tagged janitor_trial.created_at %></td>
|
||||
<td>
|
||||
<%= link_to "Promote", promote_janitor_trial_path(janitor_trial), :remote => true, :method => :put %>
|
||||
| <%= link_to "Demote", demote_janitor_trial_path(janitor_trial), :remote => true, :method => :put %>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<tr class="user-record-score-<%= record.category %>">
|
||||
<td><%= link_to(record.user.name, user_path(record.user)) %></td>
|
||||
<td><%= format_text(record.body) %></td>
|
||||
<td><%= time_ago_in_words(record.created_at) %> ago</td>
|
||||
<td><%= time_ago_in_words_tagged(record.created_at) %> ago</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
(<%= post.image_width %>x<%= post.image_height %>)
|
||||
<% end %>
|
||||
</li>
|
||||
<li><strong>Uploader</strong>: <%= link_to(post.uploader.name, user_path(post.uploader_id)) %> <%= time_ago_in_words(post.created_at) %> ago</li>
|
||||
<li><strong>Uploader</strong>: <%= link_to(post.uploader.name, user_path(post.uploader_id)) %> <%= time_ago_in_words_tagged(post.created_at) %> ago</li>
|
||||
<% if post.is_flagged? %>
|
||||
<li><strong>Flagged</strong>: <%= post_flag_reasons(post) %></li>
|
||||
<% end %>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<tr>
|
||||
<td><%= link_to note.post_id, post_path(note.post_id) %></td>
|
||||
<td><%= link_to note.creator.name, user_path(note.creator_id) %></td>
|
||||
<td><%= time_ago_in_words(note.created_at) %> ago</td>
|
||||
<td><%= time_ago_in_words_tagged(note.created_at) %> ago</td>
|
||||
<td><%= note.is_active? %></td>
|
||||
<td><%= format_text(note.body) %></td>
|
||||
</tr>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<%= pool_version.updater_ip_addr %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td><%= time_ago_in_words pool_version.updated_at %></td>
|
||||
<td><%= time_ago_in_words_tagged pool_version.updated_at %></td>
|
||||
<td><%= link_to "Revert", revert_pool_path(pool_version.pool_id, :version => pool_version.id) %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<ul>
|
||||
<li>Uploader: <%= link_to_unless(post.uploader.nil?, post.uploader_name, user_path(post.uploader)) %></li>
|
||||
<li>Date: <time datetime="<%= post.created_at.iso8601 %>" title="<%= post.created_at.to_date %>"><%= time_ago_in_words(post.created_at).gsub(/about/, "") %> ago</time></li>
|
||||
<li>Date: <time datetime="<%= post.created_at.iso8601 %>" title="<%= post.created_at.to_date %>"><%= time_ago_in_words_tagged(post.created_at).gsub(/about/, "") %> ago</time></li>
|
||||
<% if post.approver %>
|
||||
<li>Approver: <%= link_to(post.approver.name, user_path(post.approver_id)) %></li>
|
||||
<% end %>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<td><%= feedback.category %></td>
|
||||
<td><%= link_to feedback.user_name, user_feedback_path(feedback.user_id) %></td>
|
||||
<td><%= feedback.creator.name %></td>
|
||||
<td><%= time_ago_in_words(feedback.created_at) %> ago</td>
|
||||
<td><%= time_ago_in_words_tagged(feedback.created_at) %> ago</td>
|
||||
<td><%= format_text(feedback.body) %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
<% end %>
|
||||
<td><%= link_to user.note_versions.count, note_versions_path(:search => {:updater_id => user.id}) %></td>
|
||||
<td><%= user.level_string %></td>
|
||||
<td><span title="<%= user.created_at %>"><%= time_ago_in_words user.created_at %> ago</span></td>
|
||||
<td><span title="<%= user.created_at %>"><%= time_ago_in_words_tagged user.created_at %> ago</span></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<%= render "wiki_pages/sidebar" %>
|
||||
|
||||
<section id="content">
|
||||
<h1 id="wiki-page-title"><%= @wiki_page_version.pretty_title %> <span class="version">(<%= time_ago_in_words(@wiki_page_version.updated_at) %> ago)</span></h1>
|
||||
<h1 id="wiki-page-title"><%= @wiki_page_version.pretty_title %> <span class="version">(<%= time_ago_in_words_tagged(@wiki_page_version.updated_at) %> ago)</span></h1>
|
||||
|
||||
<div id="wiki-page-body" class="dtext">
|
||||
<%= format_text(@wiki_page_version.body) %>
|
||||
|
||||
Reference in New Issue
Block a user