Commit 20e4cd357611008d838676c832794a22f6f3239d

Authored by Nathan Broadbent
1 parent 8608f10b
Exists in master and in 1 other branch production

Show the last, truncated comment inline on the errs table view. (Does nothing if…

… no comments on err.)
app/views/errs/_table.html.haml
@@ -22,6 +22,12 @@ @@ -22,6 +22,12 @@
22 %td.message 22 %td.message
23 = link_to err.message, app_err_path(err.app, err) 23 = link_to err.message, app_err_path(err.app, err)
24 %em= err.where 24 %em= err.where
  25 + - if err.comments.any?
  26 + - comment = err.comments.last
  27 + %br
  28 + .inline_comment
  29 + %em.commenter= (Errbit::Config.user_has_username ? comment.user.username : comment.user.email).to_s << ":"
  30 + %em= truncate(comment.body, :length => 100, :separator => ' ')
25 %td.latest #{time_ago_in_words(last_notice_at err)} ago 31 %td.latest #{time_ago_in_words(last_notice_at err)} ago
26 %td.deploy= err.app.last_deploy_at ? err.app.last_deploy_at.to_s(:micro) : 'n/a' 32 %td.deploy= err.app.last_deploy_at ? err.app.last_deploy_at.to_s(:micro) : 'n/a'
27 %td.count= link_to err.notices_count, app_err_path(err.app, err) 33 %td.count= link_to err.notices_count, app_err_path(err.app, err)
public/stylesheets/application.css
@@ -628,6 +628,7 @@ table.errs td.message em { @@ -628,6 +628,7 @@ table.errs td.message em {
628 color: #727272; 628 color: #727272;
629 font-size: 0.9em; 629 font-size: 0.9em;
630 } 630 }
  631 +
631 table.errs tr.resolved td > * { 632 table.errs tr.resolved td > * {
632 opacity: 0.5; 633 opacity: 0.5;
633 -moz-opacity: 0.5; 634 -moz-opacity: 0.5;
@@ -736,4 +737,20 @@ table.comment tbody td { @@ -736,4 +737,20 @@ table.comment tbody td {
736 #content-comments #comment_submit { 737 #content-comments #comment_submit {
737 margin-top: 15px; 738 margin-top: 15px;
738 } 739 }
  740 +/* Inline comments in tables */
  741 +table.errs tr td.message .inline_comment {
  742 + display: inline-block;
  743 + padding: 3px 7px;
  744 + margin: 6px 0;
  745 + background-color: #F5F5F5;
  746 + border: 1px solid #E6E6E6;
  747 +}
  748 +table.errs tr:hover td.message .inline_comment {
  749 + background-color: #EEEEEE;
  750 + border-color: #DFDFDF;
  751 +}
  752 +
  753 +table.errs tr td.message .inline_comment em.commenter {
  754 + color: #999999;
  755 +}
739 756