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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
4eb16290
Commit
4eb16290
authored
Apr 25, 2016
by
Arinde Eniola
Committed by
Zeger-Jan van de Weg
May 06, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move frontend logic from previous MR to new MR
parent
3bdc57f0
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
192 additions
and
102 deletions
+192
-102
app/assets/javascripts/awards_handler.coffee
app/assets/javascripts/awards_handler.coffee
+129
-86
app/assets/javascripts/dispatcher.js.coffee
app/assets/javascripts/dispatcher.js.coffee
+2
-0
app/assets/javascripts/lib/emoji_aliases.js.coffee.erb
app/assets/javascripts/lib/emoji_aliases.js.coffee.erb
+9
-0
app/assets/javascripts/notes.js.coffee
app/assets/javascripts/notes.js.coffee
+2
-2
app/assets/stylesheets/pages/awards.scss
app/assets/stylesheets/pages/awards.scss
+7
-6
app/assets/stylesheets/pages/notes.scss
app/assets/stylesheets/pages/notes.scss
+38
-3
app/finders/notes_finder.rb
app/finders/notes_finder.rb
+2
-2
app/views/award_emoji/_awards_block.html.haml
app/views/award_emoji/_awards_block.html.haml
+3
-3
No files found.
app/assets/javascripts/awards_handler.coffee
View file @
4eb16290
This diff is collapsed.
Click to expand it.
app/assets/javascripts/dispatcher.js.coffee
View file @
4eb16290
...
@@ -22,6 +22,7 @@ class Dispatcher
...
@@ -22,6 +22,7 @@ class Dispatcher
new
Issue
()
new
Issue
()
shortcut_handler
=
new
ShortcutsIssuable
()
shortcut_handler
=
new
ShortcutsIssuable
()
new
ZenMode
()
new
ZenMode
()
awards_handler
=
new
AwardsHandler
()
when
'projects:milestones:show'
,
'groups:milestones:show'
,
'dashboard:milestones:show'
when
'projects:milestones:show'
,
'groups:milestones:show'
,
'dashboard:milestones:show'
new
Milestone
()
new
Milestone
()
when
'dashboard:todos:index'
when
'dashboard:todos:index'
...
@@ -52,6 +53,7 @@ class Dispatcher
...
@@ -52,6 +53,7 @@ class Dispatcher
new
Diff
()
new
Diff
()
shortcut_handler
=
new
ShortcutsIssuable
(
true
)
shortcut_handler
=
new
ShortcutsIssuable
(
true
)
new
ZenMode
()
new
ZenMode
()
awards_handler
=
new
AwardsHandler
()
when
"projects:merge_requests:diffs"
when
"projects:merge_requests:diffs"
new
Diff
()
new
Diff
()
new
ZenMode
()
new
ZenMode
()
...
...
app/assets/javascripts/lib/emoji_aliases.js.coffee.erb
0 → 100644
View file @
4eb16290
((w) ->
w.gl ?= {}
w.gl.emoji ?= {}
w.gl.emoji.emojiAliases = ->
JSON.parse('
<%=
Gitlab
::
AwardEmoji
.
aliases
.
to_json
%>
')
) window
\ No newline at end of file
app/assets/javascripts/notes.js.coffee
View file @
4eb16290
...
@@ -150,12 +150,12 @@ class @Notes
...
@@ -150,12 +150,12 @@ class @Notes
renderNote
:
(
note
)
->
renderNote
:
(
note
)
->
unless
note
.
valid
unless
note
.
valid
if
note
.
award
if
note
.
award
flash
=
new
Flash
(
'You have already
used this award emoji!
'
,
'alert'
)
flash
=
new
Flash
(
'You have already
awarded this emoji, and it we
\'
ve removed it
'
,
'alert'
)
flash
.
pinTo
(
'.header-content'
)
flash
.
pinTo
(
'.header-content'
)
return
return
if
note
.
award
if
note
.
award
awards_handler
.
addAwardToEmojiBar
(
note
.
n
ot
e
)
awards_handler
.
addAwardToEmojiBar
(
note
.
n
am
e
)
awards_handler
.
scrollToAwards
()
awards_handler
.
scrollToAwards
()
# render note if it not present in loaded list
# render note if it not present in loaded list
...
...
app/assets/stylesheets/pages/awards.scss
View file @
4eb16290
.awards
{
.awards
{
line-height
:
34px
;
.emoji-icon
{
.emoji-icon
{
width
:
20px
;
width
:
20px
;
height
:
20px
;
height
:
20px
;
...
@@ -9,8 +7,6 @@
...
@@ -9,8 +7,6 @@
.emoji-menu
{
.emoji-menu
{
position
:
absolute
;
position
:
absolute
;
top
:
100%
;
left
:
0
;
margin-top
:
3px
;
margin-top
:
3px
;
z-index
:
1000
;
z-index
:
1000
;
min-width
:
160px
;
min-width
:
160px
;
...
@@ -23,7 +19,12 @@
...
@@ -23,7 +19,12 @@
opacity
:
0
;
opacity
:
0
;
transform
:
scale
(
.2
);
transform
:
scale
(
.2
);
transform-origin
:
0
-45px
;
transform-origin
:
0
-45px
;
transition
:
all
.3s
cubic-bezier
(
.87
,-.
41
,.
19
,
1
.44
);
transition
:
.3s
cubic-bezier
(
.87
,-.
41
,.
19
,
1
.44
);
transition-property
:
transform
,
opacity
;
&
.is-aligned-right
{
transform-origin
:
100%
-45px
;
}
&
.is-visible
{
&
.is-visible
{
pointer-events
:
all
;
pointer-events
:
all
;
...
@@ -107,7 +108,7 @@
...
@@ -107,7 +108,7 @@
}
}
&
.is-loading
{
&
.is-loading
{
.award-control-icon
{
.award-control-icon
-normal
{
display
:
none
;
display
:
none
;
}
}
...
...
app/assets/stylesheets/pages/notes.scss
View file @
4eb16290
...
@@ -63,7 +63,8 @@ ul.notes {
...
@@ -63,7 +63,8 @@ ul.notes {
&
.is-editting
{
&
.is-editting
{
.note-header
,
.note-header
,
.note-text
,
.note-text
,
.edited-text
{
.edited-text
,
.note-awards
{
display
:
none
;
display
:
none
;
}
}
...
@@ -73,8 +74,6 @@ ul.notes {
...
@@ -73,8 +74,6 @@ ul.notes {
}
}
.note-body
{
.note-body
{
overflow
:
auto
;
.note-text
{
.note-text
{
overflow
:
auto
;
overflow
:
auto
;
word-wrap
:
break-word
;
word-wrap
:
break-word
;
...
@@ -307,6 +306,42 @@ ul.notes {
...
@@ -307,6 +306,42 @@ ul.notes {
}
}
}
}
.note-award-control
{
display
:
block
;
&
:hover
,
&
:focus
{
text-decoration
:
none
;
}
.award-control-icon-loading
{
display
:
none
;
}
&
.is-loading
{
.award-control-icon-normal
{
display
:
none
;
}
.award-control-icon-loading
{
display
:
block
;
}
}
}
.note-awards
{
.awards
{
padding-top
:
10px
;
}
.award-control
{
padding-top
:
2px
;
padding-bottom
:
2px
;
color
:
#8f8f8f
;
font-size
:
13px
;
}
}
.disabled-comment
{
.disabled-comment
{
margin-left
:
-
$gl-padding-top
;
margin-left
:
-
$gl-padding-top
;
margin-right
:
-
$gl-padding-top
;
margin-right
:
-
$gl-padding-top
;
...
...
app/finders/notes_finder.rb
View file @
4eb16290
...
@@ -12,9 +12,9 @@ class NotesFinder
...
@@ -12,9 +12,9 @@ class NotesFinder
when
"commit"
when
"commit"
project
.
notes
.
for_commit_id
(
target_id
).
not_inline
project
.
notes
.
for_commit_id
(
target_id
).
not_inline
when
"issue"
when
"issue"
project
.
issues
.
find
(
target_id
).
notes
.
nonawards
.
inc_author
project
.
issues
.
find
(
target_id
).
notes
.
inc_author
when
"merge_request"
when
"merge_request"
project
.
merge_requests
.
find
(
target_id
).
mr_and_commit_notes
.
nonawards
.
inc_author
project
.
merge_requests
.
find
(
target_id
).
mr_and_commit_notes
.
inc_author
when
"snippet"
,
"project_snippet"
when
"snippet"
,
"project_snippet"
project
.
snippets
.
find
(
target_id
).
notes
project
.
snippets
.
find
(
target_id
).
notes
else
else
...
...
app/views/award_emoji/_awards_block.html.haml
View file @
4eb16290
-
grouped_
award
s
=
awardable
.
grouped_awards
(
inline
)
-
grouped_
emoji
s
=
awardable
.
grouped_awards
(
inline
)
.awards.js-awards-block
{
class:
(
"hidden"
if
!
inline
&&
grouped_emojis
.
size
==
0
),
data:
{
award_url:
url_for
([
:toggle_award_emoji
,
@project
.
namespace
.
becomes
(
Namespace
),
@project
,
awardable
])
}
}
.awards.js-awards-block
{
class:
(
"hidden"
if
!
inline
&&
grouped_emojis
.
size
==
0
),
data:
{
award_url:
url_for
([
:toggle_award_emoji
,
@project
.
namespace
.
becomes
(
Namespace
),
@project
,
awardable
])
}
}
-
awards_sort
(
grouped_
award
s
).
each
do
|
emoji
,
awards
|
-
awards_sort
(
grouped_
emoji
s
).
each
do
|
emoji
,
awards
|
%button
.btn.award-control.js-emoji-btn.has-tooltip
{
type:
"button"
,
class:
(
award_active_class
(
awards
,
current_user
)),
title:
award_user_list
(
awards
,
current_user
),
data:
{
placement:
"bottom"
}
}
%button
.btn.award-control.js-emoji-btn.has-tooltip
{
type:
"button"
,
class:
(
award_active_class
(
awards
,
current_user
)),
data:
{
placement:
"bottom"
,
original_title:
award_user_list
(
awards
,
current_user
)
}
}
=
emoji_icon
(
emoji
)
=
emoji_icon
(
emoji
)
%span
.award-control-text.js-counter
%span
.award-control-text.js-counter
=
awards
.
count
=
awards
.
count
...
...
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