Files
growstuff/app/views/posts/index.html.haml
Brenda Wallace 1d98668ac4 scss lint
2019-06-26 16:21:59 +12:00

58 lines
2.0 KiB
Plaintext

- content_for :title, @author ? t('.title.author_posts', author: @author) : t('.title.default')
- content_for :breadcrumbs do
- if @author.present?
%li.breadcrumb-item= link_to @author, @author
%li.breadcrumb-item.active= link_to 'posts', posts_path(author: @author.slug)
%h1= @author ? t('.title.author_posts', author: @author) : t('.title.default')
.pagination= render 'layouts/pagination', collection: @posts
.row
.card-deck
- @posts.each do |post|
.col-12.col-md-6
.card.post
.card-body
.row
.col-2.text-right
= render 'members/avatar', member: post.author
.col-10.border-left
%h5.card-title
= link_to strip_tags(post.subject), post
- if post.comments.size.positive?
%span.badge.badge-pill.badge-info.float-right
= icon 'fas', 'comment'
= post.comments.size
%p.text-muted
Posted by
- if post.author
= link_to post.author.login_name, member_path(post.author)
- else
Member Deleted
- if post.forum
in #{link_to post.forum, post.forum}
on #{post.created_at}"
- if post.updated_at > post.created_at
and edited at #{post.updated_at}
.card-text
.post-body= display_post_truncated(post)
- post.crops.each do |crop|
%span.badge.badge-pill.badge-primary= link_to crop, crop
.pagination= render 'layouts/pagination', collection: @posts
%p
- if @author
Subscribe to
= succeed "." do
= link_to "#{@author}'s posts RSS feed", member_posts_path(@author, format: 'rss')
- else
Subscribe to the #{ENV['GROWSTUFF_SITE_NAME']}
= link_to "posts RSS feed", posts_path(format: 'rss')
or
= succeed "." do
= link_to "comments RSS feed", comments_path(format: 'rss')