diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 21:42:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 21:42:06 +0300 |
commit | 6e4e1050d9dba2b7b2523fdd1768823ab85feef4 (patch) | |
tree | 78be5963ec075d80116a932011d695dd33910b4e /app/views/shared/projects/protected_branches | |
parent | 1ce776de4ae122aba3f349c02c17cebeaa8ecf07 (diff) |
Add latest changes from gitlab-org/gitlab@13-3-stable-ee
Diffstat (limited to 'app/views/shared/projects/protected_branches')
-rw-r--r-- | app/views/shared/projects/protected_branches/_update_protected_branch.html.haml | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/app/views/shared/projects/protected_branches/_update_protected_branch.html.haml b/app/views/shared/projects/protected_branches/_update_protected_branch.html.haml new file mode 100644 index 00000000000..eafc402f210 --- /dev/null +++ b/app/views/shared/projects/protected_branches/_update_protected_branch.html.haml @@ -0,0 +1,35 @@ +- merge_access_levels = protected_branch.merge_access_levels.for_role +- push_access_levels = protected_branch.push_access_levels.for_role + +- user_merge_access_levels = protected_branch.merge_access_levels.for_user +- user_push_access_levels = protected_branch.push_access_levels.for_user + +- group_merge_access_levels = protected_branch.merge_access_levels.for_group +- group_push_access_levels = protected_branch.push_access_levels.for_group + +%td.merge_access_levels-container + = hidden_field_tag "allowed_to_merge_#{protected_branch.id}", merge_access_levels.first&.access_level + = dropdown_tag( (merge_access_levels.first&.humanize || 'Select') , + options: { toggle_class: 'js-allowed-to-merge qa-allowed-to-merge', dropdown_class: 'dropdown-menu-selectable js-allowed-to-merge-container capitalize-header', + data: { field_name: "allowed_to_merge_#{protected_branch.id}", preselected_items: access_levels_data(merge_access_levels) }}) + - if user_merge_access_levels.any? + %p.small + = _('The following %{user} can also merge into this branch: %{branch}') % { user: 'user'.pluralize(user_merge_access_levels.size), branch: user_merge_access_levels.map(&:humanize).to_sentence } + + - if group_merge_access_levels.any? + %p.small + = _('Members of %{group} can also merge into this branch: %{branch}') % { group: (group_merge_access_levels.size > 1 ? 'these groups' : 'this group'), branch: group_merge_access_levels.map(&:humanize).to_sentence } + +%td.push_access_levels-container + = hidden_field_tag "allowed_to_push_#{protected_branch.id}", push_access_levels.first&.access_level + = dropdown_tag( (push_access_levels.first&.humanize || 'Select') , + options: { toggle_class: 'js-allowed-to-push', dropdown_class: 'dropdown-menu-selectable js-allowed-to-push-container capitalize-header', + data: { field_name: "allowed_to_push_#{protected_branch.id}", preselected_items: access_levels_data(push_access_levels) }}) + - if user_push_access_levels.any? + %p.small + = _('The following %{user} can also push to this branch: %{branch}') % { user: 'user'.pluralize(user_push_access_levels.size), branch: user_push_access_levels.map(&:humanize).to_sentence } + + - if group_push_access_levels.any? + %p.small + = _('Members of %{group} can also push to this branch: %{branch}') % { group: (group_push_access_levels.size > 1 ? 'these groups' : 'this group'), branch: group_push_access_levels.map(&:humanize).to_sentence } + |