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
261698f0
Commit
261698f0
authored
Nov 20, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'notes_fix_stable' into 'master'
Fix for Emoji See merge request !1849
parents
b96fa309
f31ee525
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
4 deletions
+6
-4
app/assets/javascripts/awards_handler.coffee
app/assets/javascripts/awards_handler.coffee
+1
-1
app/controllers/projects/notes_controller.rb
app/controllers/projects/notes_controller.rb
+1
-1
app/helpers/issues_helper.rb
app/helpers/issues_helper.rb
+2
-0
app/services/notes/create_service.rb
app/services/notes/create_service.rb
+2
-2
No files found.
app/assets/javascripts/awards_handler.coffee
View file @
261698f0
...
@@ -80,7 +80,7 @@ class @AwardsHandler
...
@@ -80,7 +80,7 @@ class @AwardsHandler
postEmoji
:
(
emoji
,
callback
)
->
postEmoji
:
(
emoji
,
callback
)
->
$
.
post
@
post_emoji_url
,
{
note
:
{
$
.
post
@
post_emoji_url
,
{
note
:
{
note
:
emoji
note
:
":"
+
emoji
+
":"
noteable_type
:
@
noteable_type
noteable_type
:
@
noteable_type
noteable_id
:
@
noteable_id
noteable_id
:
@
noteable_id
}},(
data
)
->
}},(
data
)
->
...
...
app/controllers/projects/notes_controller.rb
View file @
261698f0
...
@@ -65,7 +65,7 @@ class Projects::NotesController < Projects::ApplicationController
...
@@ -65,7 +65,7 @@ class Projects::NotesController < Projects::ApplicationController
data
=
{
data
=
{
author:
current_user
,
author:
current_user
,
is_award:
true
,
is_award:
true
,
note:
note_params
[
:note
]
note:
note_params
[
:note
]
.
gsub
(
":"
,
''
)
}
}
note
=
noteable
.
notes
.
find_by
(
data
)
note
=
noteable
.
notes
.
find_by
(
data
)
...
...
app/helpers/issues_helper.rb
View file @
261698f0
...
@@ -90,6 +90,8 @@ module IssuesHelper
...
@@ -90,6 +90,8 @@ module IssuesHelper
def
url_to_emoji
(
name
)
def
url_to_emoji
(
name
)
emoji_path
=
::
AwardEmoji
.
path_to_emoji_image
(
name
)
emoji_path
=
::
AwardEmoji
.
path_to_emoji_image
(
name
)
url_to_image
(
emoji_path
)
url_to_image
(
emoji_path
)
rescue
StandardError
""
end
end
def
emoji_author_list
(
notes
,
current_user
)
def
emoji_author_list
(
notes
,
current_user
)
...
...
app/services/notes/create_service.rb
View file @
261698f0
...
@@ -35,11 +35,11 @@ module Notes
...
@@ -35,11 +35,11 @@ module Notes
end
end
def
contains_emoji_only?
(
note
)
def
contains_emoji_only?
(
note
)
note
=~
/\A:
?[-_+[:alnum:]]*:?
\s?\z/
note
=~
/\A:
[-_+[:alnum:]]*:
\s?\z/
end
end
def
emoji_name
(
note
)
def
emoji_name
(
note
)
note
.
match
(
/\A:
?([-_+[:alnum:]]*):?
\s?/
)[
1
]
note
.
match
(
/\A:
([-_+[:alnum:]]*):
\s?/
)[
1
]
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