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
Boxiang Sun
gitlab-ce
Commits
a672b468
Commit
a672b468
authored
Feb 25, 2015
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Include number of affected people in all/group mention autocomplete item.
parent
a30a5663
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
app/services/projects/participants_service.rb
app/services/projects/participants_service.rb
+9
-3
No files found.
app/services/projects/participants_service.rb
View file @
a672b468
...
@@ -35,15 +35,21 @@ module Projects
...
@@ -35,15 +35,21 @@ module Projects
end
end
def
sorted
(
users
)
def
sorted
(
users
)
users
.
uniq
.
to_a
.
compact
.
sort_by
(
&
:username
).
map
{
|
user
|
{
username:
user
.
username
,
name:
user
.
name
}
}
users
.
uniq
.
to_a
.
compact
.
sort_by
(
&
:username
).
map
do
|
user
|
{
username:
user
.
username
,
name:
user
.
name
}
end
end
end
def
groups
def
groups
@user
.
authorized_groups
.
sort_by
(
&
:path
).
map
{
|
group
|
{
username:
group
.
path
,
name:
group
.
name
}
}
@user
.
authorized_groups
.
sort_by
(
&
:path
).
map
do
|
group
|
count
=
group
.
users
.
count
{
username:
group
.
path
,
name:
"
#{
group
.
name
}
(
#{
count
}
)"
}
end
end
end
def
all_members
def
all_members
[{
username:
"all"
,
name:
"Project and Group Members"
}]
count
=
@project
.
team
.
members
.
flatten
.
count
[{
username:
"all"
,
name:
"All Project and Group Members (
#{
count
}
)"
}]
end
end
end
end
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