From f8819012b810b31693ac6bb4dc9528b89d9f13fd Mon Sep 17 00:00:00 2001 From: AntonioTerceiro Date: Sat, 1 Mar 2008 20:18:09 +0000 Subject: [PATCH] ActionItem166: fixing crash with unanthenticated comments --- app/views/content_viewer/_comment.rhtml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/app/views/content_viewer/_comment.rhtml b/app/views/content_viewer/_comment.rhtml index 5827f61..8e8aee3 100644 --- a/app/views/content_viewer/_comment.rhtml +++ b/app/views/content_viewer/_comment.rhtml @@ -1,14 +1,17 @@ -
- <%= link_to content_tag( 'span', comment.author.name() ), comment.author.url, - :class => 'comment-picture', - :style => 'background-image:url(%s)' % profile_icon(comment.author, :minor) %> +
+ <% if comment.author %> + <%= link_to content_tag( 'span', comment.author.name() ), comment.author.url, + :class => 'comment-picture', + :style => 'background-image:url(%s)' % profile_icon(comment.author, :minor) %> + <% else %> + <%# unauthenticated user: display default icon %> + <%= content_tag('span', ' ', :class => 'comment-picture', :style => 'background-image: url(/images/icons-app/user_icon_size-minor.png)' )%> + <% end %> +

<%= comment.title %>

<%= _('By %{author} on %{date}') % { - :author => link_to( - (comment.author ? comment.author.identifier : comment.name), - comment.author.url), + :author => comment.author ? link_to(comment.author.name, comment.author.url) : content_tag('u', comment.name), :date => show_time(comment.created_on) } %>
-- libgit2 0.21.2