mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-05-13 18:55:45 -04:00
28 lines
974 B
Plaintext
28 lines
974 B
Plaintext
- content_for :title, @author ? "#{@author}'s posts" : "Everyone's posts"
|
|
|
|
%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'
|
|
- 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'
|
|
- 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
|