diff options
author | Michael Kozono <mkozono@gmail.com> | 2017-09-05 22:11:49 -0700 |
---|---|---|
committer | Michael Kozono <mkozono@gmail.com> | 2017-09-06 12:07:21 -0700 |
commit | 45601cbadfd0af6a5ac4ac112129d839265ce3dd (patch) | |
tree | 4b6bf91ed85dc23735eb1d66ddc766da0fc9821c /app/helpers/groups_helper.rb | |
parent | a4b564b6200582b6d3700a5e77e0c11fc5cac011 (diff) | |
download | gitlab-ce-45601cbadfd0af6a5ac4ac112129d839265ce3dd.tar.gz |
Link to ancestor settings page
Diffstat (limited to 'app/helpers/groups_helper.rb')
-rw-r--r-- | app/helpers/groups_helper.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/app/helpers/groups_helper.rb b/app/helpers/groups_helper.rb index f865cd133ad..f7e6eb350cd 100644 --- a/app/helpers/groups_helper.rb +++ b/app/helpers/groups_helper.rb @@ -104,6 +104,12 @@ module GroupsHelper link_to ancestor.name, group_path(ancestor) end + def remove_the_share_lock_from_ancestor_link(group) + ancestor = oldest_consecutively_locked_ancestor(group) + link_text = s_("GroupSettings|remove the share lock from %{ancestor_group_name}") % { ancestor_group_name: ancestor.name } + link_to link_text, edit_group_path(ancestor) + end + def oldest_consecutively_locked_ancestor(group) group.ancestors.find do |group| !group.has_parent? || !group.parent.share_with_group_lock? @@ -115,7 +121,7 @@ module GroupsHelper end def ancestor_locked_but_you_can_override(group) - s_("GroupSettings|This setting is applied on %{ancestor_group}. You can override the setting or remove the share lock from %{ancestor_group}.") % { ancestor_group: ancestor_group_link(group) } + s_("GroupSettings|This setting is applied on %{ancestor_group}. You can override the setting or %{remove_ancestor_share_lock}.") % { ancestor_group: ancestor_group_link(group), remove_ancestor_share_lock: remove_the_share_lock_from_ancestor_link(group) } end def ancestor_locked_so_ask_the_owner(group) |