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

17 lines
680 B
Text
Raw Normal View History

2015-08-06 16:31:08 -04:00
- content_for(:title) { link_to @subcreddit.name, @subcreddit }
- 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-08-06 15:10:31 -04:00
p.details
= "submitted #{distance_of_time_in_words post.created_at, Time.now} ago by "
== link_to post.user_username, post.user
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', ''