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

@@ -7,7 +7,10 @@
<div class="item-group with-avatar" id="post-<%= p.id %>">
<div class="header">
<%= link_to(p.author.avatar(64), p.author, title: p.author.ign) %>
<%= render partial: "users/username", locals: { user: p.author } %> <%= link_to p do %><time title="<%= p.created_at.strftime("%e %b %Y, %H:%M") %>" datetime="<%= p.created_at.to_datetime.rfc3339 %>"><%= p.created_at.strftime("%e %b %Y, %H:%M") %></time><% end %>
<%= render partial: "users/username", locals: { user: p.author } %>
<%= link_to p do %>
<%= time p.created_at %>
<% end %>
<span class="comment-counter">
<%= link_to pluralize(p.comments.count, "Comment"), p %>
</span>

View File

@@ -6,7 +6,10 @@
<div class="item-group post with-avatar" id="post-<%= @post.id %>">
<div class="header">
<%= link_to(@post.author.avatar(64), @post.author, title: @post.author.ign) %>
<%= render partial: "users/username", locals: { user: @post.author } %> <%= link_to p do %><time title="<%= @post.created_at.strftime("%e %b %Y, %H:%M") %>" datetime="<%= @post.created_at.to_datetime.rfc3339 %>"><%= @post.created_at.strftime("%e %b %Y, %H:%M") %></time><% end %>
<%= render partial: "users/username", locals: { user: @post.author } %>
<%= link_to p do %>
<%= time @post.created_at %>
<% end %>
<%= link_to "edit", edit_blogpost_path(@post.id), class: "editlink" if mod? %>
<div class="clear-right"></div>
</div>