tilde.news/app/views/stories/_similar.html.erb

24 lines
760 B
Plaintext

<ol>
<% similar.each do |story| %>
<li>
<a href="<%= story.url %>" target="_blank"><%= story.title %></a>
<%= story.user_is_author? ? "authored by" : "via" %>
<%= styled_user_link story.user, story %>
<%= time_ago_in_words_label(story.created_at) %>
<span>
|
<%= story.show_score_to_user?(@user) ? "#{story.score} point".pluralize(story.score) : '~' %>
</span>
<span class="comments_label">
|
<a href="<%= story.comments_path %>">
<% if story.comments_count == 0 %>
no comments</a>
<% else %>
<%= story.comments_count %> <%= 'comment'.pluralize(story.comments_count) %></a>
<% end %>
</span>
</li>
<% end %>
</ol>