BigW Consortium Gitlab

_push.html.haml 1.78 KB
Newer Older
1 2
.event-title
  %span.author_name= link_to_author event
3
  %span.event_label.pushed #{event.action_name} #{event.ref_type}
4
  - if event.rm_ref?
5
    %strong= event.ref_name
6
  - else
7
    %strong
Josh Frye committed
8
      = link_to event.ref_name, namespace_project_commits_path(event.project.namespace, event.project, event.ref_name), title: h(event.target_title)
9
  at
10
  = link_to_project event.project
11 12 13 14

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

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

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

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

          - if create_mr
37
            %span{"data-user-is" => event.author_id, "data-display" => "inline"}
Douwe Maan committed
38 39 40
              or
              = link_to create_mr_path(event.project.default_branch, event.ref_name, event.project) do
                create a merge request
41
      - elsif create_mr
Douwe Maan committed
42
        %li.commits-stat{"data-user-is" => event.author_id}
43 44
          = link_to create_mr_path(event.project.default_branch, event.ref_name, event.project) do
            Create Merge Request