_branch.html.haml 1.3 KB
Newer Older
1
- commit = @repository.commit(branch.target)
2
%li(class="js-branch-#{branch.name}")
3
  %h4
4
    = link_to project_tree_path(@project, branch.name) do
5
      %strong.str-truncated= branch.name
6 7 8 9 10
      - if branch.name == @repository.root_ref
        %span.label.label-info default
      - if @project.protected_branch? branch.name
        %span.label.label-success
          %i.icon-lock
11
          protected
12 13
    .pull-right
      - if can?(current_user, :download_code, @project)
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
14
        = render 'projects/repositories/download_archive', ref: branch.name, btn_class: 'btn-grouped btn-group-small'
15
      - if branch.name != @repository.root_ref
16
        = 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
17 18
          %i.icon-copy
          Compare
19

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

24
  - if commit
25 26
    %ul.list-unstyled
      = render 'projects/commits/inline_commit', commit: commit, project: @project
27 28 29
  - else
    %p
      Cant find HEAD commit for this branch