summaryrefslogtreecommitdiff
path: root/app/views/projects/protected_branches/shared/_index.html.haml
blob: 1d3e3fb11aee365e54552f3c163aa81bc9bc731c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
- expanded = expanded_by_default?

%section.settings.no-animate#js-protected-branches-settings{ class: ('expanded' if expanded), data: { qa_selector: 'protected_branches_settings_content' } }
  .settings-header
    %h4
      Protected branches
    %button.btn.js-settings-toggle.qa-expand-protected-branches{ type: 'button' }
      = expanded ? 'Collapse' : 'Expand'
    %p
      Keep stable branches secure, and force developers to use merge requests. #{link_to "What are protected branches?", help_page_path("user/project/protected_branches")}
  .settings-content
    %p
      By default, protected branches protect your code and:
      %ul
        %li Allow only users with Maintainer #{link_to "permissions", help_page_path("user/permissions")} to create new protected branches.
        %li Allow only users with Maintainer permissions to push code.
        %li Prevent <strong>anyone</strong> from force-pushing to the branch.
        %li Prevent <strong>anyone</strong> from deleting the branch.

    - if can? current_user, :admin_project, @project
      = content_for :create_protected_branch

    = content_for :branches_list