From 24fde6f1096074cc596a3fbab0165f682a554e82 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Thu, 24 Dec 2009 16:14:15 +0000 Subject: [PATCH] Hide "Groups" tab on user form if no group exist. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3237 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/helpers/users_helper.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index 9581bbdc..757a91a9 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -47,8 +47,11 @@ module UsersHelper def user_settings_tabs tabs = [{:name => 'general', :partial => 'users/general', :label => :label_general}, - {:name => 'groups', :partial => 'users/groups', :label => :label_group_plural}, {:name => 'memberships', :partial => 'users/memberships', :label => :label_project_plural} ] + if Group.all.any? + tabs.insert 1, {:name => 'groups', :partial => 'users/groups', :label => :label_group_plural} + end + tabs end end