_visibility_and_access.html.haml 3.42 KB
Newer Older
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
= form_for @application_setting, url: admin_application_settings_path, html: { class: 'form-horizontal fieldset-form' } do |f|
  = form_errors(@application_setting)
  .form-group
    = f.label :default_branch_protection, class: 'control-label col-sm-2'
    .col-sm-10
      = f.select :default_branch_protection, options_for_select(Gitlab::Access.protection_options, @application_setting.default_branch_protection), {}, class: 'form-control'
  .form-group.visibility-level-setting
    = f.label :default_project_visibility, class: 'control-label col-sm-2'
    .col-sm-10
      = render('shared/visibility_radios', model_method: :default_project_visibility, form: f, selected_level: @application_setting.default_project_visibility, form_model: Project.new)
  .form-group.visibility-level-setting
    = f.label :default_snippet_visibility, class: 'control-label col-sm-2'
    .col-sm-10
      = render('shared/visibility_radios', model_method: :default_snippet_visibility, form: f, selected_level: @application_setting.default_snippet_visibility, form_model: ProjectSnippet.new)
  .form-group.visibility-level-setting
    = f.label :default_group_visibility, class: 'control-label col-sm-2'
    .col-sm-10
      = render('shared/visibility_radios', model_method: :default_group_visibility, form: f, selected_level: @application_setting.default_group_visibility, form_model: Group.new)
  .form-group
    = f.label :restricted_visibility_levels, class: 'control-label col-sm-2'
    .col-sm-10
      - checkbox_name = 'application_setting[restricted_visibility_levels][]'
      = hidden_field_tag(checkbox_name)
      - restricted_level_checkboxes('restricted-visibility-help', checkbox_name).each do |level|
        .checkbox
          = level
      %span.help-block#restricted-visibility-help
        Selected levels cannot be used by non-admin users for projects or snippets.
        If the public level is restricted, user profiles are only visible to logged in users.
  .form-group
    = f.label :import_sources, class: 'control-label col-sm-2'
    .col-sm-10
      - import_sources_checkboxes('import-sources-help').each do |source|
        .checkbox= source
      %span.help-block#import-sources-help
        Enabled sources for code import during project creation. OmniAuth must be configured for GitHub
        = link_to "(?)", help_page_path("integration/github")
        , Bitbucket
        = link_to "(?)", help_page_path("integration/bitbucket")
        and GitLab.com
        = link_to "(?)", help_page_path("integration/gitlab")

  .form-group
    .col-sm-offset-2.col-sm-10
      .checkbox
        = f.label :project_export_enabled do
          = f.check_box :project_export_enabled
          Project export enabled

  .form-group
    %label.control-label.col-sm-2 Enabled Git access protocols
    .col-sm-10
      = select(:application_setting, :enabled_git_access_protocol, [['Both SSH and HTTP(S)', nil], ['Only SSH', 'ssh'], ['Only HTTP(S)', 'http']], {}, class: 'form-control')
      %span.help-block#clone-protocol-help
        Allow only the selected protocols to be used for Git access.

  - ApplicationSetting::SUPPORTED_KEY_TYPES.each do |type|
    - field_name = :"#{type}_key_restriction"
    .form-group
      = f.label field_name, "#{type.upcase} SSH keys", class: 'control-label col-sm-2'
      .col-sm-10
        = f.select field_name, key_restriction_options_for_select(type), {}, class: 'form-control'
  .form-actions
64
    = f.submit 'Save changes', class: "btn btn-success"