BigW Consortium Gitlab

_branch.html.haml 1.51 KB
Newer Older
1
- commit = @repository.commit(branch.target)
2 3 4 5 6 7 8 9 10 11 12
%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)
13
        = render 'projects/repositories/download_archive', ref: branch.name, btn_class: 'btn-grouped btn-group-small'
14
      - if branch.name != @repository.root_ref
15
        = link_to project_compare_index_path(@project, from: @repository.root_ref, to: branch.name), class: 'btn btn-grouped btn-small', method: :post, title: "Compare" do
16 17
          %i.icon-copy
          Compare
18

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

23 24 25 26 27 28 29 30 31 32 33
  - if commit
    %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)}
  - else
    %p
      Cant find HEAD commit for this branch