Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRubén Dávila <ruben@gitlab.com>2017-08-29 08:49:01 +0300
committerRubén Dávila <ruben@gitlab.com>2017-08-29 08:53:35 +0300
commit6f03ddcdc3af1fbb840498a0e4765458079f0b0f (patch)
tree9301cd3835e573d491dd8799533799365df996bd /app/helpers/visibility_level_helper.rb
parent0a8d0924fe9a1525b92423411dc1bfcdc9760833 (diff)
Address some suggestions from first code review
Diffstat (limited to 'app/helpers/visibility_level_helper.rb')
-rw-r--r--app/helpers/visibility_level_helper.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/app/helpers/visibility_level_helper.rb b/app/helpers/visibility_level_helper.rb
index 347f796fdc1..caadc12019c 100644
--- a/app/helpers/visibility_level_helper.rb
+++ b/app/helpers/visibility_level_helper.rb
@@ -65,7 +65,7 @@ module VisibilityLevelHelper
def restricted_visibility_level_description(level)
level_name = Gitlab::VisibilityLevel.level_name(level)
- "#{level_name.capitalize} visibilitiy has been restricted by the administrator."
+ "#{level_name.capitalize} visibility has been restricted by the administrator."
end
def disallowed_visibility_level_description(level, form_model)
@@ -82,11 +82,11 @@ module VisibilityLevelHelper
reasons = []
unless project.visibility_level_allowed_as_fork?(level)
- reasons << "the fork source project has lower visibility"
+ reasons << project.visibility_error_for(:fork, level: level_name)
end
unless project.visibility_level_allowed_by_group?(level)
- reasons << "the visibility of #{project.group.name} is #{project.group.visibility}"
+ reasons << project.visibility_error_for(:group, level: level_name, group_level: project.group.visibility)
end
reasons = reasons.any? ? ' because ' + reasons.to_sentence : ''
@@ -98,15 +98,15 @@ module VisibilityLevelHelper
reasons = []
unless group.visibility_level_allowed_by_projects?(level)
- reasons << "it contains projects with higher visibility"
+ reasons << group.visibility_error_for(:projects, level: level_name)
end
unless group.visibility_level_allowed_by_sub_groups?(level)
- reasons << "it contains sub-groups with higher visibility"
+ reasons << group.visibility_error_for(:sub_groups, level: level_name)
end
unless group.visibility_level_allowed_by_parent?(level)
- reasons << "the visibility of its parent group is #{group.parent.visibility}"
+ reasons << group.visibility_error_for(:parent, level: level_name, parent_level: group.parent.visibility)
end
reasons = reasons.any? ? ' because ' + reasons.to_sentence : ''