Commit ea1827c9 authored by Sean McGivern's avatar Sean McGivern

Make expand_all param more explicit

parent ff55398a
...@@ -8,7 +8,7 @@ module DiffForPath ...@@ -8,7 +8,7 @@ module DiffForPath
diff_commit = commit_for_diff(diff_file) diff_commit = commit_for_diff(diff_file)
blob = diff_file.blob(diff_commit) blob = diff_file.blob(diff_commit)
@expand_all = true @expand_all_diffs = true
locals = { locals = {
diff_file: diff_file, diff_file: diff_file,
......
...@@ -8,8 +8,8 @@ module DiffHelper ...@@ -8,8 +8,8 @@ module DiffHelper
[marked_old_line, marked_new_line] [marked_old_line, marked_new_line]
end end
def expand_all? def expand_all_diffs?
@expand_all || params[:expand].present? @expand_all_diffs || params[:expand_all_diffs].present?
end end
def diff_view def diff_view
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
- if !project.repository.diffable?(blob) - if !project.repository.diffable?(blob)
.nothing-here-block This diff was suppressed by a .gitattributes entry. .nothing-here-block This diff was suppressed by a .gitattributes entry.
- elsif diff_file.diff_lines.length > 0 - 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)) - 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 } } .nothing-here-block.diff-collapsed{data: { diff_for_path: url } }
This diff is collapsed. Click to expand it. This diff is collapsed. Click to expand it.
......
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
.content-block.oneline-block.files-changed .content-block.oneline-block.files-changed
.inline-parallel-buttons .inline-parallel-buttons
- unless expand_all? - unless expand_all_diffs?
= link_to 'Expand all', url_for(params.merge(expand: 1, format: 'html')), class: 'btn btn-default' = link_to 'Expand all', url_for(params.merge(expand_all_diffs: 1, format: 'html')), class: 'btn btn-default'
- if show_whitespace_toggle - if show_whitespace_toggle
- if current_controller?(:commit) - if current_controller?(:commit)
= commit_diff_whitespace_link(@project, @commit, class: 'hidden-xs') = commit_diff_whitespace_link(@project, @commit, class: 'hidden-xs')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment