Commit f1f109f744b9c4005907cbe290629bc61bf638c8

Authored by Nathan Broadbent
2 parents f8a6f506 0113e7f8
Exists in master and in 1 other branch production

Merge pull request #280 from cjc343/issue_252_2

Ensure user exists when displaying comments for a problem
app/assets/stylesheets/errbit.css
... ... @@ -847,9 +847,11 @@ table.comment th span, table.comment th img {
847 847 }
848 848 table.comment th span.comment-info {
849 849 line-height: 21px;
  850 + float: left;
850 851 }
851 852 table.comment img.gravatar {
852 853 margin-right: 7px;
  854 + float: left;
853 855 }
854 856  
855 857 table.comment tbody td {
... ...
app/views/problems/show.html.haml
... ... @@ -28,12 +28,17 @@
28 28 %table.comment
29 29 %tr
30 30 %th
31   - - if Errbit::Config.use_gravatar
32   - = gravatar_tag comment.user.email, :s => 24
33   - %span.comment-info
34   - = time_ago_in_words(comment.created_at, true) << " ago by "
35   - = link_to comment.user.email, user_path(comment.user)
36   - %span.delete= link_to '&#10008;'.html_safe, app_problem_comment_path(@app, @problem, comment), :method => :delete, :data => { :confirm => "Are sure you don't need this comment?" }, :class => "destroy-comment"
  31 + - if comment.user
  32 + - if Errbit::Config.use_gravatar
  33 + = gravatar_tag comment.user.email, :s => 24
  34 + %span.comment-info
  35 + = time_ago_in_words(comment.created_at, true) << " ago by "
  36 + = link_to comment.user.email, user_path(comment.user)
  37 + %span.delete= link_to '&#10008;'.html_safe, app_problem_comment_path(@app, @problem, comment), :method => :delete, :data => { :confirm => "Are sure you don't need this comment?" }, :class => "destroy-comment"
  38 + - else
  39 + %span.comment-info
  40 + = time_ago_in_words(comment.created_at, true) << " ago by [Unknown User]"
  41 + %span.delete= link_to '&#10008;'.html_safe, app_problem_comment_path(@app, @problem, comment), :method => :delete, :data => { :confirm => "Are sure you don't need this comment?" }, :class => "destroy-comment"
37 42 %tr
38 43 %td= comment.body.gsub("\n", "<br>").html_safe
39 44 - if Errbit::Config.allow_comments_with_issue_tracker || !@app.issue_tracker_configured?
... ...