summaryrefslogtreecommitdiff
path: root/app/views/projects/protected_branches/index.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/index.html.haml
parent84af3ceb9bbcbf171f92d01967670bf079012f23 (diff)
downloadgitlab-ce-2cbfc515f22e2064fb29c9cbb8326a132a3515fc.tar.gz
Move protected branches list to a partial.
Diffstat (limited to 'app/views/projects/protected_branches/index.html.haml')
-rw-r--r--app/views/projects/protected_branches/index.html.haml38
1 files changed, 6 insertions, 32 deletions
diff --git a/app/views/projects/protected_branches/index.html.haml b/app/views/projects/protected_branches/index.html.haml
index 183f25bfc82..2164c874c74 100644
--- a/app/views/projects/protected_branches/index.html.haml
+++ b/app/views/projects/protected_branches/index.html.haml
@@ -23,39 +23,13 @@
.col-sm-10
= f.select(:name, @project.open_branches.map { |br| [br.name, br.name] } , {include_blank: "Select branch"}, {class: "select2"})
.form-group
- = f.label :developers_can_push, "Developers can push?", class: 'control-label'
+ = f.label :developers_can_push, class: 'control-label' do
+ Developers can push
.col-sm-10
- = f.check_box :developers_can_push
+ .checkbox
+ = f.check_box :developers_can_push
+ %span.descr Allow developers to push to this branch
.form-actions
= f.submit 'Protect', class: "btn-create btn"
-- unless @branches.empty?
- %h5 Already Protected:
- %ul.bordered-list.protected-branches-list
- - @branches.each do |branch|
- %li
- %h4
- = link_to project_commits_path(@project, branch.name) do
- %strong= branch.name
- - if @project.root_ref?(branch.name)
- %span.label.label-info default
- %span.label.label-success
- %i.fa.fa-lock
- - if branch.developers_can_push
- %span.label.label-warning
- %i.fa.fa-group
- .pull-right
- - if can? current_user, :admin_project, @project
- - if branch.developers_can_push
- = link_to 'Disable developers push', [@project, branch, { developers_can_push: false }], data: { confirm: 'Branch will be no longer writable for developers. Are you sure?' }, method: :put, class: "btn btn-grouped btn-small"
- - else
- = link_to 'Allow developers to push', [@project, branch, { developers_can_push: true }], data: { confirm: 'Branch will be writable for developers. Are you sure?' }, method: :put, class: "btn btn-grouped btn-small"
- = link_to 'Unprotect', [@project, branch], data: { confirm: 'Branch will be writable for developers. Are you sure?' }, method: :delete, class: "btn btn-remove btn-small"
+= render 'branches_list'
- - 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)