commit user team helper
This commit is contained in:
parent
17e9207dff
commit
a987f1469e
1 changed files with 26 additions and 0 deletions
26
app/helpers/user_teams_helper.rb
Normal file
26
app/helpers/user_teams_helper.rb
Normal file
|
@ -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
|
Loading…
Reference in a new issue