Admin area: add multiple users to project

This commit is contained in:
Dmitriy Zaporozhets 2012-01-21 18:06:14 +02:00
parent f6f72d4b22
commit fa8c0c7813
5 changed files with 69 additions and 1 deletions

View file

@ -19,6 +19,24 @@ class Admin::ProjectsController < ApplicationController
@admin_project = Project.find_by_code(params[:id])
end
def team
@admin_project = Project.find_by_code(params[:id])
@users = User.not_in_project(@admin_project).all
end
def team_update
@admin_project = Project.find_by_code(params[:id])
UsersProject.bulk_import(
@admin_project,
params[:user_ids],
params[:project_access],
params[:repo_access]
)
redirect_to [:admin, @admin_project], notice: 'Project was successfully updated.'
end
def create
@admin_project = Project.new(params[:project])
@admin_project.owner = current_user