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