diff options
author | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2016-03-04 15:45:58 +0100 |
---|---|---|
committer | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2016-03-04 15:45:58 +0100 |
commit | f943156b5e4cf5e00ea5373de55deb993c72662d (patch) | |
tree | a3cc708abfbcaf64ce183391de57a29bc28708b6 /app/views/projects/commits/_commits.html.haml | |
parent | 5eeea4b7c69d29e8e8371b3c63f25938dcca7bb6 (diff) | |
download | gitlab-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.haml | 12 |
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 |