_form.html.haml 5.9 KB
Newer Older
1 2 3 4 5 6 7
= form_for @application_setting, url: admin_application_settings_path, html: { class: 'form-horizontal fieldset-form' } do |f|
  - if @application_setting.errors.any?
    #error_explanation
      .alert.alert-danger
        - @application_setting.errors.full_messages.each do |msg|
          %p= msg

8
  %fieldset
9
    %legend Visibility and Access Controls
10
    .form-group
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
      = 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.project-visibility-level-holder
      = 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')
    .form-group.project-visibility-level-holder
      = 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: 'Snippet')
    .form-group
      = f.label :restricted_visibility_levels, class: 'control-label col-sm-2'
      .col-sm-10
        - data_attrs = { toggle: 'buttons' }
        .btn-group{ data: data_attrs }
          - restricted_level_checkboxes('restricted-visibility-help').each do |level|
            = level
        %span.help-block#restricted-visibility-help Selected levels cannot be used by non-admin users for projects or snippets
30 31 32 33 34 35 36 37 38 39 40 41 42 43
    .form-group
      = f.label :import_sources, class: 'control-label col-sm-2'
      .col-sm-10
        - data_attrs = { toggle: 'buttons' }
        .btn-group{ data: data_attrs }
          - import_sources_checkboxes('import-sources-help').each do |source|
            = 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")
44
    .form-group
45 46
      .col-sm-offset-2.col-sm-10
        .checkbox
47 48 49 50 51 52
          = f.label :version_check_enabled do
            = f.check_box :version_check_enabled
            Version check enabled

  %fieldset
    %legend Account and Limit Settings
53
    .form-group
54 55 56 57 58
      .col-sm-offset-2.col-sm-10
        .checkbox
          = f.label :gravatar_enabled do
            = f.check_box :gravatar_enabled
            Gravatar enabled
59
    .form-group
60 61 62 63
      .col-sm-offset-2.col-sm-10
        .checkbox
          = f.label :twitter_sharing_enabled do
            = f.check_box :twitter_sharing_enabled, :'aria-describedby' => 'twitter_help_block'
64
            Twitter enabled
65
          %span.help-block#twitter_help_block Show users a button to share their newly created public or internal projects on twitter
66
    .form-group
67
      = f.label :default_projects_limit, class: 'control-label col-sm-2'
68 69
      .col-sm-10
        = f.number_field :default_projects_limit, class: 'form-control'
70
    .form-group
71
      = f.label :max_attachment_size, 'Maximum attachment size (MB)', class: 'control-label col-sm-2'
V
Vinnie Okada 已提交
72
      .col-sm-10
73 74 75
        = f.number_field :max_attachment_size, class: 'form-control'
    .form-group
      = f.label :session_expire_delay, 'Session duration (minutes)', class: 'control-label col-sm-2'
V
Vinnie Okada 已提交
76
      .col-sm-10
77 78
        = f.number_field :session_expire_delay, class: 'form-control'
        %span.help-block#session_expire_delay_help_block GitLab restart is required to apply changes
79
    .form-group
80
      = f.label :user_oauth_applications, 'User OAuth applications', class: 'control-label col-sm-2'
81
      .col-sm-10
82 83 84 85 86 87 88 89 90 91
        .checkbox
          = f.label :user_oauth_applications do
            = f.check_box :user_oauth_applications
            Allow users to register any application to use GitLab as an OAuth provider

  %fieldset
    %legend Sign-in Restrictions
    .form-group
      .col-sm-offset-2.col-sm-10
        .checkbox
92 93 94
          = f.label :signup_enabled do
            = f.check_box :signup_enabled
            Sign-up enabled
95 96 97 98 99 100
    .form-group
      .col-sm-offset-2.col-sm-10
        .checkbox
          = f.label :signin_enabled do
            = f.check_box :signin_enabled
            Sign-in enabled
101 102 103 104 105
    .form-group
      = f.label :restricted_signup_domains, 'Restricted domains for sign-ups', class: 'control-label col-sm-2'
      .col-sm-10
        = f.text_area :restricted_signup_domains_raw, placeholder: 'domain.com', class: 'form-control'
        .help-block Only users with e-mail addresses that match these domain(s) will be able to sign-up. Wildcards allowed. Use separate lines for multiple entries. Ex: domain.com, *.domain.com
106
    .form-group
107
      = f.label :home_page_url, 'Home page URL', class: 'control-label col-sm-2'
108
      .col-sm-10
109 110
        = f.text_field :home_page_url, class: 'form-control', placeholder: 'http://company.example.com', :'aria-describedby' => 'home_help_block'
        %span.help-block#home_help_block We will redirect non-logged in users to this page
111 112 113 114 115
    .form-group
      = f.label :after_sign_out_path, class: 'control-label col-sm-2'
      .col-sm-10
        = f.text_field :after_sign_out_path, class: 'form-control', placeholder: 'http://company.example.com', :'aria-describedby' => 'after_sign_out_path_help_block'
        %span.help-block#after_sign_out_path_help_block We will redirect users to this page after they sign out
116
    .form-group
117
      = f.label :sign_in_text, class: 'control-label col-sm-2'
118
      .col-sm-10
119 120
        = f.text_area :sign_in_text, class: 'form-control', rows: 4
        .help-block Markdown enabled
121

122 123
  .form-actions
    = f.submit 'Save', class: 'btn btn-primary'