BigW Consortium Gitlab

_push.html.haml 1.91 KB
Newer Older
1 2
- project = event.project

3 4
.event-title
  %span.author_name= link_to_author event
5
  %span.pushed #{event.action_name} #{event.ref_type}
6
  - if event.rm_ref?
7
    %strong= event.ref_name
8
  - else
9
    %strong
10
      = link_to event.ref_name, namespace_project_commits_path(project.namespace, project, event.ref_name), title: h(event.target_title)
11 12

  = render "events/event_scope", event: event
13 14 15

- if event.push_with_commits?
  .event-body
16
    %ul.well-list.event_commits
17 18
      - few_commits = event.commits[0...2]
      - few_commits.each do |commit|
19
        = render "events/commit", commit: commit, project: project, event: event
20

21
      - create_mr = event.new_ref? && create_mr_button?(project.default_branch, event.ref_name, project) && event.authored_by?(current_user)
22 23 24 25
      - if event.commits_count > 1
        %li.commits-stat
          - if event.commits_count > 2
            %span ... and #{event.commits_count - 2} more commits.
26

27 28 29 30
          - if event.md_ref?
            - from = event.commit_from
            - from_label = truncate_sha(from)
          - else
31
            - from = project.default_branch
32
            - from_label = from
33

34
          = link_to namespace_project_compare_path(project.namespace, project, from: from, to: event.commit_to) do
35 36 37
            Compare #{from_label}...#{truncate_sha(event.commit_to)}

          - if create_mr
38
            %span
Douwe Maan committed
39
              or
40
              = link_to create_mr_path(project.default_branch, event.ref_name, project) do
Douwe Maan committed
41
                create a merge request
42
      - elsif create_mr
43
        %li.commits-stat
44
          = link_to create_mr_path(project.default_branch, event.ref_name, project) do
45
            Create Merge Request
46 47 48 49 50 51 52 53
- elsif event.rm_ref?
  - repository = project.repository
  - last_commit = repository.commit(event.commit_from)
  - if last_commit
    .event-body
      %ul.well-list.event_commits
        = render "events/commit", commit: last_commit, project: project, event: event