Commit e9e16258 authored by Timothy Andrew's avatar Timothy Andrew Committed by Alfredo Sumaran

Remove access level editing from the `ProtectedBranches#show` page.

1. This has been moved to the `#index` page.
parent 1565a370
......@@ -26,7 +26,6 @@ class Projects::ProtectedBranchesController < Projects::ApplicationController
def show
@matching_branches = @protected_branch.matching(@project.repository.branches)
load_gon_show
end
def update
......@@ -82,10 +81,4 @@ class Projects::ProtectedBranchesController < Projects::ApplicationController
params.merge!(current_project_id: @project.id) if @project
gon.push(params.merge(access_levels_options))
end
def load_gon_show
params = {}
params.merge!(current_project_id: @project.id) if @project
gon.push(params.merge(access_levels_options))
end
end
- url = namespace_project_protected_branch_path(@project.namespace, @project, @protected_branch)
%h5 Access Settings
.form-group.allowed-to-merge-container
.prepend-left-10
%h5.label-light.append-bottom-20 Allowed to merge
- if @protected_branch.merge_access_levels.present?
.table-responsive
%table.table.protected-branch-merge-access-list
%colgroup
%col{ width: "70%" }
%col{ width: "30%" }
%thead
%tr
%th User / Role
%th
%tbody
- @protected_branch.merge_access_levels.each do |access_level|
%tr
%td= access_level.humanize
%td
%button.btn.btn-sm.btn-warning.pull-right= link_to "Delete", namespace_project_protected_branch_merge_access_level_path(@project.namespace, @project, @protected_branch, access_level), method: :delete, data: { confirm: "Are you sure?" }
- else
%p.settings-message.text-center
No merge access settings have been created yet.
= dropdown_tag("Add new", options: { toggle_class: 'allowed-to-merge btn btn-success btn-sm', toggle_link: true,
dropdown_class: 'dropdown-menu-selectable dropdown-menu-user', filter: true,
data: { url: url, type: 'merge_access_levels' }})
.form-group.allowed-to-push-container
.prepend-left-10.prepend-top-10
%h5.label-light.append-bottom-20 Allowed to push
- if @protected_branch.push_access_levels.present?
.table-responsive
%table.table.protected-branch-push-access-list
%colgroup
%col{ width: "70%" }
%col{ width: "30%" }
%thead
%tr
%th User / Role
%th
%tbody
- @protected_branch.push_access_levels.each do |access_level|
%tr
%td= access_level.humanize
%td
%button.btn.btn-sm.btn-warning.pull-right= link_to "Delete", namespace_project_protected_branch_push_access_level_path(@project.namespace, @project, @protected_branch, access_level), method: :delete, data: { confirm: "Are you sure?" }
- else
%p.settings-message.text-center
No push access settings have been created yet.
= dropdown_tag("Add new",
options: { toggle_class: 'allowed-to-push btn btn-success btn-sm', toggle_link: true,
dropdown_class: 'dropdown-menu-selectable dropdown-menu-user', filter: true,
data: { url: url, type: 'push_access_levels' }})
......@@ -6,10 +6,6 @@
= @protected_branch.name
.col-lg-9.edit_protected_branch
= render 'access_settings'
%hr
%h5 Matching Branches
- if @matching_branches.present?
.table-responsive
......@@ -27,6 +23,3 @@
- else
%p.settings-message.text-center
Couldn't find any matching branches.
:javascript
new ProtectedBranchesAccessSelect($(".edit_protected_branch"), true);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment