diff options
author | Patricio Cano <suprnova32@gmail.com> | 2016-07-18 17:49:33 -0500 |
---|---|---|
committer | Patricio Cano <suprnova32@gmail.com> | 2016-07-18 17:53:43 -0500 |
commit | 6b8eceda395ae25b7ea189627b04da1f223c57d7 (patch) | |
tree | 89e7030c542055743f67bedfa7f8a35bb540b3ca /app | |
parent | 23afb02aaa957dd1a5ce35a141e4e8ecd80052ca (diff) | |
download | gitlab-ce-6b8eceda395ae25b7ea189627b04da1f223c57d7.tar.gz |
Default to manual input for `domain_whitelist`, syntax fixes and added new tests.
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/admin.js.coffee | 3 | ||||
-rw-r--r-- | app/models/application_setting.rb | 2 | ||||
-rw-r--r-- | app/views/admin/application_settings/_form.html.haml | 8 |
3 files changed, 6 insertions, 7 deletions
diff --git a/app/assets/javascripts/admin.js.coffee b/app/assets/javascripts/admin.js.coffee index 4dd30973d11..d5d34e6eca6 100644 --- a/app/assets/javascripts/admin.js.coffee +++ b/app/assets/javascripts/admin.js.coffee @@ -46,7 +46,6 @@ class @Admin else $('.blacklist-file').hide() $('.blacklist-raw').show() - return - $('input[name=\'blacklist_type\']').click showBlacklistType + $("input[name='blacklist_type']").click showBlacklistType showBlacklistType() diff --git a/app/models/application_setting.rb b/app/models/application_setting.rb index d923b4d5235..8c19d9dc9c8 100644 --- a/app/models/application_setting.rb +++ b/app/models/application_setting.rb @@ -71,7 +71,7 @@ class ApplicationSetting < ActiveRecord::Base inclusion: { in: %w(ssh http), allow_blank: true, allow_nil: true } validates :domain_blacklist, - presence: true, + presence: { message: 'Domain blacklist cannot be empty if Blacklist is enabled.' }, if: :domain_blacklist_enabled? validates_each :restricted_visibility_levels do |record, attr, value| diff --git a/app/views/admin/application_settings/_form.html.haml b/app/views/admin/application_settings/_form.html.haml index 35fea2d8fa9..23b52d08df7 100644 --- a/app/views/admin/application_settings/_form.html.haml +++ b/app/views/admin/application_settings/_form.html.haml @@ -125,7 +125,7 @@ .form-group = f.label :domain_whitelist, 'Whitelisted domains for sign-ups', class: 'control-label col-sm-2' .col-sm-10 - = f.text_area :domain_whitelist_raw, placeholder: 'domain.com', class: 'form-control' + = f.text_area :domain_whitelist_raw, placeholder: 'domain.com', class: 'form-control', rows: 8 .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 .form-group = f.label :domain_blacklist_enabled, 'Domain Blacklist', class: 'control-label col-sm-2' @@ -138,12 +138,12 @@ .col-sm-offset-2.col-sm-10 .radio = label_tag :blacklist_type_file do - = radio_button_tag :blacklist_type, :file, @application_setting.domain_blacklist.blank? + = radio_button_tag :blacklist_type, :file .option-title Upload blacklist file .radio = label_tag :blacklist_type_raw do - = radio_button_tag :blacklist_type, :raw, @application_setting.domain_blacklist.present? + = radio_button_tag :blacklist_type, :raw, @application_setting.domain_blacklist.present? || @application_setting.domain_blacklist.blank? .option-title Enter blacklist manually .form-group.blacklist-file @@ -154,7 +154,7 @@ .form-group.blacklist-raw = f.label :domain_blacklist, 'Blacklisted domains for sign-ups', class: 'control-label col-sm-2' .col-sm-10 - = f.text_area :domain_blacklist_raw, placeholder: 'domain.com', class: 'form-control', rows: 10 + = f.text_area :domain_blacklist_raw, placeholder: 'domain.com', class: 'form-control', rows: 8 .help-block Users with e-mail addresses that match these domain(s) will NOT be able to sign-up. Wildcards allowed. Use separate lines for multiple entries. Ex: domain.com, *.domain.com .form-group |