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
92af60c2
Commit
92af60c2
authored
Jun 09, 2016
by
Fatih Acet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move award_menu_url variable into gon object.
parent
52525dc4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
11 deletions
+8
-11
app/assets/javascripts/awards_handler.coffee
app/assets/javascripts/awards_handler.coffee
+1
-1
app/views/award_emoji/_awards_block.html.haml
app/views/award_emoji/_awards_block.html.haml
+0
-3
lib/gitlab/gon_helper.rb
lib/gitlab/gon_helper.rb
+1
-0
spec/javascripts/awards_handler_spec.js.coffee
spec/javascripts/awards_handler_spec.js.coffee
+6
-7
No files found.
app/assets/javascripts/awards_handler.coffee
View file @
92af60c2
...
@@ -282,7 +282,7 @@ class @AwardsHandler
...
@@ -282,7 +282,7 @@ class @AwardsHandler
@
createEmojiMenu
@
getAwardMenuUrl
(),
=>
@
createEmoji_
votesBlock
,
emoji
@
createEmojiMenu
@
getAwardMenuUrl
(),
=>
@
createEmoji_
votesBlock
,
emoji
getAwardMenuUrl
:
->
return
g
l
.
awardMenuU
rl
getAwardMenuUrl
:
->
return
g
on
.
award_menu_u
rl
resolveNameToCssClass
:
(
emoji
)
->
resolveNameToCssClass
:
(
emoji
)
->
...
...
app/views/award_emoji/_awards_block.html.haml
View file @
92af60c2
...
@@ -7,9 +7,6 @@
...
@@ -7,9 +7,6 @@
=
awards
.
count
=
awards
.
count
-
if
current_user
-
if
current_user
:javascript
gl
.
awardMenuUrl
=
"
#{
emojis_path
}
"
.award-menu-holder.js-award-holder
.award-menu-holder.js-award-holder
%button
.btn.award-control.js-add-award
{
type:
"button"
}
%button
.btn.award-control.js-add-award
{
type:
"button"
}
=
icon
(
'smile-o'
,
class:
"award-control-icon award-control-icon-normal"
)
=
icon
(
'smile-o'
,
class:
"award-control-icon award-control-icon-normal"
)
...
...
lib/gitlab/gon_helper.rb
View file @
92af60c2
...
@@ -8,6 +8,7 @@ module Gitlab
...
@@ -8,6 +8,7 @@ module Gitlab
gon
.
relative_url_root
=
Gitlab
.
config
.
gitlab
.
relative_url_root
gon
.
relative_url_root
=
Gitlab
.
config
.
gitlab
.
relative_url_root
gon
.
shortcuts_path
=
help_shortcuts_path
gon
.
shortcuts_path
=
help_shortcuts_path
gon
.
user_color_scheme
=
Gitlab
::
ColorSchemes
.
for_user
(
current_user
).
css_class
gon
.
user_color_scheme
=
Gitlab
::
ColorSchemes
.
for_user
(
current_user
).
css_class
gon
.
award_menu_url
=
emojis_path
if
current_user
if
current_user
gon
.
current_user_id
=
current_user
.
id
gon
.
current_user_id
=
current_user
.
id
...
...
spec/javascripts/awards_handler_spec.js.coffee
View file @
92af60c2
...
@@ -3,10 +3,11 @@
...
@@ -3,10 +3,11 @@
#= require jquery.cookie
#= require jquery.cookie
#= require ./fixtures/emoji_menu
#= require ./fixtures/emoji_menu
awardsHandler
=
null
awardsHandler
=
null
window
.
gl
or=
{}
window
.
gl
or=
{}
gl
.
emojiAliases
=
->
return
{
'+1'
:
'thumbsup'
,
'-1'
:
'thumbsdown'
}
window
.
gon
or=
{}
gl
.
awardMenuUrl
=
'/emojis'
gl
.
emojiAliases
=
->
return
{
'+1'
:
'thumbsup'
,
'-1'
:
'thumbsdown'
}
gon
.
award_menu_url
=
'/emojis'
lazyAssert
=
(
done
,
assertFn
)
->
lazyAssert
=
(
done
,
assertFn
)
->
...
@@ -25,9 +26,7 @@ describe 'AwardsHandler', ->
...
@@ -25,9 +26,7 @@ describe 'AwardsHandler', ->
fixture
.
load
'awards_handler.html'
fixture
.
load
'awards_handler.html'
awardsHandler
=
new
AwardsHandler
awardsHandler
=
new
AwardsHandler
spyOn
(
awardsHandler
,
'postEmoji'
).
and
.
callFake
(
url
,
emoji
,
cb
)
=>
cb
()
spyOn
(
awardsHandler
,
'postEmoji'
).
and
.
callFake
(
url
,
emoji
,
cb
)
=>
cb
()
spyOn
(
jQuery
,
'get'
).
and
.
callFake
(
req
,
cb
)
->
spyOn
(
jQuery
,
'get'
).
and
.
callFake
(
req
,
cb
)
->
cb
window
.
emojiMenu
expect
(
req
).
toBe
'/emojis'
cb
window
.
emojiMenu
describe
'::showEmojiMenu'
,
->
describe
'::showEmojiMenu'
,
->
...
...
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