Commit 7944485d347487b34223c1afdc65794137672a2e
1 parent
b9d5ea84
Exists in
master
and in
1 other branch
Add a tabbed for the Errs#show page
Showing
4 changed files
with
98 additions
and
23 deletions
Show diff stats
app/views/errs/show.html.haml
| 1 | -- content_for :title, @err.message | 1 | +- content_for :page_title, @err.message |
| 2 | +- content_for :title, @err.klass | ||
| 2 | - content_for :meta do | 3 | - content_for :meta do |
| 3 | %strong Where: | 4 | %strong Where: |
| 4 | = @err.where | 5 | = @err.where |
| 5 | %strong Environment: | 6 | %strong Environment: |
| 6 | - = @err.environment.titleize | ||
| 7 | - %strong Type: | ||
| 8 | - = @err.klass | 7 | + = @err.environment |
| 9 | %strong Last Notice: | 8 | %strong Last Notice: |
| 10 | = @err.last_notice_at.to_s(:micro) | 9 | = @err.last_notice_at.to_s(:micro) |
| 11 | - content_for :action_bar do | 10 | - content_for :action_bar do |
| 12 | - = will_paginate @notices, :param_name => :notice, :page_links => false | ||
| 13 | - .float-left viewing occurrence #{@notices.current_page} of #{@notices.total_pages} | ||
| 14 | - = link_to "back to '#{@app.name}'", app_path(@app) | ||
| 15 | - | | ||
| 16 | - = link_to 'resolve', resolve_app_err_path(@app, @err), :method => :put, :confirm => 'Seriously?' if @err.unresolved? | 11 | + %span= link_to 'resolve', resolve_app_err_path(@app, @err), :method => :put, :confirm => 'Seriously?', :class => 'resolve' if @err.unresolved? |
| 17 | 12 | ||
| 18 | -%h3#summary Summary | ||
| 19 | -= render 'notices/summary', :notice => @notice | 13 | +%h4= @notice.message |
| 14 | + | ||
| 15 | += will_paginate @notices, :param_name => :notice, :page_links => false | ||
| 16 | +viewing occurrence #{@notices.current_page} of #{@notices.total_pages} | ||
| 20 | 17 | ||
| 21 | -%h3#backtrace Backtrace | ||
| 22 | -= render 'notices/backtrace', :lines => @notice.backtrace | 18 | +.tab-bar |
| 19 | + %ul | ||
| 20 | + %li= link_to 'Summary', '#summary', :rel => 'summary', :class => 'button' | ||
| 21 | + %li= link_to 'Backtrace', '#backtrace', :rel => 'backtrace', :class => 'button' | ||
| 22 | + %li= link_to 'Environment', '#environment', :rel => 'environment', :class => 'button' | ||
| 23 | + %li= link_to 'Parameters', '#params', :rel => 'params', :class => 'button' | ||
| 24 | + %li= link_to 'Session', '#session', :rel => 'session', :class => 'button' | ||
| 23 | 25 | ||
| 24 | -%h3#environment Environment | ||
| 25 | -= render 'notices/environment', :notice => @notice | 26 | +#summary |
| 27 | + %h3 Summary | ||
| 28 | + = render 'notices/summary', :notice => @notice | ||
| 26 | 29 | ||
| 27 | -%h3#params Parameters | ||
| 28 | -= render 'notices/params', :notice => @notice | 30 | +#backtrace |
| 31 | + %h3 Backtrace | ||
| 32 | + = render 'notices/backtrace', :lines => @notice.backtrace | ||
| 33 | + | ||
| 34 | +#environment | ||
| 35 | + %h3 Environment | ||
| 36 | + = render 'notices/environment', :notice => @notice | ||
| 29 | 37 | ||
| 30 | -%h3#session Session | ||
| 31 | -= render 'notices/session', :notice => @notice | ||
| 32 | \ No newline at end of file | 38 | \ No newline at end of file |
| 39 | +#params | ||
| 40 | + %h3 Parameters | ||
| 41 | + = render 'notices/params', :notice => @notice | ||
| 42 | + | ||
| 43 | +#session | ||
| 44 | + %h3 Session | ||
| 45 | + = render 'notices/session', :notice => @notice | ||
| 33 | \ No newline at end of file | 46 | \ No newline at end of file |
app/views/notices/_summary.html.haml
| 1 | .window | 1 | .window |
| 2 | %table.summary | 2 | %table.summary |
| 3 | + %tr | ||
| 4 | + %th Message | ||
| 5 | + %td.main.nowrap= notice.message | ||
| 3 | - if notice.request['url'].present? | 6 | - if notice.request['url'].present? |
| 4 | %tr | 7 | %tr |
| 5 | %th URL | 8 | %th URL |
| 6 | - %td.main.nowrap= link_to notice.request['url'], notice.request['url'] | 9 | + %td.nowrap= link_to notice.request['url'], notice.request['url'] |
| 7 | %tr | 10 | %tr |
| 8 | %th Where | 11 | %th Where |
| 9 | %td= notice.err.where | 12 | %td= notice.err.where |
public/javascripts/application.js
| 1 | -// App JS | ||
| 2 | \ No newline at end of file | 1 | \ No newline at end of file |
| 2 | +// App JS | ||
| 3 | + | ||
| 4 | +$(function(){ | ||
| 5 | + activateTabbedPanels(); | ||
| 6 | +}); | ||
| 7 | + | ||
| 8 | +function activateTabbedPanels() { | ||
| 9 | + $('.tab-bar a').each(function(){ | ||
| 10 | + var tab = $(this); | ||
| 11 | + var panel = $('#'+tab.attr('rel')); | ||
| 12 | + panel.addClass('panel'); | ||
| 13 | + panel.find('h3').hide(); | ||
| 14 | + }) | ||
| 15 | + | ||
| 16 | + $('.tab-bar a').click(function(){ | ||
| 17 | + activateTab($(this)); | ||
| 18 | + return(false); | ||
| 19 | + }); | ||
| 20 | + activateTab($('.tab-bar a').first()); | ||
| 21 | +} | ||
| 22 | + | ||
| 23 | +function activateTab(tab) { | ||
| 24 | + tab = $(tab); | ||
| 25 | + var panel = $('#'+tab.attr('rel')); | ||
| 26 | + | ||
| 27 | + tab.closest('.tab-bar').find('a.active').removeClass('active'); | ||
| 28 | + tab.addClass('active'); | ||
| 29 | + | ||
| 30 | + $('.panel').hide(); | ||
| 31 | + panel.show(); | ||
| 32 | +} | ||
| 3 | \ No newline at end of file | 33 | \ No newline at end of file |
public/stylesheets/application.css
| @@ -115,9 +115,12 @@ section#content-wrapper { | @@ -115,9 +115,12 @@ section#content-wrapper { | ||
| 115 | background-color: #e2e2e2; | 115 | background-color: #e2e2e2; |
| 116 | } | 116 | } |
| 117 | #content-title h1 { | 117 | #content-title h1 { |
| 118 | - padding: 0; margin: 0; border: none; | 118 | + padding: 0; margin: 0; |
| 119 | + width: 85%; | ||
| 120 | + border: none; | ||
| 119 | color: #666; | 121 | color: #666; |
| 120 | font-size: 2em; line-height: 1em; font-weight: bold; font-family: arial, sans-serif; | 122 | font-size: 2em; line-height: 1em; font-weight: bold; font-family: arial, sans-serif; |
| 123 | + word-wrap: break-word; | ||
| 121 | } | 124 | } |
| 122 | #content-title .meta { font-size: 0.9em; color: #787878; } | 125 | #content-title .meta { font-size: 0.9em; color: #787878; } |
| 123 | 126 | ||
| @@ -301,6 +304,7 @@ pre { | @@ -301,6 +304,7 @@ pre { | ||
| 301 | opacity: 0.5; | 304 | opacity: 0.5; |
| 302 | -moz-opacity: 0.5; | 305 | -moz-opacity: 0.5; |
| 303 | -webkit-opacity: 0.5; | 306 | -webkit-opacity: 0.5; |
| 307 | + cursor: no-drop; | ||
| 304 | } | 308 | } |
| 305 | .pagination em { | 309 | .pagination em { |
| 306 | padding: 0em 0.6em; | 310 | padding: 0em 0.6em; |
| @@ -337,7 +341,32 @@ a.button { | @@ -337,7 +341,32 @@ a.button { | ||
| 337 | a:hover.button { | 341 | a:hover.button { |
| 338 | box-shadow: 0px 0px 4px #69C; | 342 | box-shadow: 0px 0px 4px #69C; |
| 339 | -moz-box-shadow: 0px 0px 4px #69C; | 343 | -moz-box-shadow: 0px 0px 4px #69C; |
| 340 | - -webkit-box-shadow: 0px 0px 4px #69C | 344 | + -webkit-box-shadow: 0px 0px 4px #69C; |
| 345 | + text-decoration: none; | ||
| 346 | +} | ||
| 347 | +a.button.active { | ||
| 348 | + border-color: #fff; | ||
| 349 | + background-color: #CCC; | ||
| 350 | + background-image: none; | ||
| 351 | + box-shadow: inset 0 0 5px #999; | ||
| 352 | + -moz-box-shadow: inset 0 0 5px #999; | ||
| 353 | + -webkit-box-shadow: inset 0 0 5px #999; | ||
| 354 | +} | ||
| 355 | + | ||
| 356 | +/* Tab Bar */ | ||
| 357 | +.tab-bar { | ||
| 358 | + margin-bottom: 24px; | ||
| 359 | + background-color: #E2E2E2; | ||
| 360 | + border: 1px solid #BBB; | ||
| 361 | +} | ||
| 362 | +.tab-bar ul { | ||
| 363 | + padding: 9px 12px; | ||
| 364 | + border-top: 1px solid #FFF; | ||
| 365 | + border-bottom: 1px solid #FFF; | ||
| 366 | +} | ||
| 367 | +.tab-bar li { | ||
| 368 | + display: inline-block; | ||
| 369 | + margin-right: 14px; | ||
| 341 | } | 370 | } |
| 342 | 371 | ||
| 343 | /* Apps Table */ | 372 | /* Apps Table */ |