creddit/app/views/posts/_post_meta.html.slim

15 lines
657 B
Text

.posts.contents
ul
- posts.order('created_at DESC').each_with_index do |post, rank|
li
.post
p.title= link_to post.title, subcreddit_post_path(post.subcreddit, post)
p.details
= "submitted #{distance_of_time_in_words post.created_at, Time.now} ago by "
== link_to post.user_username, post.user
- if subcreddit == nil
= " to "
== link_to "/c/#{post.subcreddit_slug}", post.subcreddit
ul.links.list-inline
li= link_to "#{post.comments_count} comments", subcreddit_post_path(post.subcreddit, post)
li= link_to 'share', ''