diff options
author | Sean McGivern <sean@gitlab.com> | 2016-07-06 18:35:55 +0100 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2016-07-08 13:54:09 +0100 |
commit | ea1827c9a491de719be6a084fc092b88b1f54600 (patch) | |
tree | a1501eb5d9b53734e655e0636e37b76dd4faee27 | |
parent | ff55398aafa2feccaba4ed470becabc526b4df48 (diff) | |
download | gitlab-ce-ea1827c9a491de719be6a084fc092b88b1f54600.tar.gz |
Make expand_all param more explicit
-rw-r--r-- | app/controllers/concerns/diff_for_path.rb | 2 | ||||
-rw-r--r-- | app/helpers/diff_helper.rb | 4 | ||||
-rw-r--r-- | app/views/projects/diffs/_content.html.haml | 2 | ||||
-rw-r--r-- | app/views/projects/diffs/_diffs.html.haml | 4 |
4 files changed, 6 insertions, 6 deletions
diff --git a/app/controllers/concerns/diff_for_path.rb b/app/controllers/concerns/diff_for_path.rb index b9b5d136bd9..5ca8d3af0c9 100644 --- a/app/controllers/concerns/diff_for_path.rb +++ b/app/controllers/concerns/diff_for_path.rb @@ -8,7 +8,7 @@ module DiffForPath diff_commit = commit_for_diff(diff_file) blob = diff_file.blob(diff_commit) - @expand_all = true + @expand_all_diffs = true locals = { diff_file: diff_file, diff --git a/app/helpers/diff_helper.rb b/app/helpers/diff_helper.rb index ebfe4e27b78..04490226e50 100644 --- a/app/helpers/diff_helper.rb +++ b/app/helpers/diff_helper.rb @@ -8,8 +8,8 @@ module DiffHelper [marked_old_line, marked_new_line] end - def expand_all? - @expand_all || params[:expand].present? + def expand_all_diffs? + @expand_all_diffs || params[:expand_all_diffs].present? end def diff_view diff --git a/app/views/projects/diffs/_content.html.haml b/app/views/projects/diffs/_content.html.haml index 5f4572ab9b0..bfcd3ee9132 100644 --- a/app/views/projects/diffs/_content.html.haml +++ b/app/views/projects/diffs/_content.html.haml @@ -9,7 +9,7 @@ - if !project.repository.diffable?(blob) .nothing-here-block This diff was suppressed by a .gitattributes entry. - elsif diff_file.diff_lines.length > 0 - - if diff_file.collapsed_by_default? && !expand_all? + - if diff_file.collapsed_by_default? && !expand_all_diffs? - url = url_for(params.merge(action: :diff_for_path, path: diff_file.file_path, format: nil)) .nothing-here-block.diff-collapsed{data: { diff_for_path: url } } This diff is collapsed. Click to expand it. diff --git a/app/views/projects/diffs/_diffs.html.haml b/app/views/projects/diffs/_diffs.html.haml index 7b530af0f4a..5db70bbb478 100644 --- a/app/views/projects/diffs/_diffs.html.haml +++ b/app/views/projects/diffs/_diffs.html.haml @@ -6,8 +6,8 @@ .content-block.oneline-block.files-changed .inline-parallel-buttons - - unless expand_all? - = link_to 'Expand all', url_for(params.merge(expand: 1, format: 'html')), class: 'btn btn-default' + - unless expand_all_diffs? + = link_to 'Expand all', url_for(params.merge(expand_all_diffs: 1, format: 'html')), class: 'btn btn-default' - if show_whitespace_toggle - if current_controller?(:commit) = commit_diff_whitespace_link(@project, @commit, class: 'hidden-xs') |