Factor out commit list from compare and new MR.
This commit is contained in:
parent
b3a88a0fdc
commit
1da0c0b6e4
3 changed files with 13 additions and 24 deletions
11
app/views/projects/commits/_commit_list.html.haml
Normal file
11
app/views/projects/commits/_commit_list.html.haml
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
%div.panel.panel-default
|
||||||
|
.panel-heading
|
||||||
|
Commits (#{@commits.count})
|
||||||
|
- if @commits.size > MergeRequestDiff::COMMITS_SAFE_SIZE
|
||||||
|
%ul.well-list
|
||||||
|
- Commit.decorate(@commits.first(MergeRequestDiff::COMMITS_SAFE_SIZE)).each do |commit|
|
||||||
|
= render "projects/commits/inline_commit", commit: commit, project: @project
|
||||||
|
%li.warning-row.unstyled
|
||||||
|
other #{@commits.size - MergeRequestDiff::COMMITS_SAFE_SIZE} commits hidden to prevent performance issues.
|
||||||
|
- else
|
||||||
|
%ul.well-list= render Commit.decorate(@commits), project: @project
|
|
@ -6,20 +6,8 @@
|
||||||
= render "form"
|
= render "form"
|
||||||
|
|
||||||
- if @commits.present?
|
- if @commits.present?
|
||||||
%div.panel.panel-default
|
= render "projects/commits/commit_list"
|
||||||
.panel-heading
|
|
||||||
Commits (#{@commits.count})
|
|
||||||
- if @commits.size > MergeRequestDiff::COMMITS_SAFE_SIZE
|
|
||||||
%ul.well-list
|
|
||||||
- Commit.decorate(@commits.first(MergeRequestDiff::COMMITS_SAFE_SIZE)).each do |commit|
|
|
||||||
= render "projects/commits/inline_commit", commit: commit, project: @project
|
|
||||||
%li.warning-row.unstyled
|
|
||||||
other #{@commits.size - MergeRequestDiff::COMMITS_SAFE_SIZE} commits hidden to prevent performance issues.
|
|
||||||
- else
|
|
||||||
%ul.well-list= render Commit.decorate(@commits), project: @project
|
|
||||||
|
|
||||||
= render "projects/diffs/diffs", diffs: @diffs, project: @project
|
= render "projects/diffs/diffs", diffs: @diffs, project: @project
|
||||||
|
|
||||||
- else
|
- else
|
||||||
.light-well
|
.light-well
|
||||||
.center
|
.center
|
||||||
|
|
|
@ -66,17 +66,7 @@
|
||||||
= f.submit 'Submit merge request', class: "btn btn-create"
|
= f.submit 'Submit merge request', class: "btn btn-create"
|
||||||
|
|
||||||
.mr-compare
|
.mr-compare
|
||||||
%div.panel.panel-default
|
= render "projects/commits/commit_list"
|
||||||
.panel-heading
|
|
||||||
Commits (#{@commits.count})
|
|
||||||
- if @commits.size > MergeRequestDiff::COMMITS_SAFE_SIZE
|
|
||||||
%ul.well-list
|
|
||||||
- Commit.decorate(@commits.first(MergeRequestDiff::COMMITS_SAFE_SIZE)).each do |commit|
|
|
||||||
= render "projects/commits/inline_commit", commit: commit, project: @project
|
|
||||||
%li.warning-row.unstyled
|
|
||||||
other #{@commits.size - MergeRequestDiff::COMMITS_SAFE_SIZE} commits hidden to prevent performance issues.
|
|
||||||
- else
|
|
||||||
%ul.well-list= render Commit.decorate(@commits), project: @project
|
|
||||||
|
|
||||||
%h4 Changes
|
%h4 Changes
|
||||||
- if @diffs.present?
|
- if @diffs.present?
|
||||||
|
|
Loading…
Reference in a new issue