Welcome to mirror list, hosted at ThFree Co, Russian Federation.

_update_protected_branch.html.haml « protected_branches « projects « shared « views « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d10196a83cc830649a916c7d145ca4026c0f2fc2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
- 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', 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 js-multiselect", 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 }

%td
  = render Pajamas::ToggleComponent.new(classes: 'js-force-push-toggle',
    label: s_("ProtectedBranch|Toggle allowed to force push"),
    is_checked: protected_branch.allow_force_push,
    label_position: :hidden)