BigW Consortium Gitlab

_commit_box.html.haml 3.36 KB
Newer Older
Phil Hughes committed
1 2 3 4 5 6 7
.commit-info-row.commit-info-row-header
  %span.hidden-xs Authored by
  %strong
    = commit_author_link(@commit, avatar: true, size: 24)
  #{time_ago_with_tooltip(@commit.authored_date)}

  .pull-right.commit-action-buttons
8
    - if defined?(@notes_count) && @notes_count > 0
9
      %span.btn.disabled.btn-grouped.hidden-xs.append-right-10
10
        = icon('comment')
11
        = @notes_count
12
    = link_to namespace_project_tree_path(@project.namespace, @project, @commit), class: "btn btn-default append-right-10 hidden-xs hidden-sm" do
13 14 15
      Browse Files
    .dropdown.inline
      %a.btn.btn-default.dropdown-toggle{ data: { toggle: "dropdown" } }
Phil Hughes committed
16 17
        %span.hidden-xs Options
        %span.caret.commit-options-dropdown-caret
18
      %ul.dropdown-menu.dropdown-menu-align-right
Phil Hughes committed
19 20 21
        %li.visible-xs-block.visible-sm-block
          = link_to namespace_project_tree_path(@project.namespace, @project, @commit) do
            Browse Files
22 23 24 25 26 27 28 29
        - unless @commit.has_been_reverted?(current_user)
          %li.clearfix
            = 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)
        %li.divider
        %li.dropdown-header
          Download
30 31
        - unless @commit.parents.length > 1
          %li= link_to "Email Patches", namespace_project_commit_path(@project.namespace, @project, @commit, format: :patch)
Vinnie Okada committed
32
        %li= link_to "Plain Diff",    namespace_project_commit_path(@project.namespace, @project, @commit, format: :diff)
randx committed
33

34 35 36 37 38
- if @commit.different_committer?
  .commit-info-row
    %span.light Committed by
    %strong
      = commit_committer_link(@commit, avatar: true, size: 24)
39
    #{time_ago_with_tooltip(@commit.committed_date)}
40 41

.commit-info-row
Phil Hughes committed
42 43 44
  %span.hidden-xs.hidden-sm Commit
  = link_to @commit.id, namespace_project_commit_path(@project.namespace, @project, @commit), class: "monospace hidden-xs hidden-sm"
  = link_to @commit.short_id, namespace_project_commit_path(@project.namespace, @project, @commit), class: "monospace visible-xs-inline visible-sm-inline"
45
  = clipboard_button(clipboard_text: @commit.id)
46 47
  %span.cgray= pluralize(@commit.parents.count, "parent")
  - @commit.parents.each do |parent|
Kamil Trzcinski committed
48
    = link_to parent.short_id, namespace_project_commit_path(@project.namespace, @project, parent), class: "monospace"
49

50 51
  %span.commit-info.branches
    %i.fa.fa-spinner.fa-spin
52

53
- if @commit.status
54 55
  .commit-info-row
    Builds for
56
    = pluralize(@commit.pipelines.count, 'pipeline')
57 58
    = link_to builds_namespace_project_commit_path(@project.namespace, @project, @commit.id), class: "ci-status-link ci-status-icon-#{@commit.status}" do
      = ci_icon_for_status(@commit.status)
59 60
      %span.ci-status-label
        = ci_label_for_status(@commit.status)
61 62
    in
    = time_interval_in_words @commit.pipelines.total_duration
63

64
.commit-box.content-block
65
  %h3.commit-title
66
    = markdown escape_once(@commit.title), pipeline: :single_line, author: @commit.author
67 68
  - if @commit.description.present?
    %pre.commit-description
69
      = preserve(markdown(escape_once(@commit.description), pipeline: :single_line, author: @commit.author))
70

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