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
iv
gitlab-ce
Commits
bf17d976
Commit
bf17d976
authored
Mar 13, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add api users filter and integrate users select2
parent
163908b3
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
28 additions
and
2 deletions
+28
-2
app/assets/javascripts/application.js
app/assets/javascripts/application.js
+1
-0
app/assets/stylesheets/application.scss
app/assets/stylesheets/application.scss
+1
-0
app/assets/stylesheets/common.scss
app/assets/stylesheets/common.scss
+15
-0
app/controllers/application_controller.rb
app/controllers/application_controller.rb
+2
-0
app/helpers/application_helper.rb
app/helpers/application_helper.rb
+4
-0
app/views/team_members/_form.html.haml
app/views/team_members/_form.html.haml
+3
-1
lib/api/users.rb
lib/api/users.rb
+2
-1
No files found.
app/assets/javascripts/application.js
View file @
bf17d976
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
//= require bootstrap
//= require bootstrap
//= require modernizr
//= require modernizr
//= require chosen-jquery
//= require chosen-jquery
//= require select2
//= require raphael
//= require raphael
//= require g.raphael-min
//= require g.raphael-min
//= require g.bar-min
//= require g.bar-min
...
...
app/assets/stylesheets/application.scss
View file @
bf17d976
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
*= require jquery.ui.gitlab
*= require jquery.ui.gitlab
*= require jquery.atwho
*= require jquery.atwho
*= require chosen
*= require chosen
*= require select2
*= require_self
*= require_self
*/
*/
...
...
app/assets/stylesheets/common.scss
View file @
bf17d976
...
@@ -554,3 +554,18 @@ img.emoji {
...
@@ -554,3 +554,18 @@ img.emoji {
.appear-data
{
.appear-data
{
display
:
none
;
display
:
none
;
}
}
.ajax-users-select
{
width
:
400px
;
}
.user-result
{
.user-image
{
float
:
left
;
}
.user-name
{
}
.user-username
{
color
:
#999
;
}
}
app/controllers/application_controller.rb
View file @
bf17d976
...
@@ -152,5 +152,7 @@ class ApplicationController < ActionController::Base
...
@@ -152,5 +152,7 @@ class ApplicationController < ActionController::Base
def
add_gon_variables
def
add_gon_variables
gon
.
default_issues_tracker
=
Project
.
issues_tracker
.
default_value
gon
.
default_issues_tracker
=
Project
.
issues_tracker
.
default_value
gon
.
api_token
=
current_user
.
private_token
gon
.
gravatar_url
=
request
.
ssl?
?
Gitlab
.
config
.
gravatar
.
ssl_url
:
Gitlab
.
config
.
gravatar
.
plain_url
end
end
end
end
app/helpers/application_helper.rb
View file @
bf17d976
...
@@ -169,4 +169,8 @@ module ApplicationHelper
...
@@ -169,4 +169,8 @@ module ApplicationHelper
end
end
alias_method
:url_to_image
,
:image_url
alias_method
:url_to_image
,
:image_url
def
users_select_tag
(
id
)
hidden_field_tag
(
id
,
''
,
class:
"ajax-users-select"
)
end
end
end
app/views/team_members/_form.html.haml
View file @
bf17d976
...
@@ -11,7 +11,9 @@
...
@@ -11,7 +11,9 @@
%h6
1. Choose people you want in the team
%h6
1. Choose people you want in the team
.clearfix
.clearfix
=
f
.
label
:user_ids
,
"People"
=
f
.
label
:user_ids
,
"People"
.input
=
select_tag
(
:user_ids
,
options_from_collection_for_select
(
User
.
active
.
not_in_project
(
@project
).
alphabetically
,
:id
,
:name_with_username
),
{
data:
{
placeholder:
"Select users"
},
class:
"chosen xxlarge"
,
multiple:
true
})
.input
=
users_select_tag
(
:user_ids
)
-#= select_tag(:user_ids, options_from_collection_for_select(User.active.not_in_project(@project).alphabetically, :id, :name_with_username), {data: {placeholder: "Select users"}, class: "chosen xxlarge", multiple: true})
%h6
2. Set access level for them
%h6
2. Set access level for them
.clearfix
.clearfix
...
...
lib/api/users.rb
View file @
bf17d976
...
@@ -9,7 +9,8 @@ module Gitlab
...
@@ -9,7 +9,8 @@ module Gitlab
# Example Request:
# Example Request:
# GET /users
# GET /users
get
do
get
do
@users
=
paginate
User
@users
=
User
.
scoped
@users
=
@users
.
search
(
params
[
:search
])
if
params
[
:search
].
present?
present
@users
,
with:
Entities
::
User
present
@users
,
with:
Entities
::
User
end
end
...
...
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