diff --git a/app/helpers/user_teams_helper.rb b/app/helpers/user_teams_helper.rb new file mode 100644 index 00000000000..01e10de52fb --- /dev/null +++ b/app/helpers/user_teams_helper.rb @@ -0,0 +1,26 @@ +module UserTeamsHelper + def team_filter_path(entity, options={}) + exist_opts = { + status: params[:status], + project_id: params[:project_id], + } + + options = exist_opts.merge(options) + + case entity + when 'issue' then + issues_team_path(@user_team, options) + when 'merge_request' + merge_requests_team_path(@user_team, options) + end + end + + def grouped_user_team_members(team) + team.user_team_user_relationships.sort_by(&:permission).reverse.group_by(&:permission) + end + + def remove_from_team_message(team, member) + "You are going to remove #{member.name} from #{team.name}. Are you sure?" + end + +end