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
Léo-Paul Géneau
gitlab-ce
Commits
eb7a9868
Commit
eb7a9868
authored
Mar 26, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'improve_at_mentions' into 'master'
Allow at mentions for people who are not members of the project
parents
f0adf28e
9dd58c32
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
44 additions
and
5 deletions
+44
-5
CHANGELOG
CHANGELOG
+9
-0
VERSION
VERSION
+1
-1
app/controllers/projects_controller.rb
app/controllers/projects_controller.rb
+31
-1
app/views/layouts/_init_auto_complete.html.haml
app/views/layouts/_init_auto_complete.html.haml
+1
-1
lib/gitlab/markdown.rb
lib/gitlab/markdown.rb
+2
-2
No files found.
CHANGELOG
View file @
eb7a9868
v 6.8.0
- Ability to at mention users that are participating in issue and merge req. discussion
v 6.7.2
- Fix upgrader script
v 6.7.1
- Fix GitLab CI integration
v 6.7.0
v 6.7.0
- Increased the example Nginx client_max_body_size from 5MB to 20MB, consider updating it manually on existing installations
- Increased the example Nginx client_max_body_size from 5MB to 20MB, consider updating it manually on existing installations
- Add support for Gemnasium as a Project Service (Olivier Gonzalez)
- Add support for Gemnasium as a Project Service (Olivier Gonzalez)
...
...
VERSION
View file @
eb7a9868
6.7.
0
6.7.
2
app/controllers/projects_controller.rb
View file @
eb7a9868
...
@@ -123,11 +123,20 @@ class ProjectsController < ApplicationController
...
@@ -123,11 +123,20 @@ class ProjectsController < ApplicationController
end
end
def
autocomplete_sources
def
autocomplete_sources
note_type
=
params
[
'type'
]
note_id
=
params
[
'type_id'
]
participating
=
if
note_type
&&
note_id
participants_in
(
note_type
,
note_id
)
else
[]
end
team_members
=
sorted
(
@project
.
team
.
members
)
participants
=
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
]),
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:
participants
.
uniq
}
}
respond_to
do
|
format
|
respond_to
do
|
format
|
...
@@ -162,4 +171,25 @@ class ProjectsController < ApplicationController
...
@@ -162,4 +171,25 @@ class ProjectsController < ApplicationController
def
user_layout
def
user_layout
current_user
?
"projects"
:
"public_projects"
current_user
?
"projects"
:
"public_projects"
end
end
def
participants_in
(
type
,
id
)
users
=
case
type
when
"Issue"
issue
=
@project
.
issues
.
find_by_iid
(
id
)
issue
?
issue
.
participants
:
[]
when
"MergeRequest"
merge_request
=
@project
.
merge_requests
.
find_by_iid
(
id
)
merge_request
?
merge_request
.
participants
:
[]
when
"Commit"
author_ids
=
Note
.
for_commit_id
(
id
).
pluck
(
:author_id
).
uniq
User
.
where
(
id:
author_ids
)
else
[]
end
sorted
(
users
)
end
def
sorted
(
users
)
users
.
uniq
.
sort_by
(
&
:username
).
map
{
|
user
|
{
username:
user
.
username
,
name:
user
.
name
}
}
end
end
end
app/views/layouts/_init_auto_complete.html.haml
View file @
eb7a9868
:javascript
:javascript
GitLab
.
GfmAutoComplete
.
dataSource
=
"
#{
autocomplete_sources_project_path
(
@project
)
}
"
GitLab
.
GfmAutoComplete
.
dataSource
=
"
#{
autocomplete_sources_project_path
(
@project
,
type:
@noteable
.
class
,
type_id:
params
[
:id
]
)
}
"
GitLab
.
GfmAutoComplete
.
setup
();
GitLab
.
GfmAutoComplete
.
setup
();
lib/gitlab/markdown.rb
View file @
eb7a9868
...
@@ -166,8 +166,8 @@ module Gitlab
...
@@ -166,8 +166,8 @@ module Gitlab
end
end
def
reference_user
(
identifier
)
def
reference_user
(
identifier
)
if
member
=
@project
.
team_members
.
find
{
|
user
|
user
.
username
==
identifier
}
if
user
=
User
.
find_by_username
(
identifier
)
link_to
(
"@
#{
identifier
}
"
,
user_url
(
identifier
),
html_options
.
merge
(
class:
"gfm gfm-team_member
#{
html_options
[
:class
]
}
"
))
if
member
link_to
(
"@
#{
identifier
}
"
,
user_url
(
identifier
),
html_options
.
merge
(
class:
"gfm gfm-team_member
#{
html_options
[
:class
]
}
"
))
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