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
185da5f9
Commit
185da5f9
authored
Jun 23, 2014
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure that at mentioning all properly notifies.
parent
63c1cdce
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
app/controllers/projects_controller.rb
app/controllers/projects_controller.rb
+1
-1
app/models/concerns/mentionable.rb
app/models/concerns/mentionable.rb
+8
-4
No files found.
app/controllers/projects_controller.rb
View file @
185da5f9
...
@@ -130,7 +130,7 @@ class ProjectsController < ApplicationController
...
@@ -130,7 +130,7 @@ class ProjectsController < ApplicationController
[]
[]
end
end
team_members
=
sorted
(
@project
.
team
.
members
)
team_members
=
sorted
(
@project
.
team
.
members
)
participants
=
[{
username:
"all"
,
name:
"Group Members"
}]
+
team_members
+
participating
participants
=
[{
username:
"all"
,
name:
"
Project and
Group Members"
}]
+
team_members
+
participating
@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
]),
...
...
app/models/concerns/mentionable.rb
View file @
185da5f9
...
@@ -49,6 +49,9 @@ module Mentionable
...
@@ -49,6 +49,9 @@ module Mentionable
matches
=
mentionable_text
.
scan
(
/@[a-zA-Z][a-zA-Z0-9_\-\.]*/
)
matches
=
mentionable_text
.
scan
(
/@[a-zA-Z][a-zA-Z0-9_\-\.]*/
)
matches
.
each
do
|
match
|
matches
.
each
do
|
match
|
identifier
=
match
.
delete
"@"
identifier
=
match
.
delete
"@"
if
identifier
==
"all"
users
+=
project
.
team
.
members
.
flatten
else
if
has_project
if
has_project
id
=
project
.
team
.
members
.
find_by
(
username:
identifier
).
try
(
:id
)
id
=
project
.
team
.
members
.
find_by
(
username:
identifier
).
try
(
:id
)
else
else
...
@@ -56,6 +59,7 @@ module Mentionable
...
@@ -56,6 +59,7 @@ module Mentionable
end
end
users
<<
User
.
find
(
id
)
unless
id
.
blank?
users
<<
User
.
find
(
id
)
unless
id
.
blank?
end
end
end
users
.
uniq
users
.
uniq
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