BigW Consortium Gitlab

_commit_box.html.haml 3.47 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
        %span.hidden-xs Options
17
        = icon('caret-down', class: ".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
        - 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)
27 28
        %li.clearfix
          = link_to "Tag", new_namespace_project_tag_path(@project.namespace, @project, ref: @commit)
29 30 31
        %li.divider
        %li.dropdown-header
          Download
32 33
        - unless @commit.parents.length > 1
          %li= link_to "Email Patches", namespace_project_commit_path(@project.namespace, @project, @commit, format: :patch)
Vinnie Okada committed
34
        %li= link_to "Plain Diff",    namespace_project_commit_path(@project.namespace, @project, @commit, format: :diff)
randx committed
35

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

.commit-info-row
Phil Hughes committed
44 45 46
  %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"
47
  = clipboard_button(clipboard_text: @commit.id)
48 49
  %span.cgray= pluralize(@commit.parents.count, "parent")
  - @commit.parents.each do |parent|
Kamil Trzcinski committed
50
    = link_to parent.short_id, namespace_project_commit_path(@project.namespace, @project, parent), class: "monospace"
51

52 53
  %span.commit-info.branches
    %i.fa.fa-spinner.fa-spin
54

55
- if @commit.status
56 57
  .commit-info-row
    Builds for
58
    = pluralize(@commit.pipelines.count, 'pipeline')
59 60
    = 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)
61 62
      %span.ci-status-label
        = ci_label_for_status(@commit.status)
63 64
    in
    = time_interval_in_words @commit.pipelines.total_duration
65

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

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