debian-mirror-gitlab/app/views/projects/diffs/_diffs.html.haml

29 lines
1.6 KiB
Text
Raw Normal View History

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