BigW Consortium Gitlab

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

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

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

54 55
.info-well
  .well-segment.branch-info
56 57
    .icon-container.commit-icon
      = custom_icon("icon_commit")
58 59 60 61 62 63
    %span.cgray= pluralize(@commit.parents.count, "parent")
    - @commit.parents.each do |parent|
      = link_to parent.short_id, namespace_project_commit_path(@project.namespace, @project, parent), class: "monospace"
    %span.commit-info.branches
      %i.fa.fa-spinner.fa-spin

64 65
  - if @commit.last_pipeline
    - last_pipeline = @commit.last_pipeline
66
    .well-segment.pipeline-info
67
      .status-icon-container{ class: "ci-status-icon-#{@commit.status}" }
68 69
        = link_to namespace_project_pipeline_path(@project.namespace, @project, last_pipeline.id) do
          = ci_icon_for_status(last_pipeline.status)
70
      Pipeline
71 72 73
      = link_to "##{last_pipeline.id}", namespace_project_pipeline_path(@project.namespace, @project, last_pipeline.id), class: "monospace"
      = ci_label_for_status(last_pipeline.status)
      - if last_pipeline.stages.any?
74
        .mr-widget-pipeline-graph
75
          = render 'shared/mini_pipeline_graph', pipeline: last_pipeline, klass: 'js-commit-pipeline-graph'
76
      in
77
      = time_interval_in_words last_pipeline.duration
78

79
:javascript
80
  $(".commit-info.branches").load("#{branches_namespace_project_commit_path(@project.namespace, @project, @commit.id)}");