Files
growstuff/app/views/posts/index.html.haml
2017-02-08 07:25:59 +13:00

41 lines
1.3 KiB
Plaintext

- content_for :title, @author ? t('.title.author_posts', author: @author) : t('.title.default')
%p
- if can? :create, Post
- if @author
%p
- if @author == current_member
= link_to 'Post something', new_post_path, class: 'btn btn-primary'
= link_to "View everyone's posts", posts_path, class: 'btn btn-default'
- else # everyone's posts
= link_to 'Post something', new_post_path, class: 'btn btn-primary'
- if current_member
= link_to 'View your posts', posts_by_author_path(author: current_member.slug), class: 'btn btn-default'
- else
= render partial: 'shared/signin_signup', locals: { to: 'write a post' }
.pagination
= page_entries_info @posts
= will_paginate @posts
- unless @posts.empty?
- @posts.each do |post|
= render partial: "single", locals: { post: post, subject: true }
.pagination
= page_entries_info @posts
= will_paginate @posts
%p
- if @author
Subscribe to
= succeed "." do
= link_to "#{@author}'s posts RSS feed", posts_by_author_path(format: 'rss', author: @author)
- 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')