summaryrefslogtreecommitdiff
path: root/app/views/projects/branches/_branch.html.haml
blob: b41942baf4090d668f9d1d1509b1c1c662e9838e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
- commit = Commit.new(Gitlab::Git::Commit.new(branch.commit))
%li
  %h4
    = link_to project_commits_path(@project, branch.name) do
      %strong= truncate(branch.name, length: 60)
      - if branch.name == @repository.root_ref
        %span.label.label-info default
      - if @project.protected_branch? branch.name
        %span.label.label-success
          %i.icon-lock
    .pull-right
      - if can?(current_user, :download_code, @project)
        = link_to archive_project_repository_path(@project, ref: branch.name), class: 'btn grouped btn-small' do
          %i.icon-download-alt
          Download
      = link_to project_compare_index_path(@project, from: branch.name, to: branch.name), class: 'btn grouped btn-small', title: "Compare" do
        %i.icon-copy
        Compare

      - if can?(current_user, :admin_project, @project) && branch.name != @repository.root_ref
        = link_to project_branch_path(@project, branch.name), class: 'btn grouped btn-small remove-row', method: :delete, data: { confirm: 'Removed branch cannot be restored. Are you sure?'}, remote: true do
          %i.icon-trash

  %p
    = link_to project_commit_path(@project, commit.id), class: 'commit_short_id' do
      = commit.short_id
    = image_tag avatar_icon(commit.author_email), class: "avatar s16", alt: ''
    %span.light
      = gfm escape_once(truncate(commit.title, length: 40))
    #{time_ago_with_tooltip(commit.committed_date)} ago