_commit_box.html.haml 3.7 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
51
  %h3.commit-title
52
    = markdown(@commit.title, pipeline: :single_line, author: @commit.author)
53 54
  - if @commit.description.present?
    %pre.commit-description
55
      = preserve(markdown(@commit.description, pipeline: :single_line, author: @commit.author))
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
  - if @commit.last_pipeline
    - last_pipeline = @commit.last_pipeline
69
    .well-segment.pipeline-info
70
      .status-icon-container{ class: "ci-status-icon-#{last_pipeline.status}" }
71
        = link_to project_pipeline_path(@project, last_pipeline.id) do
72
          = ci_icon_for_status(last_pipeline.status)
Bob Van Landuyt's avatar
Bob Van Landuyt committed
73
      #{ _('Pipeline') }
74
      = link_to "##{last_pipeline.id}", project_pipeline_path(@project, last_pipeline.id)
75
      = ci_label_for_status(last_pipeline.status)
76
      - if last_pipeline.stages_count.nonzero?
77
        #{ n_(s_('Pipeline|with stage'), s_('Pipeline|with stages'), last_pipeline.stages_count) }
78
        .mr-widget-pipeline-graph
79
          = render 'shared/mini_pipeline_graph', pipeline: last_pipeline, klass: 'js-commit-pipeline-graph'
80 81 82
      - if last_pipeline.duration
        in
        = time_interval_in_words last_pipeline.duration