creddit/app/views/subcreddits/show.html.slim

14 lines
567 B
Text
Raw Normal View History

- if @subcreddit.closed?
= "Board has been closed"
2015-07-14 16:29:22 -04:00
- else
2015-07-16 11:57:27 -04:00
.posts.contents
2015-07-15 00:26:23 -04:00
ul
- @subcreddit.posts.order('created_at DESC').each_with_index do |post, rank|
li
.post
2015-07-16 11:57:27 -04:00
p.title= link_to post.title, subcreddit_post_path(@subcreddit, post)
2015-07-20 15:12:26 -04:00
p.details= "submitted #{distance_of_time_in_words post.created_at, Time.now} ago by #{post.user_username}"
2015-07-15 00:26:23 -04:00
ul.links.list-inline
2015-07-16 11:57:27 -04:00
li= link_to "#{post.comments_count} comments", subcreddit_post_path(@subcreddit, post)
2015-07-15 00:26:23 -04:00
li= link_to 'share', ''