diff --git a/.gitignore b/.gitignore index 6519419..cf0edfb 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ config/deploy config/mongoid.yml config/newrelic.yml .rvmrc +.idea *~ *.rbc .DS_Store diff --git a/app/views/errs/show.html.haml b/app/views/errs/show.html.haml index c6a8063..16a19b3 100644 --- a/app/views/errs/show.html.haml +++ b/app/views/errs/show.html.haml @@ -21,6 +21,7 @@ = link_to 'unlink issue', unlink_issue_app_err_path(@app, @problem), :method => :delete, :confirm => "Unlink err issues?", :class => "unlink-issue" - if @problem.unresolved? %span= link_to 'resolve', resolve_app_err_path(@app, @problem), :method => :put, :confirm => err_confirm, :class => 'resolve' + %span= link_to 'up', (request.env['HTTP_REFERER'] ? :back : app_errs_path(@app)), :class => 'up' - if Errbit::Config.allow_comments_with_issue_tracker || !@app.issue_tracker_configured? || @problem.comments.any? - content_for :comments do diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 18b188a..bdad152 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -672,6 +672,11 @@ table.deploys td.when { background: transparent url(images/icons/thumbs-up.png) 6px 5px no-repeat; } +/* Go Up */ +#action-bar a.up { + background: transparent url(images/icons/up.png) 6px 5px no-repeat; +} + /* Notices Pagination */ .notice-pagination { float: left; diff --git a/public/stylesheets/images/icons/up.png b/public/stylesheets/images/icons/up.png new file mode 100644 index 0000000..4d8b67f Binary files /dev/null and b/public/stylesheets/images/icons/up.png differ diff --git a/spec/views/errs/show.html.haml_spec.rb b/spec/views/errs/show.html.haml_spec.rb index be52ba7..ca7eb77 100644 --- a/spec/views/errs/show.html.haml_spec.rb +++ b/spec/views/errs/show.html.haml_spec.rb @@ -38,6 +38,24 @@ describe "errs/show.html.haml" do resolve_link.should_not =~ /data-confirm=/ end + it "should link 'up' to HTTP_REFERER if is set" do + url = 'http://localhost:3000/errs' + controller.request.env['HTTP_REFERER'] = url + render + action_bar = String.new(view.instance_variable_get(:@_content_for)[:action_bar]) + action_bar.should =~ /up<\/a><\/span>/ + end + + it "should link 'up' to app_errs_path if HTTP_REFERER isn't set'" do + controller.request.env['HTTP_REFERER'] = nil + problem = Fabricate(:problem_with_comments) + assign :problem, problem + assign :app, problem.app + render + action_bar = String.new(view.instance_variable_get(:@_content_for)[:action_bar]) + action_bar.should =~ /up<\/a><\/span>/ + end + end describe "content_for :comments with comments disabled for configured issue tracker" do -- libgit2 0.21.2