use time helper for ago.js

This commit is contained in:
jomo
2014-10-12 22:28:12 +02:00
parent e9eef188d6
commit b574ea3e9e
9 changed files with 42 additions and 12 deletions

View File

@@ -4,14 +4,17 @@
<div class="item-group thread with-avatar" id="thread-<%= @thread.id %>">
<div class="header">
<%= link_to(@thread.author.avatar(64), @thread.author, title: @thread.author.ign) %>
<%= render partial: "users/username", locals: { user: @thread.author } %> <%= link_to p do %><time title="<%= @thread.created_at.strftime("%e %b %Y, %H:%M") %>" datetime="<%= @thread.created_at.to_datetime.rfc3339 %>"><%= @thread.created_at.strftime("%e %b %Y, %H:%M") %></time><% end %>
<%= render partial: "users/username", locals: { user: @thread.author } %>
<%= link_to p do %>
<%= time @thread.created_at %>
<% end %>
<%= link_to "edit", edit_forumthread_path( @thread), class: "editlink" if (@thread.author.is?(current_user) || mod?) %>
<div class="clear-right"></div>
</div>
<div class="items">
<% if @thread.edited? %>
<div class="item edited">
Last edited <time title="<%= @thread.updated_at.strftime("%e %b %Y, %H:%M") %>" datetime="<%= @thread.updated_at.to_datetime.rfc3339 %>"><%= @thread.updated_at.strftime("%e %b %Y, %H:%M") %></time> by <%= link_to @thread.editor.name, @thread.editor %>.
Last edited <%= time @thread.updated_at %> by <%= link_to @thread.editor.name, @thread.editor %>.
</div>
<% end %>
<div class="item content">