diff options
author | Mike Greiling <mike@pixelcog.com> | 2017-08-30 15:08:30 -0500 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2017-08-30 15:08:30 -0500 |
commit | 6dd69950edf6b98600d0bead148969ef347bc1ec (patch) | |
tree | 1c35e2ff7f2f867f14fd53ce686eedeb4373e7c1 /app/helpers | |
parent | b1a14f5fc94aa900e06aaddb3d13a5775ccffc54 (diff) | |
download | gitlab-ce-6dd69950edf6b98600d0bead148969ef347bc1ec.tar.gz |
add links and instructions to disabled visibility option help text
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/visibility_level_helper.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/app/helpers/visibility_level_helper.rb b/app/helpers/visibility_level_helper.rb index 19550d37b2f..569872e528b 100644 --- a/app/helpers/visibility_level_helper.rb +++ b/app/helpers/visibility_level_helper.rb @@ -82,17 +82,22 @@ module VisibilityLevelHelper def disallowed_project_visibility_level_description(level, project) level_name = Gitlab::VisibilityLevel.level_name(level).downcase reasons = [] + instructions = '' unless project.visibility_level_allowed_as_fork?(level) reasons << "the fork source project has lower visibility" end unless project.visibility_level_allowed_by_group?(level) - reasons << "the visibility of #{project.group.name} is #{project.group.visibility}" + group = link_to project.group.name, group_path(project.group) + change_visiblity = link_to 'change the visibility', edit_group_path(project.group) + + reasons << "the visibility of #{group} is #{project.group.visibility}" + instructions << " To make this project #{level_name}, you must first #{change_visiblity} of the parent group." end reasons = reasons.any? ? ' because ' + reasons.to_sentence : '' - "This project cannot be #{level_name}#{reasons}." + "This project cannot be #{level_name}#{reasons}.#{instructions}".html_safe end # Note: these messages closely mirror the form validation strings found in the group |