BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
c5a48a6a
Commit
c5a48a6a
authored
Jan 21, 2012
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add users to project from admin area easily
parent
fa8c0c78
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
39 deletions
+40
-39
projects_controller.rb
app/controllers/admin/projects_controller.rb
+6
-5
show.html.haml
app/views/admin/projects/show.html.haml
+34
-4
team.html.haml
app/views/admin/projects/team.html.haml
+0
-30
No files found.
app/controllers/admin/projects_controller.rb
View file @
c5a48a6a
...
...
@@ -9,6 +9,12 @@ class Admin::ProjectsController < ApplicationController
def
show
@admin_project
=
Project
.
find_by_code
(
params
[
:id
])
@users
=
if
@admin_project
.
users
.
empty?
User
else
User
.
not_in_project
(
@admin_project
)
end
.
all
end
def
new
...
...
@@ -19,11 +25,6 @@ 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
])
...
...
app/views/admin/projects/show.html.haml
View file @
c5a48a6a
...
...
@@ -38,6 +38,23 @@
%h2
Team
=
form_tag
team_update_admin_project_path
(
@admin_project
),
:class
=>
"bulk_import"
,
:method
=>
:put
do
%table
%thead
%tr
%th
Users
%th
Project Access:
%th
Repo Access:
%tr
%td
=
select_tag
:user_ids
,
options_from_collection_for_select
(
@users
,
:id
,
:name
),
:multiple
=>
true
%td
=
select_tag
:project_access
,
options_for_select
(
Project
.
access_options
),
:class
=>
"project-access-select"
%td
=
select_tag
:repo_access
,
options_for_select
(
Repository
.
access_options
),
:class
=>
"repo-access-select"
%tr
%td
{
:colspan
=>
3
}
=
submit_tag
'Add'
,
:class
=>
"positive-button"
%table
.round-borders
%thead
%tr
...
...
@@ -52,9 +69,22 @@
%td
=
link_to
tm
.
user_name
,
admin_team_member_path
(
tm
)
%td
=
time_ago_in_words
(
tm
.
updated_at
)
+
" ago"
%td
=
select_tag
:project_access
,
options_for_select
(
Project
.
access_options
,
tm
.
project_access
),
:class
=>
"project-access-select"
,
:disabled
=>
:disabled
%td
=
select_tag
:repo_access
,
options_for_select
(
Repository
.
access_options
,
tm
.
repo_access
),
:class
=>
"repo-access-select"
,
:disabled
=>
:disabled
%td
=
select_tag
:
tm_
project_access
,
options_for_select
(
Project
.
access_options
,
tm
.
project_access
),
:class
=>
"project-access-select"
,
:disabled
=>
:disabled
%td
=
select_tag
:
tm_
repo_access
,
options_for_select
(
Repository
.
access_options
,
tm
.
repo_access
),
:class
=>
"repo-access-select"
,
:disabled
=>
:disabled
%td
=
link_to
'Destroy'
,
admin_team_member_path
(
tm
),
:confirm
=>
'Are you sure?'
,
:method
=>
:delete
=
link_to
'New Team Member'
,
new_admin_team_member_path
(
:team_member
=>
{
:project_id
=>
@admin_project
.
id
}),
:class
=>
"grey-button"
.right
=
link_to
'Bulk Import'
,
team_admin_project_path
(
@admin_project
),
:class
=>
"grey-button"
:css
form
select
{
width
:
150px
;
}
#user_ids
{
width
:
300px
;
}
:javascript
$
(
'select#user_ids'
).
chosen
();
$
(
'select#repo_access'
).
chosen
();
$
(
'select#project_access'
).
chosen
();
app/views/admin/projects/team.html.haml
View file @
c5a48a6a
=
form_tag
team_update_admin_project_path
(
@admin_project
),
:class
=>
"bulk_import"
,
:method
=>
:put
do
.span-6
%b
Project Access:
.span-6
=
select_tag
:project_access
,
options_for_select
(
Project
.
access_options
),
:class
=>
"project-access-select"
.span-6
%b
Repository Access:
.span-6
=
select_tag
:repo_access
,
options_for_select
(
Repository
.
access_options
),
:class
=>
"repo-access-select"
%br
=
select_tag
:user_ids
,
options_from_collection_for_select
(
@users
,
:id
,
:name
),
:multiple
=>
true
%br
.clear
%br
.actions
=
submit_tag
'Save'
,
:class
=>
"grey-button"
:css
form
select
{
width
:
300px
;
}
:javascript
$
(
'select#user_ids'
).
chosen
();
$
(
'select#repo_access'
).
chosen
();
$
(
'select#project_access'
).
chosen
();
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment