Add functional in admin section
This commit is contained in:
parent
17ea019f4e
commit
9c574464a6
7 changed files with 106 additions and 19 deletions
|
@ -1,5 +1,5 @@
|
|||
class Admin::GroupsController < AdminController
|
||||
before_filter :group, only: [:edit, :show, :update, :destroy, :project_update]
|
||||
before_filter :group, only: [:edit, :show, :update, :destroy, :project_update, :project_teams_update]
|
||||
|
||||
def index
|
||||
@groups = Group.order('name ASC')
|
||||
|
@ -12,6 +12,8 @@ class Admin::GroupsController < AdminController
|
|||
@projects = @projects.not_in_group(@group) if @group.projects.present?
|
||||
@projects = @projects.all
|
||||
@projects.reject!(&:empty_repo?)
|
||||
|
||||
@users = User.active
|
||||
end
|
||||
|
||||
def new
|
||||
|
@ -65,6 +67,13 @@ class Admin::GroupsController < AdminController
|
|||
redirect_to :back, notice: 'Group was successfully updated.'
|
||||
end
|
||||
|
||||
def project_teams_update
|
||||
@group.projects.each do |p|
|
||||
p.add_users_ids_to_team(params[:user_ids], params[:project_access])
|
||||
end
|
||||
redirect_to [:admin, @group], notice: 'Users was successfully added.'
|
||||
end
|
||||
|
||||
def destroy
|
||||
@group.destroy
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue