gitlab-org--gitlab-foss/app/helpers/user_teams_helper.rb

27 lines
642 B
Ruby
Raw Normal View History

2013-01-19 12:55:59 -05:00
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
2013-01-23 09:14:53 -05:00
issues_team_path(@team, options)
2013-01-19 12:55:59 -05:00
when 'merge_request'
2013-01-23 09:14:53 -05:00
merge_requests_team_path(@team, options)
2013-01-19 12:55:59 -05:00
end
end
def grouped_user_team_members(team)
team.user_team_user_relationships.sort_by(&:permission).reverse.group_by(&:permission)
end
def remove_from_user_team_message(team, member)
2013-01-19 12:55:59 -05:00
"You are going to remove #{member.name} from #{team.name}. Are you sure?"
end
end