BigW Consortium Gitlab

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

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

49
.commit-box
50
  %h3.commit-title
51
    = markdown(@commit.title, pipeline: :single_line, author: @commit.author)
52 53
  - if @commit.description.present?
    %pre.commit-description
54
      = preserve(markdown(@commit.description, pipeline: :single_line, author: @commit.author))
55

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

66 67
  - if @commit.last_pipeline
    - last_pipeline = @commit.last_pipeline
68
    .well-segment.pipeline-info
69
      .status-icon-container{ class: "ci-status-icon-#{@commit.status}" }
70
        = link_to project_pipeline_path(@project, last_pipeline.id) do
71
          = ci_icon_for_status(last_pipeline.status)
72
      #{ _('Pipeline') }
73
      = link_to "##{last_pipeline.id}", project_pipeline_path(@project, last_pipeline.id)
74
      = ci_label_for_status(last_pipeline.status)
75
      - if last_pipeline.stages_count.nonzero?
76
        #{ n_(s_('Pipeline|with stage'), s_('Pipeline|with stages'), last_pipeline.stages_count) }
77
        .mr-widget-pipeline-graph
78
          = render 'shared/mini_pipeline_graph', pipeline: last_pipeline, klass: 'js-commit-pipeline-graph'
79
      in
80
      = time_interval_in_words last_pipeline.duration
81

82
:javascript
83
  $(".commit-info.branches").load("#{branches_project_commit_path(@project, @commit.id)}");