diff options
author | Jacob Schatz <jschatz@gitlab.com> | 2016-06-16 01:48:39 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2016-06-20 19:16:18 +0300 |
commit | 0d57e944779512941491e8c754f804e85ecd4178 (patch) | |
tree | 7852fd9a4dfebe74b002c7b14b35f10bd2d65ba1 | |
parent | 13fa884ee4740295e4ab7317877cb07cb1cd63ea (diff) |
Merge branch 'toggle-whitespace-button-for-compare-page' into 'master'
Toggle whitespace button for compare page
## What does this MR do?
Adds whitespace button to compare branches page.
## Are there points in the code the reviewer needs to double check?
Ruby code.
## Why was this MR needed?
Compare branches UX
## What are the relevant issue numbers?
Closes #17881.
## Screenshots (if relevant)
![Screen_Shot_2016-06-09_at_18.39.48](/uploads/8995a7bc8bea7fa3ff19446ebe49fb88/Screen_Shot_2016-06-09_at_18.39.48.png)
## Does this MR meet the acceptance criteria?
- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- [ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)
- [ ] API support added
- [ ] Tests
- [ ] Added for this feature/bug
- [ ] All builds are passing
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if you do - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)
See merge request !4569
-rw-r--r-- | CHANGELOG | 1 | ||||
-rw-r--r-- | app/helpers/diff_helper.rb | 5 | ||||
-rw-r--r-- | app/views/projects/diffs/_diffs.html.haml | 2 |
3 files changed, 8 insertions, 0 deletions
diff --git a/CHANGELOG b/CHANGELOG index 3a452ca75d6..490d065a344 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -71,6 +71,7 @@ v 8.9.0 (unreleased) - Add support for using Yubikeys (U2F) for two-factor authentication - Link to blank group icon doesn't throw a 404 anymore - Remove 'main language' feature + - Toggle whitespace button now available for compare branches diffs #17881 - Pipelines can be canceled only when there are running builds - Allow authentication using personal access tokens - Use downcased path to container repository as this is expected path by Docker diff --git a/app/helpers/diff_helper.rb b/app/helpers/diff_helper.rb index cbe47176831..e22dce59d0f 100644 --- a/app/helpers/diff_helper.rb +++ b/app/helpers/diff_helper.rb @@ -135,6 +135,11 @@ module DiffHelper toggle_whitespace_link(url, options) end + def diff_compare_whitespace_link(project, from, to, options) + url = namespace_project_compare_path(project.namespace, project, from, to, params_with_whitespace) + toggle_whitespace_link(url, options) + end + private def hide_whitespace? diff --git a/app/views/projects/diffs/_diffs.html.haml b/app/views/projects/diffs/_diffs.html.haml index 6c11afbe420..f18bc8c41b3 100644 --- a/app/views/projects/diffs/_diffs.html.haml +++ b/app/views/projects/diffs/_diffs.html.haml @@ -11,6 +11,8 @@ = commit_diff_whitespace_link(@project, @commit, class: 'hidden-xs') - elsif current_controller?(:merge_requests) = diff_merge_request_whitespace_link(@project, @merge_request, class: 'hidden-xs') + - elsif current_controller?(:compare) + = diff_compare_whitespace_link(@project, params[:from], params[:to], class: 'hidden-xs') .btn-group = inline_diff_btn = parallel_diff_btn |