Skip to content
Browse files

Fix viewing messages and comments without creator (created_by is nil)

  • Loading branch information...
1 parent 968d9ac commit b28c34c307a34f67b27b5e50fb81f224c28d6a59 scambra committed with jamesu Feb 10, 2010
View
4 app/views/comments/_object_comments.html.erb
@@ -24,10 +24,12 @@
<% if @logged_user.is_admin %>
(<span class="commentAddress"><%= h(comment.author_homepage) %></span>)
<% end %>
- <% else %>
+ <% elsif not comment.created_by.nil? %>
<%= :comment_posted_with_user.l_with_args(
:time => format_usertime(comment.created_on, :comment_posted_format),
:user => "<a href=\"#{comment.created_by.object_url}\">#{h(comment.created_by.display_name)}</a>") %>
+ <% else %>
+ <%= format_usertime(comment.created_on, :comment_posted_format) %>
<% end %>
:</div>
View
2 app/views/messages/_show.html.erb
@@ -10,6 +10,8 @@
<div class="messageAuthor"><%= :message_created_with_user.l_with_args(
:time => format_usertime(message.created_on, :message_created_format),
:user => link_to( h(message.created_by.display_name), user_path(:id => message.created_by.id))) %></div>
+<% else %>
+ <div class="messageAuthor"><%= format_usertime(message.created_on, :message_created_format) %></div>
<% end %>
<div class="messageText">
<%= textilize message.text %>
View
2 app/views/messages/_show_list.html.erb
@@ -32,6 +32,8 @@
<div class="messageAuthor"><%= :message_created_with_user.l_with_args(
:time => format_usertime(message.created_on, :message_created_format),
:user => link_to( h(message.created_by.display_name), user_path(:id => message.created_by.id))) %></div>
+<% else %>
+ <div class="messageAuthor"><%= format_usertime(message.created_on, :message_created_format) %></div>
<% end %>
</div>
<div class="clear"></div>
View
4 app/views/messages/show.html.erb
@@ -1,14 +1,14 @@
<div class="message">
<div class="messageDetails">
- <div class="messageUserAvatar" style="float:right"><img src="<%= @message.created_by.avatar_url %>" alt="<%= h @message.created_by.display_name %> Avatar" /></div>
<% if not @message.created_by.nil? %>
+ <div class="messageUserAvatar" style="float:right"><img src="<%= @message.created_by.avatar_url %>" alt="<%= h @message.created_by.display_name %> Avatar" /></div>
<div class="messageAuthor"><span><%= :from.l %>:</span> <%= link_to( h(@message.created_by.display_name), user_path(:id => @message.created_by.id)) %></div>
+<% end %>
<div class="messageDate"><span><%= :log_date.l %>:</span> <%= format_usertime(@message.created_on, :message_created_format) %></div>
<% unless @message.project_milestone.nil? %>
<div class="messageMilestone"><span><%= :milestone.l %>:</span> <%= link_to h(@message.project_milestone.object_name), @message.project_milestone.object_url %></div>
<% end %>
<div class="messageTags"><span><%= :tags.l %>:</span> <%= @message.tags %></div>
-<% end %>
</div>
<div class="messageText">
<%= textilize @message.text %>

0 comments on commit b28c34c

Please sign in to comment.
Something went wrong with that request. Please try again.