diff options
author | Nick Thomas <nick@gitlab.com> | 2017-08-30 21:20:00 +0100 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2017-08-30 21:20:00 +0100 |
commit | 29b40db58944a32db6cf1ae9906653a2e5f4be9d (patch) | |
tree | e5a8746dfbbbae708178f3e60bd6be1d41c518f8 /app | |
parent | eb05bdc6f589f6f0713df12582eb9f18fc4022b3 (diff) | |
download | gitlab-ce-29b40db58944a32db6cf1ae9906653a2e5f4be9d.tar.gz |
More review comments
Diffstat (limited to 'app')
-rw-r--r-- | app/helpers/form_helper.rb | 1 | ||||
-rw-r--r-- | app/models/application_setting.rb | 2 | ||||
-rw-r--r-- | app/views/profiles/keys/_key.html.haml | 4 |
3 files changed, 4 insertions, 3 deletions
diff --git a/app/helpers/form_helper.rb b/app/helpers/form_helper.rb index eeb130d5240..b5dece38de1 100644 --- a/app/helpers/form_helper.rb +++ b/app/helpers/form_helper.rb @@ -3,7 +3,6 @@ module FormHelper return unless model.errors.any? pluralized = 'error'.pluralize(model.errors.count) - headline = "The #{type} contains the following #{pluralized}:" content_tag(:div, class: 'alert alert-danger', id: 'error_explanation') do diff --git a/app/models/application_setting.rb b/app/models/application_setting.rb index 2c61717d0e0..3568e72e463 100644 --- a/app/models/application_setting.rb +++ b/app/models/application_setting.rb @@ -155,6 +155,8 @@ class ApplicationSetting < ActiveRecord::Base validates :"#{type}_key_restriction", presence: true, key_restriction: { type: type } end + validates :allowed_key_types, presence: true + validates_each :restricted_visibility_levels do |record, attr, value| value&.each do |level| unless Gitlab::VisibilityLevel.options.value?(level) diff --git a/app/views/profiles/keys/_key.html.haml b/app/views/profiles/keys/_key.html.haml index 99b9a05fff6..103446243e5 100644 --- a/app/views/profiles/keys/_key.html.haml +++ b/app/views/profiles/keys/_key.html.haml @@ -3,8 +3,8 @@ - if key.valid? = icon 'key', class: 'settings-list-icon hidden-xs' - else - = icon 'exclamation-triangle', class: 'settings-list-icon hidden-xs', - title: 'The key is disabled because it is invalid' + = icon 'exclamation-triangle', class: 'settings-list-icon hidden-xs has-tooltip', + title: key.errors.full_messages.join(', ') .key-list-item-info |