summaryrefslogtreecommitdiff
path: root/app/views/projects/commits/_commits.html.haml
diff options
context:
space:
mode:
authorJacob Vosmaer <contact@jacobvosmaer.nl>2016-03-04 15:45:58 +0100
committerJacob Vosmaer <contact@jacobvosmaer.nl>2016-03-04 15:45:58 +0100
commitf943156b5e4cf5e00ea5373de55deb993c72662d (patch)
treea3cc708abfbcaf64ce183391de57a29bc28708b6 /app/views/projects/commits/_commits.html.haml
parent5eeea4b7c69d29e8e8371b3c63f25938dcca7bb6 (diff)
downloadgitlab-ce-f943156b5e4cf5e00ea5373de55deb993c72662d.tar.gz
Put 'hidden commits' logic in CommitsHelper
Diffstat (limited to 'app/views/projects/commits/_commits.html.haml')
-rw-r--r--app/views/projects/commits/_commits.html.haml12
1 files changed, 4 insertions, 8 deletions
diff --git a/app/views/projects/commits/_commits.html.haml b/app/views/projects/commits/_commits.html.haml
index e708b2df540..998251094a4 100644
--- a/app/views/projects/commits/_commits.html.haml
+++ b/app/views/projects/commits/_commits.html.haml
@@ -1,11 +1,7 @@
- unless defined?(project)
- project = @project
-- if @commits.size > MergeRequestDiff::COMMITS_SAFE_SIZE
- - commits = @commits.first(MergeRequestDiff::COMMITS_SAFE_SIZE)
- - overflow = true
-- else
- - commits = @commits
- - overflow = false
+
+- commits, hidden = limited_commits(@commits)
- commits.group_by { |c| c.committed_date.to_date }.sort.reverse.each do |day, commits|
.row.commits-row
@@ -20,6 +16,6 @@
= render commits, project: project
%hr.lists-separator
-- if overflow
+- if hidden > 0
.alert.alert-warning
- Not shown: #{@commits.size - MergeRequestDiff::COMMITS_SAFE_SIZE} more commits
+ Not shown: #{hidden} more commits