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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
a16533a0
Commit
a16533a0
authored
Dec 30, 2012
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add groups to search autocomplete. Use alphabetically scope for users order
parent
e37a043d
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
8 additions
and
6 deletions
+8
-6
app/controllers/admin/users_controller.rb
app/controllers/admin/users_controller.rb
+1
-1
app/helpers/application_helper.rb
app/helpers/application_helper.rb
+3
-2
app/models/user.rb
app/models/user.rb
+1
-0
app/views/groups/_new_group_member.html.haml
app/views/groups/_new_group_member.html.haml
+1
-1
app/views/groups/_new_member.html.haml
app/views/groups/_new_member.html.haml
+1
-1
app/views/team_members/_form.html.haml
app/views/team_members/_form.html.haml
+1
-1
No files found.
app/controllers/admin/users_controller.rb
View file @
a16533a0
...
...
@@ -3,7 +3,7 @@ class Admin::UsersController < AdminController
@admin_users
=
User
.
scoped
@admin_users
=
@admin_users
.
filter
(
params
[
:filter
])
@admin_users
=
@admin_users
.
search
(
params
[
:name
])
if
params
[
:name
].
present?
@admin_users
=
@admin_users
.
order
(
"name ASC"
)
.
page
(
params
[
:page
])
@admin_users
=
@admin_users
.
alphabetically
.
page
(
params
[
:page
])
end
def
show
...
...
app/helpers/application_helper.rb
View file @
a16533a0
...
...
@@ -78,7 +78,8 @@ module ApplicationHelper
end
def
search_autocomplete_source
projects
=
current_user
.
projects
.
map
{
|
p
|
{
label:
p
.
name_with_namespace
,
url:
project_path
(
p
)
}
}
projects
=
current_user
.
authorized_projects
.
map
{
|
p
|
{
label:
p
.
name_with_namespace
,
url:
project_path
(
p
)
}
}
groups
=
current_user
.
authorized_groups
.
map
{
|
group
|
{
label:
"<group>
#{
group
.
name
}
"
,
url:
group_path
(
group
)
}
}
default_nav
=
[
{
label:
"My Profile"
,
url:
profile_path
},
...
...
@@ -113,7 +114,7 @@ module ApplicationHelper
]
end
[
projects
,
default_nav
,
project_nav
,
help_nav
].
flatten
.
to_json
[
groups
,
projects
,
default_nav
,
project_nav
,
help_nav
].
flatten
.
to_json
end
def
emoji_autocomplete_source
...
...
app/models/user.rb
View file @
a16533a0
...
...
@@ -80,6 +80,7 @@ class User < ActiveRecord::Base
scope
:admins
,
where
(
admin:
true
)
scope
:blocked
,
where
(
blocked:
true
)
scope
:active
,
where
(
blocked:
false
)
scope
:alphabetically
,
order
(
'name ASC'
)
class
<<
self
def
filter
filter_name
...
...
app/views/groups/_new_group_member.html.haml
View file @
a16533a0
...
...
@@ -5,7 +5,7 @@
%h6
1. Choose people you want in the team
.clearfix
=
f
.
label
:user_ids
,
"People"
.input
=
select_tag
(
:user_ids
,
options_from_collection_for_select
(
User
.
active
.
order
(
'name ASC'
)
,
:id
,
:name
),
{
data:
{
placeholder:
"Select users"
},
class:
"chosen xxlarge"
,
multiple:
true
})
.input
=
select_tag
(
:user_ids
,
options_from_collection_for_select
(
User
.
active
.
alphabetically
,
:id
,
:name
),
{
data:
{
placeholder:
"Select users"
},
class:
"chosen xxlarge"
,
multiple:
true
})
%h6
2. Set access level for them
.clearfix
...
...
app/views/groups/_new_member.html.haml
View file @
a16533a0
...
...
@@ -5,7 +5,7 @@
%h6
1. Choose people you want in the team
.clearfix
=
f
.
label
:user_ids
,
"People"
.input
=
select_tag
(
:user_ids
,
options_from_collection_for_select
(
User
.
not_in_project
(
@project
).
order
(
'name'
).
all
,
:id
,
:name
),
{
data:
{
placeholder:
"Select users"
},
class:
"chosen xxlarge"
,
multiple:
true
})
.input
=
select_tag
(
:user_ids
,
options_from_collection_for_select
(
User
.
not_in_project
(
@project
).
alphabetically
,
:id
,
:name
),
{
data:
{
placeholder:
"Select users"
},
class:
"chosen xxlarge"
,
multiple:
true
})
%h6
2. Set access level for them
.clearfix
...
...
app/views/team_members/_form.html.haml
View file @
a16533a0
...
...
@@ -11,7 +11,7 @@
%h6
1. Choose people you want in the team
.clearfix
=
f
.
label
:user_ids
,
"People"
.input
=
select_tag
(
:user_ids
,
options_from_collection_for_select
(
User
.
active
.
not_in_project
(
@project
).
al
l
,
:id
,
:name
),
{
data:
{
placeholder:
"Select users"
},
class:
"chosen xxlarge"
,
multiple:
true
})
.input
=
select_tag
(
:user_ids
,
options_from_collection_for_select
(
User
.
active
.
not_in_project
(
@project
).
al
phabetically
,
:id
,
:name
),
{
data:
{
placeholder:
"Select users"
},
class:
"chosen xxlarge"
,
multiple:
true
})
%h6
2. Set access level for them
.clearfix
...
...
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