From 5e7a9de8f012959c1ebd6ef81896bac4c0c94957 Mon Sep 17 00:00:00 2001 From: Bob Lail Date: Sat, 10 Sep 2011 16:01:45 -0500 Subject: [PATCH] beautify the backtrace: --- app/views/notices/_backtrace.html.haml | 25 ++++++++++--------------- public/stylesheets/application.css | 30 ++++++++++++------------------ 2 files changed, 22 insertions(+), 33 deletions(-) diff --git a/app/views/notices/_backtrace.html.haml b/app/views/notices/_backtrace.html.haml index 2f8662d..e6b431a 100644 --- a/app/views/notices/_backtrace.html.haml +++ b/app/views/notices/_backtrace.html.haml @@ -1,17 +1,12 @@ .window %table.backtrace - %tr - %th - %ul.line-numbers - - lines.each do |line| - %li= (@app.github_url? && Notice.in_app_backtrace_line?(line)) ? link_to_github(@app, line, line['number']) : line['number'] - - %td - %ul.lines - - lines.each do |line| - - in_app = line['file'].to_s.gsub!('[PROJECT_ROOT]','') && !line['file'].to_s.match(/^\/vendor\//) - %li{:class => (in_app ? 'in-app' : nil)} - = line['file'] - → - %strong= line['method'] - + - lines.each do |line| + - in_app = line['file'].gsub!('[PROJECT_ROOT]','') && !line['file'].match(/^\/vendor\//) + - path = File.dirname(line['file']) + '/' + - file = File.basename(line['file']) + %tr{:class => (in_app ? 'in-app' : nil)} + %td.line + %span.path>= path + %span.file= "#{file}:#{line['number']}" + → + %span.method= line['method'] diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 44e3665..6bc0450 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -661,27 +661,18 @@ table.deploys td.when { .window table { margin: 0; } - -table.backtrace td { - width: 100%; - padding: 0; - margin: 0; - color: #A2A2A2; +table.backtrace td.line { + color: #777; /* 47% */ background-color: #222 !important; + border: none; + padding: 1px 8px; } -table.backtrace ul.line-numbers li { - text-align: right; -} -table.backtrace ul.lines { - padding: 10px 8px; - overflow: auto; -} -table.backtrace li { - white-space: nowrap; +table.backtrace td.line .file { + color:#d2d2d2; /* 82% */ } -table.backtrace li.in-app { - color: #2adb2e; - background-color: #2f2f2f; +table.backtrace td.line .method { + color:#ececec; /* 93% */ + font-weight:bold; } span.click_span { @@ -717,3 +708,6 @@ table.comment tbody td { margin-top: 15px; } +table.backtrace tr.in-app td.line { color:#156E16; /* 43% */} +table.backtrace tr.in-app td.line .file { color:#25C227; /* 76% */} +table.backtrace tr.in-app td.line .method { color:#2adb2e; /* 86% */} -- libgit2 0.21.2