Commit a987f1469e2480559b675c251d49509f6200112f
Committed by
Dmitriy Zaporozhets
1 parent
17e9207d
Exists in
master
and in
4 other branches
commit user team helper
Showing
1 changed file
with
26 additions
and
0 deletions
Show diff stats
... | ... | @@ -0,0 +1,26 @@ |
1 | +module UserTeamsHelper | |
2 | + def team_filter_path(entity, options={}) | |
3 | + exist_opts = { | |
4 | + status: params[:status], | |
5 | + project_id: params[:project_id], | |
6 | + } | |
7 | + | |
8 | + options = exist_opts.merge(options) | |
9 | + | |
10 | + case entity | |
11 | + when 'issue' then | |
12 | + issues_team_path(@user_team, options) | |
13 | + when 'merge_request' | |
14 | + merge_requests_team_path(@user_team, options) | |
15 | + end | |
16 | + end | |
17 | + | |
18 | + def grouped_user_team_members(team) | |
19 | + team.user_team_user_relationships.sort_by(&:permission).reverse.group_by(&:permission) | |
20 | + end | |
21 | + | |
22 | + def remove_from_team_message(team, member) | |
23 | + "You are going to remove #{member.name} from #{team.name}. Are you sure?" | |
24 | + end | |
25 | + | |
26 | +end | ... | ... |