Don't show a hide post button to non-logged in users

This commit is contained in:
Raphael Sofaer 2011-08-11 15:49:54 -07:00
parent 0981f04c77
commit c5726bb379
2 changed files with 5 additions and 5 deletions

View file

@ -21,10 +21,11 @@
= t('ago', :time => time_ago_in_words(@post.created_at))
%br
- if current_user.owns? @post
= link_to t('delete'), post_path(@post), :confirm => t('are_you_sure'), :method => :delete
- else
= link_to t('hide'), post_visibility_path(:id => "42", :post_id => @post.id), :confirm => t('are_you_sure'), :method => :put, :remote => true
- if user_signed_in?
- if current_user.owns? @post
= link_to t('delete'), post_path(@post), :confirm => t('are_you_sure'), :method => :delete
- else
= link_to t('hide'), post_visibility_path(:id => "42", :post_id => @post.id), :confirm => t('are_you_sure'), :method => :put, :remote => true
.stream.show{:data=>{:guid=>@post.id}}
= render "comments/comments", :post => @post, :comments => @post.comments, :comments_expanded => true

View file

@ -7,7 +7,6 @@
- if post.author.owner_id == current_user.id
.right.controls
= link_to image_tag('deletelabel.png'), post_path(post), :confirm => t('are_you_sure'), :method => :delete, :remote => true, :class => "delete stream_element_delete", :title => t('delete')
- else
.right.controls
= link_to image_tag('deletelabel.png'), post_visibility_path(:id => "42", :post_id => post.id), :method => :put, :remote => true, :class => "delete stream_element_delete", :title => t('hide')