summaryrefslogtreecommitdiff
path: root/app/views/projects/commits/_commits.html.haml
blob: 2e5953bf0a608c10c3c0d3c1d38d816b1f71a67b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
- merge_request = local_assigns.fetch(:merge_request, nil)
- project = local_assigns.fetch(:project) { merge_request&.project }
- ref = local_assigns.fetch(:ref) { merge_request&.source_branch }

- commits = @commits
- hidden = @hidden_commit_count
- commits_count = @commits.size

- commits.chunk { |c| c.committed_date.in_time_zone.to_date }.each do |day, commits|
  %li.commit-header.js-commit-header{ data: { day: day } }
    %span.day= l(day, format: '%d %b, %Y')
    %span.commits-count= n_("%d commit", "%d commits", commits_count) % commits_count

  %li.commits-row{ data: { day: day } }
    %ul.content-list.commit-list.flex-list
      = render partial: 'projects/commits/commit', collection: commits, locals: { project: project, ref: ref, merge_request: merge_request }

- if hidden > 0
  %li.alert.alert-warning
    = n_('%s additional commit has been omitted to prevent performance issues.', '%s additional commits have been omitted to prevent performance issues.', hidden) % number_with_delimiter(hidden)

- if commits_count == 0
  .mt-4.text-center
    .bold
      = _('Your search didn\'t match any commits.')
    = _('Try changing or removing filters.')