Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
7316055a
Commit
7316055a
authored
Mar 13, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
multiselect for ajax-users-select2
parent
bf17d976
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
app/assets/javascripts/users_select.js.coffee
app/assets/javascripts/users_select.js.coffee
+4
-1
app/controllers/team_members_controller.rb
app/controllers/team_members_controller.rb
+1
-1
No files found.
app/assets/javascripts/users_select.js.coffee
View file @
7316055a
...
...
@@ -11,9 +11,12 @@ $ ->
markup
+=
"</div>"
markup
userFormatSelection
=
(
user
)
->
user
.
name
$
(
'.ajax-users-select'
).
select2
placeholder
:
"Search for a user"
multiple
:
true
minimumInputLength
:
0
ajax
:
# instead of writing the function to execute the request we use Select2's convenient helper
url
:
"/api/v3/users.json"
...
...
@@ -40,7 +43,7 @@ $ ->
formatResult
:
userFormatResult
# omitted for brevity, see the source of this page
#
formatSelection: userFormatSelection # omitted for brevity, see the source of this page
formatSelection
:
userFormatSelection
# omitted for brevity, see the source of this page
dropdownCssClass
:
"ajax-users-dropdown"
# apply css that makes the dropdown taller
escapeMarkup
:
(
m
)
->
# we do not want to escape markup since we are displaying html in results
m
...
...
app/controllers/team_members_controller.rb
View file @
7316055a
...
...
@@ -16,7 +16,7 @@ class TeamMembersController < ProjectResourceController
end
def
create
users
=
User
.
where
(
id:
params
[
:user_ids
])
users
=
User
.
where
(
id:
params
[
:user_ids
]
.
split
(
','
)
)
@project
.
team
<<
[
users
,
params
[
:project_access
]]
...
...
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