From c5726bb3793086ee0504777a3f3fc5680d1e8abb Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Thu, 11 Aug 2011 15:49:54 -0700 Subject: [PATCH] Don't show a hide post button to non-logged in users --- app/views/posts/show.mobile.haml | 9 +++++---- app/views/shared/_stream_element.html.haml | 1 - 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/views/posts/show.mobile.haml b/app/views/posts/show.mobile.haml index e5107893b..af3a960a1 100644 --- a/app/views/posts/show.mobile.haml +++ b/app/views/posts/show.mobile.haml @@ -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 diff --git a/app/views/shared/_stream_element.html.haml b/app/views/shared/_stream_element.html.haml index a33a26908..2fd74b23c 100644 --- a/app/views/shared/_stream_element.html.haml +++ b/app/views/shared/_stream_element.html.haml @@ -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')