_commit_box.html.haml 4.26 KB
Newer Older
1
.page-content-header.js-commit-box{ 'data-commit-path' => branches_project_commit_path(@project, @commit.id) }
2
  .header-main-content
3
    = render partial: 'signature', object: @commit.signature
4
    %strong
5
      #{ s_('CommitBoxTitle|Commit') }
6
      %span.commit-sha= @commit.short_id
Bob Van Landuyt's avatar
Bob Van Landuyt committed
7
    = clipboard_button(text: @commit.id, title: _("Copy commit SHA to clipboard"))
8 9
    %span.hidden-xs authored
    #{time_ago_with_tooltip(@commit.authored_date)}
10
    %span= s_('ByAuthor|by')
11
    = author_avatar(@commit, size: 24)
12
    %strong
13 14
      = commit_author_link(@commit, avatar: true, size: 24)
    - if @commit.different_committer?
Bob Van Landuyt's avatar
Bob Van Landuyt committed
15
      %span.light= _('Committed by')
16 17 18
      %strong
        = commit_committer_link(@commit, avatar: true, size: 24)
      #{time_ago_with_tooltip(@commit.committed_date)}
19 20

  .header-action-buttons
21 22 23 24
    - if defined?(@notes_count) && @notes_count > 0
      %span.btn.disabled.btn-grouped.hidden-xs.append-right-10
        = icon('comment')
        = @notes_count
25
    = link_to project_tree_path(@project, @commit), class: "btn btn-default append-right-10 hidden-xs hidden-sm" do
Bob Van Landuyt's avatar
Bob Van Landuyt committed
26
      #{ _('Browse files') }
27 28
    .dropdown.inline
      %a.btn.btn-default.dropdown-toggle{ data: { toggle: "dropdown" } }
Bob Van Landuyt's avatar
Bob Van Landuyt committed
29
        %span= _('Options')
30 31 32
        = icon('caret-down')
      %ul.dropdown-menu.dropdown-menu-align-right
        %li.visible-xs-block.visible-sm-block
33
          = link_to project_tree_path(@project, @commit) do
34
            #{ _('Browse Files') }
35
        - unless @commit.has_been_reverted?(current_user)
36
          %li.clearfix
37
            = revert_commit_link(@commit, project_commit_path(@project, @commit.id), has_tooltip: false)
38
        %li.clearfix
39
          = cherry_pick_commit_link(@commit, project_commit_path(@project, @commit.id), has_tooltip: false)
40 41
        - if can_collaborate_with_project?
          %li.clearfix
42
            = link_to s_("CreateTag|Tag"), new_project_tag_path(@project, ref: @commit)
43 44
        %li.divider
        %li.dropdown-header
Bob Van Landuyt's avatar
Bob Van Landuyt committed
45
          #{ _('Download') }
46
        - unless @commit.parents.length > 1
47 48
          %li= link_to s_("DownloadCommit|Email Patches"), project_commit_path(@project, @commit, format: :patch)
        %li= link_to s_("DownloadCommit|Plain Diff"),    project_commit_path(@project, @commit, format: :diff)
randx's avatar
randx committed
49

50
.commit-box{ data: { project_path: project_path(@project) } }
51
  %h3.commit-title
52
    = markdown_field(@commit, :title)
53 54
  - if @commit.description.present?
    %pre.commit-description
55
      = preserve(markdown_field(@commit, :description))
56

57 58
.info-well
  .well-segment.branch-info
59 60
    .icon-container.commit-icon
      = custom_icon("icon_commit")
Bob Van Landuyt's avatar
Bob Van Landuyt committed
61
    %span.cgray= n_('parent', 'parents', @commit.parents.count)
62
    - @commit.parents.each do |parent|
63
      = link_to parent.short_id, project_commit_path(@project, parent), class: "commit-sha"
64
    .commit-info.branches
65 66
      %i.fa.fa-spinner.fa-spin

67 68 69 70 71 72
  .well-segment.merge-request-info
    .icon-container
      = custom_icon('mr_bold')
    %span.commit-info.merge-requests{ 'data-project-commit-path' => merge_requests_project_commit_path(@project, @commit.id, format: :json) }
      = icon('spinner spin')

73 74
  - if @commit.last_pipeline
    - last_pipeline = @commit.last_pipeline
75
    .well-segment.pipeline-info
76 77
      .status-icon-container
        = link_to project_pipeline_path(@project, last_pipeline.id), class: "ci-status-icon-#{last_pipeline.status}" do
78
          = ci_icon_for_status(last_pipeline.status)
Bob Van Landuyt's avatar
Bob Van Landuyt committed
79
      #{ _('Pipeline') }
80
      = link_to "##{last_pipeline.id}", project_pipeline_path(@project, last_pipeline.id)
81
      = ci_label_for_status(last_pipeline.status)
82
      - if last_pipeline.stages_count.nonzero?
83
        #{ n_(s_('Pipeline|with stage'), s_('Pipeline|with stages'), last_pipeline.stages_count) }
84
        .mr-widget-pipeline-graph
85
          = render 'shared/mini_pipeline_graph', pipeline: last_pipeline, klass: 'js-commit-pipeline-graph'
86 87 88
      - if last_pipeline.duration
        in
        = time_interval_in_words last_pipeline.duration
89 90 91 92 93 94 95

  - if @merge_request
    .well-segment
      = icon('info-circle fw')

      This commit is part of merge request
      = succeed '.' do
96
        = link_to @merge_request.to_reference, diffs_project_merge_request_path(@project, @merge_request, commit_id: @commit.id)
97 98

      Comments created here will be created in the context of that merge request.