Commit f1f109f744b9c4005907cbe290629bc61bf638c8
Exists in
master
and in
1 other branch
Merge pull request #280 from cjc343/issue_252_2
Ensure user exists when displaying comments for a problem
Showing
2 changed files
with
13 additions
and
6 deletions
Show diff stats
app/assets/stylesheets/errbit.css
@@ -847,9 +847,11 @@ table.comment th span, table.comment th img { | @@ -847,9 +847,11 @@ table.comment th span, table.comment th img { | ||
847 | } | 847 | } |
848 | table.comment th span.comment-info { | 848 | table.comment th span.comment-info { |
849 | line-height: 21px; | 849 | line-height: 21px; |
850 | + float: left; | ||
850 | } | 851 | } |
851 | table.comment img.gravatar { | 852 | table.comment img.gravatar { |
852 | margin-right: 7px; | 853 | margin-right: 7px; |
854 | + float: left; | ||
853 | } | 855 | } |
854 | 856 | ||
855 | table.comment tbody td { | 857 | table.comment tbody td { |
app/views/problems/show.html.haml
@@ -28,12 +28,17 @@ | @@ -28,12 +28,17 @@ | ||
28 | %table.comment | 28 | %table.comment |
29 | %tr | 29 | %tr |
30 | %th | 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 | %tr | 42 | %tr |
38 | %td= comment.body.gsub("\n", "<br>").html_safe | 43 | %td= comment.body.gsub("\n", "<br>").html_safe |
39 | - if Errbit::Config.allow_comments_with_issue_tracker || !@app.issue_tracker_configured? | 44 | - if Errbit::Config.allow_comments_with_issue_tracker || !@app.issue_tracker_configured? |