Commit de50bcb531fa27796bd0173a9a57c63264649d6c
Committed by
Matt Gauger
1 parent
66f8b331
Exists in
master
and in
1 other branch
Added 'Up' button in the err view.
Showing
5 changed files
with
25 additions
and
0 deletions
Show diff stats
.gitignore
app/views/errs/show.html.haml
| @@ -21,6 +21,7 @@ | @@ -21,6 +21,7 @@ | ||
| 21 | = link_to 'unlink issue', unlink_issue_app_err_path(@app, @problem), :method => :delete, :confirm => "Unlink err issues?", :class => "unlink-issue" | 21 | = link_to 'unlink issue', unlink_issue_app_err_path(@app, @problem), :method => :delete, :confirm => "Unlink err issues?", :class => "unlink-issue" |
| 22 | - if @problem.unresolved? | 22 | - if @problem.unresolved? |
| 23 | %span= link_to 'resolve', resolve_app_err_path(@app, @problem), :method => :put, :confirm => err_confirm, :class => 'resolve' | 23 | %span= link_to 'resolve', resolve_app_err_path(@app, @problem), :method => :put, :confirm => err_confirm, :class => 'resolve' |
| 24 | + %span= link_to 'up', (request.env['HTTP_REFERER'] ? :back : app_errs_path(@app)), :class => 'up' | ||
| 24 | 25 | ||
| 25 | - if Errbit::Config.allow_comments_with_issue_tracker || !@app.issue_tracker_configured? || @problem.comments.any? | 26 | - if Errbit::Config.allow_comments_with_issue_tracker || !@app.issue_tracker_configured? || @problem.comments.any? |
| 26 | - content_for :comments do | 27 | - content_for :comments do |
public/stylesheets/application.css
| @@ -672,6 +672,11 @@ table.deploys td.when { | @@ -672,6 +672,11 @@ table.deploys td.when { | ||
| 672 | background: transparent url(images/icons/thumbs-up.png) 6px 5px no-repeat; | 672 | background: transparent url(images/icons/thumbs-up.png) 6px 5px no-repeat; |
| 673 | } | 673 | } |
| 674 | 674 | ||
| 675 | +/* Go Up */ | ||
| 676 | +#action-bar a.up { | ||
| 677 | + background: transparent url(images/icons/up.png) 6px 5px no-repeat; | ||
| 678 | +} | ||
| 679 | + | ||
| 675 | /* Notices Pagination */ | 680 | /* Notices Pagination */ |
| 676 | .notice-pagination { | 681 | .notice-pagination { |
| 677 | float: left; | 682 | float: left; |
2.16 KB
spec/views/errs/show.html.haml_spec.rb
| @@ -38,6 +38,24 @@ describe "errs/show.html.haml" do | @@ -38,6 +38,24 @@ describe "errs/show.html.haml" do | ||
| 38 | resolve_link.should_not =~ /data-confirm=/ | 38 | resolve_link.should_not =~ /data-confirm=/ |
| 39 | end | 39 | end |
| 40 | 40 | ||
| 41 | + it "should link 'up' to HTTP_REFERER if is set" do | ||
| 42 | + url = 'http://localhost:3000/errs' | ||
| 43 | + controller.request.env['HTTP_REFERER'] = url | ||
| 44 | + render | ||
| 45 | + action_bar = String.new(view.instance_variable_get(:@_content_for)[:action_bar]) | ||
| 46 | + action_bar.should =~ /<span><a href=\"#{url}\" class=\"up\">up<\/a><\/span>/ | ||
| 47 | + end | ||
| 48 | + | ||
| 49 | + it "should link 'up' to app_errs_path if HTTP_REFERER isn't set'" do | ||
| 50 | + controller.request.env['HTTP_REFERER'] = nil | ||
| 51 | + problem = Fabricate(:problem_with_comments) | ||
| 52 | + assign :problem, problem | ||
| 53 | + assign :app, problem.app | ||
| 54 | + render | ||
| 55 | + action_bar = String.new(view.instance_variable_get(:@_content_for)[:action_bar]) | ||
| 56 | + action_bar.should =~ /<span><a href=\"#{app_errs_path(problem.app)}\" class=\"up\">up<\/a><\/span>/ | ||
| 57 | + end | ||
| 58 | + | ||
| 41 | end | 59 | end |
| 42 | 60 | ||
| 43 | describe "content_for :comments with comments disabled for configured issue tracker" do | 61 | describe "content_for :comments with comments disabled for configured issue tracker" do |