Files
growstuff/app/views/posts/index.html.haml
2019-01-06 08:45:42 +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', member_posts_path(current_member), 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", 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')