summaryrefslogtreecommitdiff
path: root/app/views/projects/protected_branches/_branches_list.html.haml
diff options
context:
space:
mode:
authorMarin Jankovski <maxlazio@gmail.com>2014-12-26 15:36:35 +0100
committerMarin Jankovski <maxlazio@gmail.com>2014-12-26 15:36:35 +0100
commit2cbfc515f22e2064fb29c9cbb8326a132a3515fc (patch)
tree4898792667089bed98cf1de687fd0f09921b75ec /app/views/projects/protected_branches/_branches_list.html.haml
parent84af3ceb9bbcbf171f92d01967670bf079012f23 (diff)
downloadgitlab-ce-2cbfc515f22e2064fb29c9cbb8326a132a3515fc.tar.gz
Move protected branches list to a partial.
Diffstat (limited to 'app/views/projects/protected_branches/_branches_list.html.haml')
-rw-r--r--app/views/projects/protected_branches/_branches_list.html.haml36
1 files changed, 36 insertions, 0 deletions
diff --git a/app/views/projects/protected_branches/_branches_list.html.haml b/app/views/projects/protected_branches/_branches_list.html.haml
new file mode 100644
index 00000000000..1bae1938c27
--- /dev/null
+++ b/app/views/projects/protected_branches/_branches_list.html.haml
@@ -0,0 +1,36 @@
+- unless @branches.empty?
+ %h5 Already Protected:
+ %table.table.protected-branches-list
+ %thead
+ %tr
+ %th{style: "border:0;"} Branch
+ %th{style: "border:0;"} Developers can push
+ %th{style: "border:0;"}
+
+ %tbody
+ - @branches.each do |branch|
+ - @url = project_protected_branch_path(@project, branch)
+ %tr
+ %td
+ = link_to project_commits_path(@project, branch.name) do
+ %strong= branch.name
+ - if @project.root_ref?(branch.name)
+ %span.label.label-info default
+ %td
+ = check_box_tag "developers_can_push", branch.id, branch.developers_can_push, "data-url" => @url
+ %td
+ .pull-right
+ - if can? current_user, :admin_project, @project
+ = link_to 'Unprotect', [@project, branch], data: { confirm: 'Branch will be writable for developers. Are you sure?' }, method: :delete, class: "btn btn-remove btn-small"
+ %tr
+ %td{style: "border:0;"}
+ - if commit = branch.commit
+ = link_to project_commit_path(@project, commit.id), class: 'commit_short_id' do
+ = commit.short_id
+ %span.light
+ = gfm escape_once(truncate(commit.title, length: 40))
+ #{time_ago_with_tooltip(commit.committed_date)}
+ - else
+ (branch was removed from repository)
+ %td{style: "border:0;"}
+ %td{style: "border:0;"}