Commit 00f30cfe4c0fe01f9d292d223d9e1b62ad7812b7
1 parent
3456dc3d
Exists in
master
and in
1 other branch
Ensure user exists before displaying comments - rewritten to check once
Showing
1 changed file
with
11 additions
and
6 deletions
Show diff stats
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 '✘'.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 '✘'.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 '✘'.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? | ... | ... |