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
Jérome Perrin
gitlab-ce
Commits
893a68ba
Commit
893a68ba
authored
Jan 23, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cache autocomplete or emojis
parent
a42d84ec
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
app/controllers/projects_controller.rb
app/controllers/projects_controller.rb
+12
-8
No files found.
app/controllers/projects_controller.rb
View file @
893a68ba
...
@@ -104,15 +104,8 @@ class ProjectsController < ApplicationController
...
@@ -104,15 +104,8 @@ class ProjectsController < ApplicationController
autocomplete
=
::
Projects
::
AutocompleteService
.
new
(
@project
)
autocomplete
=
::
Projects
::
AutocompleteService
.
new
(
@project
)
participants
=
::
Projects
::
ParticipantsService
.
new
(
@project
).
execute
(
note_type
,
note_id
)
participants
=
::
Projects
::
ParticipantsService
.
new
(
@project
).
execute
(
note_type
,
note_id
)
emojis
=
Emoji
.
names
.
map
do
|
e
|
{
name:
e
,
path:
view_context
.
image_url
(
"emoji/
#{
e
}
.png"
)
}
end
@suggestions
=
{
@suggestions
=
{
emojis:
emojis
,
emojis:
autocomplete_
emojis
,
issues:
autocomplete
.
issues
,
issues:
autocomplete
.
issues
,
mergerequests:
autocomplete
.
merge_requests
,
mergerequests:
autocomplete
.
merge_requests
,
members:
participants
members:
participants
...
@@ -189,4 +182,15 @@ class ProjectsController < ApplicationController
...
@@ -189,4 +182,15 @@ class ProjectsController < ApplicationController
:wiki_enabled
,
:visibility_level
,
:import_url
,
:last_activity_at
,
:namespace_id
:wiki_enabled
,
:visibility_level
,
:import_url
,
:last_activity_at
,
:namespace_id
)
)
end
end
def
autocomplete_emojis
Rails
.
cache
.
fetch
(
"autocomplete-emoji-
#{
Emoji
::
VERSION
}
"
)
do
Emoji
.
names
.
map
do
|
e
|
{
name:
e
,
path:
view_context
.
image_url
(
"emoji/
#{
e
}
.png"
)
}
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