<% if @this_user %>
<% if @user == @this_user %>
<%= link_to 'New diary post', :controller => 'diary_entry', :action => 'new', :display_name => @user.display_name %>
<% if @this_user %>
<% if @user == @this_user %>
<%= link_to 'New diary post', :controller => 'diary_entry', :action => 'new', :display_name => @user.display_name %>