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
Tatuya Kamada
gitlab-ce
Commits
01ec6c79
Commit
01ec6c79
authored
Mar 25, 2014
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
At mention participating users.
parent
81527e9f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
1 deletion
+3
-1
app/controllers/projects_controller.rb
app/controllers/projects_controller.rb
+2
-1
app/models/user.rb
app/models/user.rb
+1
-0
No files found.
app/controllers/projects_controller.rb
View file @
01ec6c79
...
@@ -123,11 +123,12 @@ class ProjectsController < ApplicationController
...
@@ -123,11 +123,12 @@ class ProjectsController < ApplicationController
end
end
def
autocomplete_sources
def
autocomplete_sources
participating_users
=
@project
.
team
.
members
.
sort_by
(
&
:username
).
map
{
|
user
|
{
username:
user
.
username
,
name:
user
.
name
}
}
+
User
.
participating
(
@project
.
notes
).
select
([
:username
,
:name
]).
sort_by
(
&
:username
).
map
{
|
user
|
{
username:
user
.
username
,
name:
user
.
name
}
}
@suggestions
=
{
@suggestions
=
{
emojis:
Emoji
.
names
.
map
{
|
e
|
{
name:
e
,
path:
view_context
.
image_url
(
"emoji/
#{
e
}
.png"
)
}
},
emojis:
Emoji
.
names
.
map
{
|
e
|
{
name:
e
,
path:
view_context
.
image_url
(
"emoji/
#{
e
}
.png"
)
}
},
issues:
@project
.
issues
.
select
([
:iid
,
:title
,
:description
]),
issues:
@project
.
issues
.
select
([
:iid
,
:title
,
:description
]),
mergerequests:
@project
.
merge_requests
.
select
([
:iid
,
:title
,
:description
]),
mergerequests:
@project
.
merge_requests
.
select
([
:iid
,
:title
,
:description
]),
members:
@project
.
team
.
members
.
sort_by
(
&
:username
).
map
{
|
user
|
{
username:
user
.
username
,
name:
user
.
name
}
}
members:
participating_users
.
uniq
}
}
respond_to
do
|
format
|
respond_to
do
|
format
|
...
...
app/models/user.rb
View file @
01ec6c79
...
@@ -169,6 +169,7 @@ class User < ActiveRecord::Base
...
@@ -169,6 +169,7 @@ class User < ActiveRecord::Base
scope
:not_in_project
,
->
(
project
)
{
project
.
users
.
present?
?
where
(
"id not in (:ids)"
,
ids:
project
.
users
.
map
(
&
:id
)
)
:
all
}
scope
:not_in_project
,
->
(
project
)
{
project
.
users
.
present?
?
where
(
"id not in (:ids)"
,
ids:
project
.
users
.
map
(
&
:id
)
)
:
all
}
scope
:without_projects
,
->
{
where
(
'id NOT IN (SELECT DISTINCT(user_id) FROM users_projects)'
)
}
scope
:without_projects
,
->
{
where
(
'id NOT IN (SELECT DISTINCT(user_id) FROM users_projects)'
)
}
scope
:ldap
,
->
{
where
(
provider:
'ldap'
)
}
scope
:ldap
,
->
{
where
(
provider:
'ldap'
)
}
scope
:participating
,
->
(
notes
){
where
(
id:
notes
.
inc_author
.
map
(
&
:author_id
))}
scope
:potential_team_members
,
->
(
team
)
{
team
.
members
.
any?
?
active
.
not_in_team
(
team
)
:
active
}
scope
:potential_team_members
,
->
(
team
)
{
team
.
members
.
any?
?
active
.
not_in_team
(
team
)
:
active
}
...
...
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