2017-01-29 19:38:00 +00:00
|
|
|
- environment = local_assigns.fetch(:environment, nil)
|
2016-04-04 16:35:56 +00:00
|
|
|
- show_whitespace_toggle = local_assigns.fetch(:show_whitespace_toggle, true)
|
2016-08-11 07:00:17 +00:00
|
|
|
- can_create_note = !@diff_notes_disabled && can?(current_user, :create_note, diffs.project)
|
2016-07-27 11:09:52 +00:00
|
|
|
- diff_files = diffs.diff_files
|
2017-08-07 13:21:12 +00:00
|
|
|
- merge_request = local_assigns.fetch(:merge_request, false)
|
2015-08-26 09:51:28 +00:00
|
|
|
|
2017-08-07 13:21:12 +00:00
|
|
|
.content-block.oneline-block.files-changed.diff-files-changed.js-diff-files-changed{ class: ("diff-files-changed-merge-request" if merge_request) }
|
2017-08-08 16:12:11 +00:00
|
|
|
.files-changed-inner
|
2018-04-09 21:36:25 +00:00
|
|
|
.inline-parallel-buttons.d-none.d-sm-none.d-md-block
|
2017-08-08 16:12:11 +00:00
|
|
|
- if !diffs_expanded? && diff_files.any? { |diff_file| diff_file.collapsed? }
|
2018-05-10 19:22:56 +00:00
|
|
|
= link_to 'Expand all', url_for(safe_params.merge(expanded: 1, format: nil)), class: 'btn btn-default'
|
2017-08-08 16:12:11 +00:00
|
|
|
- if show_whitespace_toggle
|
|
|
|
- if current_controller?(:commit)
|
2018-04-18 19:18:16 +00:00
|
|
|
= commit_diff_whitespace_link(diffs.project, @commit, class: 'd-none d-sm-inline-block')
|
2017-08-08 16:12:11 +00:00
|
|
|
- elsif current_controller?('projects/merge_requests/diffs')
|
2018-05-24 22:42:31 +00:00
|
|
|
= diff_merge_request_whitespace_link(diffs.project, @merge_request, class: 'd-none d-sm-inline-block')
|
2017-08-08 16:12:11 +00:00
|
|
|
- elsif current_controller?(:compare)
|
2018-05-09 17:24:59 +00:00
|
|
|
= diff_compare_whitespace_link(diffs.project, params[:from], params[:to], class: 'd-none d-sm-inline-block')
|
2017-08-08 16:12:11 +00:00
|
|
|
.btn-group
|
|
|
|
= inline_diff_btn
|
|
|
|
= parallel_diff_btn
|
|
|
|
= render 'projects/diffs/stats', diff_files: diff_files
|
2015-04-27 16:06:51 +00:00
|
|
|
|
2016-12-30 19:16:25 +00:00
|
|
|
- if render_overflow_warning?(diff_files)
|
|
|
|
= render 'projects/diffs/warning', diff_files: diffs
|
2014-09-08 13:26:49 +00:00
|
|
|
|
2016-08-11 07:00:17 +00:00
|
|
|
.files{ data: { can_create_note: can_create_note } }
|
2017-05-15 17:18:19 +00:00
|
|
|
= render partial: 'projects/diffs/file', collection: diff_files, as: :diff_file, locals: { project: diffs.project, environment: environment }
|