User Teams specific code moved to user_teams controller
This commit is contained in:
parent
b49cfbc1d5
commit
6172390007
|
@ -1,11 +1,3 @@
|
||||||
class Projects::ApplicationController < ApplicationController
|
class Projects::ApplicationController < ApplicationController
|
||||||
|
|
||||||
before_filter :authorize_admin_team_member!
|
|
||||||
|
|
||||||
protected
|
|
||||||
|
|
||||||
def user_team
|
|
||||||
@team ||= UserTeam.find_by_path(params[:id])
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
class Projects::TeamsController < Projects::ApplicationController
|
class Projects::TeamsController < Projects::ApplicationController
|
||||||
|
|
||||||
|
before_filter :authorize_admin_team_member!
|
||||||
|
|
||||||
def available
|
def available
|
||||||
@teams = current_user.is_admin? ? UserTeam.scoped : current_user.user_teams
|
@teams = current_user.is_admin? ? UserTeam.scoped : current_user.user_teams
|
||||||
@teams = @teams.without_project(project)
|
@teams = @teams.without_project(project)
|
||||||
|
@ -24,4 +26,9 @@ class Projects::TeamsController < Projects::ApplicationController
|
||||||
redirect_to project_team_index_path(project)
|
redirect_to project_team_index_path(project)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
protected
|
||||||
|
|
||||||
|
def user_team
|
||||||
|
@team ||= UserTeam.find_by_path(params[:id])
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue