Commit ad0670af7bbae8141696611ebcbf09348e87a955

Authored by Nathan Broadbent
1 parent 76fc7a93
Exists in master and in 1 other branch production

Made the whole file:line_number into a link for backtrace, & tweaked colors. [ci skip]

app/helpers/notices_helper.rb
@@ -4,15 +4,15 @@ module NoticesHelper @@ -4,15 +4,15 @@ module NoticesHelper
4 render :partial => "notices/atom_entry.html.haml", :locals => {:notice => notice} 4 render :partial => "notices/atom_entry.html.haml", :locals => {:notice => notice}
5 end 5 end
6 6
7 - def line_number_with_link(app, line) 7 + def link_to_source_file(app, line, text)
8 if Notice.in_app_backtrace_line?(line) 8 if Notice.in_app_backtrace_line?(line)
9 - return link_to_github(app, line, line['number']) if app.github_url? 9 + return link_to_github(app, line, text) if app.github_url?
10 if app.issue_tracker && app.issue_tracker.respond_to?(:url_to_file) 10 if app.issue_tracker && app.issue_tracker.respond_to?(:url_to_file)
11 # Return link to file on tracker if issue tracker supports this 11 # Return link to file on tracker if issue tracker supports this
12 - return link_to_issue_tracker_file(app, line, line['number']) 12 + return link_to_issue_tracker_file(app, line, text)
13 end 13 end
14 end 14 end
15 - line['number'] 15 + text
16 end 16 end
17 17
18 def filepath_parts(file) 18 def filepath_parts(file)
app/views/notices/_backtrace.html.haml
@@ -4,10 +4,11 @@ @@ -4,10 +4,11 @@
4 - path = File.dirname(line['file']) 4 - path = File.dirname(line['file'])
5 - path = path == "." ? "" : path + '/' 5 - path = path == "." ? "" : path + '/'
6 - file = File.basename(line['file']) 6 - file = File.basename(line['file'])
  7 + - file = "#{file}:#{line['number']}" unless line['number'].blank?
7 %tr 8 %tr
8 %td.line{:class => (Notice.in_app_backtrace_line?(line) ? 'in-app' : nil)} 9 %td.line{:class => (Notice.in_app_backtrace_line?(line) ? 'in-app' : nil)}
9 %span.path>= path 10 %span.path>= path
10 - %span.file= line['number'].blank? ? file : ("#{file}:" + line_number_with_link(@app, line).to_s).html_safe 11 + %span.file= link_to_source_file(@app, line, file).html_safe
11 → 12 →
12 %span.method= line['method'] 13 %span.method= line['method']
13 14
public/stylesheets/application.css
@@ -733,8 +733,9 @@ table.backtrace td.line.in-app { @@ -733,8 +733,9 @@ table.backtrace td.line.in-app {
733 color: #2adb2e; 733 color: #2adb2e;
734 background-color: #2f2f2f; 734 background-color: #2f2f2f;
735 } 735 }
736 -table.backtrace td.line.in-app span.file { color:#2AEB2E; }  
737 -table.backtrace td.line.in-app span.method { color:#2ACB2E; } 736 +table.backtrace td.line.in-app .file { color:#2AEB2E; }
  737 +table.backtrace td.line.in_app .file a { color:#21A4FF; }
  738 +table.backtrace td.line.in-app .method { color:#2ACB2E; }
738 739
739 740
740 /* Extra empty rows at top and bottom of table */ 741 /* Extra empty rows at top and bottom of table */
@@ -745,7 +746,6 @@ table.backtrace tr.padding th, table.backtrace tr.padding td { @@ -745,7 +746,6 @@ table.backtrace tr.padding th, table.backtrace tr.padding td {
745 } 746 }
746 747
747 748
748 -  
749 span.click_span { 749 span.click_span {
750 font-size: 0.7em; 750 font-size: 0.7em;
751 } 751 }