Files
growstuff/app/views/posts/index.html.haml

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' }
%div.pagination
= page_entries_info @posts, :model => "posts"
= will_paginate @posts
- unless @posts.empty?
- @posts.each do |post|
= render :partial => "single", :locals => { :post => post, :subject => true }
%div.pagination
= page_entries_info @posts, :model => "posts"
= will_paginate @posts
%p
- if @author
Subscribe to
= succeed "." do
= link_to "#{@author}'s posts RSS feed", posts_path(: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')