BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
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
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
64 additions
and
16 deletions
+64
-16
awards_handler.coffee
app/assets/javascripts/awards_handler.coffee
+0
-0
dispatcher.js.coffee
app/assets/javascripts/dispatcher.js.coffee
+2
-0
emoji_aliases.js.coffee.erb
app/assets/javascripts/lib/emoji_aliases.js.coffee.erb
+10
-0
notes.js.coffee
app/assets/javascripts/notes.js.coffee
+2
-2
awards.scss
app/assets/stylesheets/pages/awards.scss
+7
-6
notes.scss
app/assets/stylesheets/pages/notes.scss
+38
-3
notes_finder.rb
app/finders/notes_finder.rb
+2
-2
_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
new
Issue
()
shortcut_handler
=
new
ShortcutsIssuable
()
new
ZenMode
()
awards_handler
=
new
AwardsHandler
()
when
'projects:milestones:show'
,
'groups:milestones:show'
,
'dashboard:milestones:show'
new
Milestone
()
when
'dashboard:todos:index'
...
...
@@ -52,6 +53,7 @@ class Dispatcher
new
Diff
()
shortcut_handler
=
new
ShortcutsIssuable
(
true
)
new
ZenMode
()
awards_handler
=
new
AwardsHandler
()
when
"projects:merge_requests:diffs"
new
Diff
()
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
renderNote
:
(
note
)
->
unless
note
.
valid
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'
)
return
if
note
.
award
awards_handler
.
addAwardToEmojiBar
(
note
.
n
ot
e
)
awards_handler
.
addAwardToEmojiBar
(
note
.
n
am
e
)
awards_handler
.
scrollToAwards
()
# render note if it not present in loaded list
...
...
app/assets/stylesheets/pages/awards.scss
View file @
4eb16290
.awards
{
line-height
:
34px
;
.emoji-icon
{
width
:
20px
;
height
:
20px
;
...
...
@@ -9,8 +7,6 @@
.emoji-menu
{
position
:
absolute
;
top
:
100%
;
left
:
0
;
margin-top
:
3px
;
z-index
:
1000
;
min-width
:
160px
;
...
...
@@ -23,7 +19,12 @@
opacity
:
0
;
transform
:
scale
(
.2
);
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
{
pointer-events
:
all
;
...
...
@@ -107,7 +108,7 @@
}
&
.is-loading
{
.award-control-icon
{
.award-control-icon
-normal
{
display
:
none
;
}
...
...
app/assets/stylesheets/pages/notes.scss
View file @
4eb16290
...
...
@@ -63,7 +63,8 @@ ul.notes {
&
.is-editting
{
.note-header
,
.note-text
,
.edited-text
{
.edited-text
,
.note-awards
{
display
:
none
;
}
...
...
@@ -73,8 +74,6 @@ ul.notes {
}
.note-body
{
overflow
:
auto
;
.note-text
{
overflow
:
auto
;
word-wrap
:
break-word
;
...
...
@@ -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
{
margin-left
:
-
$gl-padding-top
;
margin-right
:
-
$gl-padding-top
;
...
...
app/finders/notes_finder.rb
View file @
4eb16290
...
...
@@ -12,9 +12,9 @@ class NotesFinder
when
"commit"
project
.
notes
.
for_commit_id
(
target_id
).
not_inline
when
"issue"
project
.
issues
.
find
(
target_id
).
notes
.
nonawards
.
inc_author
project
.
issues
.
find
(
target_id
).
notes
.
inc_author
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"
project
.
snippets
.
find
(
target_id
).
notes
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_sort
(
grouped_
award
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"
}
}
-
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
)),
data:
{
placement:
"bottom"
,
original_title:
award_user_list
(
awards
,
current_user
)
}
}
=
emoji_icon
(
emoji
)
%span
.award-control-text.js-counter
=
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