summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-09-22 21:03:29 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-09-22 21:03:29 +0300
commite54fdee43630511dba064100117f4a3bd1949dd2 (patch)
treec7ae0a7dc88ce580bab19f5b4042964e5eb18e27
parent6a1323f12aa8bfb655acbf6892b6210b32316bb4 (diff)
parent1da0c0b6e43198074e775549011b73533fd3f64a (diff)
downloadgitlab-ce-e54fdee43630511dba064100117f4a3bd1949dd2.tar.gz
Merge pull request #7657 from cirosantilli/factor-commit-list
[refactor] Factor out commit list from compare and new MR.
-rw-r--r--app/views/projects/commits/_commit_list.html.haml11
-rw-r--r--app/views/projects/compare/show.html.haml14
-rw-r--r--app/views/projects/merge_requests/_new_submit.html.haml12
3 files changed, 13 insertions, 24 deletions
diff --git a/app/views/projects/commits/_commit_list.html.haml b/app/views/projects/commits/_commit_list.html.haml
new file mode 100644
index 00000000000..2ee7d73bd20
--- /dev/null
+++ b/app/views/projects/commits/_commit_list.html.haml
@@ -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
diff --git a/app/views/projects/compare/show.html.haml b/app/views/projects/compare/show.html.haml
index 45269e662cd..214b5bd337b 100644
--- a/app/views/projects/compare/show.html.haml
+++ b/app/views/projects/compare/show.html.haml
@@ -6,20 +6,8 @@
= render "form"
- if @commits.present?
- %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
-
+ = render "projects/commits/commit_list"
= render "projects/diffs/diffs", diffs: @diffs, project: @project
-
- else
.light-well
.center
diff --git a/app/views/projects/merge_requests/_new_submit.html.haml b/app/views/projects/merge_requests/_new_submit.html.haml
index 64fc0160926..84bf81441b1 100644
--- a/app/views/projects/merge_requests/_new_submit.html.haml
+++ b/app/views/projects/merge_requests/_new_submit.html.haml
@@ -62,17 +62,7 @@
= f.submit 'Submit merge request', class: "btn btn-create"
.mr-compare
- %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
+ = render "projects/commits/commit_list"
%h4 Changes
- if @diffs.present?