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
Boxiang Sun
gitlab-ce
Commits
a1b63e12
Commit
a1b63e12
authored
Dec 24, 2015
by
Valery Sizov
Committed by
Valery Sizov
Dec 25, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
revert back vote buttons to issue and MR pages
parent
ed777c7b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
11 deletions
+25
-11
CHANGELOG
CHANGELOG
+1
-0
app/assets/javascripts/awards_handler.coffee
app/assets/javascripts/awards_handler.coffee
+8
-7
app/models/note.rb
app/models/note.rb
+8
-1
spec/models/note_spec.rb
spec/models/note_spec.rb
+8
-3
No files found.
CHANGELOG
View file @
a1b63e12
...
@@ -9,6 +9,7 @@ v 8.4.0 (unreleased)
...
@@ -9,6 +9,7 @@ v 8.4.0 (unreleased)
- Add "Frequently used" category to emoji picker
- Add "Frequently used" category to emoji picker
- Add CAS support (tduehr)
- Add CAS support (tduehr)
- Add link to merge request on build detail page.
- Add link to merge request on build detail page.
- Revert back upvote and downvote button to the issue and MR pages
v 8.3.2 (unreleased)
v 8.3.2 (unreleased)
- Enable "Add key" button when user fills in a proper key
- Enable "Add key" button when user fills in a proper key
...
...
app/assets/javascripts/awards_handler.coffee
View file @
a1b63e12
...
@@ -43,15 +43,19 @@ class @AwardsHandler
...
@@ -43,15 +43,19 @@ class @AwardsHandler
decrementCounter
:
(
emoji
)
->
decrementCounter
:
(
emoji
)
->
counter
=
@
findEmojiIcon
(
emoji
).
siblings
(
".counter"
)
counter
=
@
findEmojiIcon
(
emoji
).
siblings
(
".counter"
)
emojiIcon
=
counter
.
parent
()
if
parseInt
(
counter
.
text
())
>
1
if
parseInt
(
counter
.
text
())
>
1
counter
.
text
(
parseInt
(
counter
.
text
())
-
1
)
counter
.
text
(
parseInt
(
counter
.
text
())
-
1
)
counter
.
parent
()
.
removeClass
(
"active"
)
emojiIcon
.
removeClass
(
"active"
)
@
removeMeFromAuthorList
(
emoji
)
@
removeMeFromAuthorList
(
emoji
)
else
if
emoji
==
"thumbsup"
||
emoji
==
"thumbsdown"
emojiIcon
.
tooltip
(
"destroy"
)
counter
.
text
(
0
)
emojiIcon
.
removeClass
(
"active"
)
else
else
award
=
counter
.
parent
()
emojiIcon
.
tooltip
(
"destroy"
)
award
.
tooltip
(
"destroy"
)
emojiIcon
.
remove
()
award
.
remove
()
removeMeFromAuthorList
:
(
emoji
)
->
removeMeFromAuthorList
:
(
emoji
)
->
award_block
=
@
findEmojiIcon
(
emoji
).
parent
()
award_block
=
@
findEmojiIcon
(
emoji
).
parent
()
...
@@ -127,9 +131,6 @@ class @AwardsHandler
...
@@ -127,9 +131,6 @@ class @AwardsHandler
getFrequentlyUsedEmojis
:
->
getFrequentlyUsedEmojis
:
->
frequently_used_emojis
=
(
$
.
cookie
(
'frequently_used_emojis'
)
||
""
).
split
(
","
)
frequently_used_emojis
=
(
$
.
cookie
(
'frequently_used_emojis'
)
||
""
).
split
(
","
)
frequently_used_emojis
=
[
"thumbsup"
,
"thumbsdown"
].
concat
(
frequently_used_emojis
)
_
.
compact
(
_
.
uniq
(
frequently_used_emojis
))
_
.
compact
(
_
.
uniq
(
frequently_used_emojis
))
renderFrequentlyUsedBlock
:
->
renderFrequentlyUsedBlock
:
->
...
...
app/models/note.rb
View file @
a1b63e12
...
@@ -107,9 +107,16 @@ class Note < ActiveRecord::Base
...
@@ -107,9 +107,16 @@ class Note < ActiveRecord::Base
end
end
def
grouped_awards
def
grouped_awards
notes
=
{}
awards
.
select
(
:note
).
distinct
.
map
do
|
note
|
awards
.
select
(
:note
).
distinct
.
map
do
|
note
|
[
note
.
note
,
where
(
note:
note
.
note
)
]
notes
[
note
.
note
]
=
where
(
note:
note
.
note
)
end
end
notes
[
"thumbsup"
]
||=
Note
.
none
notes
[
"thumbsdown"
]
||=
Note
.
none
notes
end
end
end
end
...
...
spec/models/note_spec.rb
View file @
a1b63e12
...
@@ -137,9 +137,14 @@ describe Note, models: true do
...
@@ -137,9 +137,14 @@ describe Note, models: true do
create
:note
,
note:
"smile"
,
is_award:
true
create
:note
,
note:
"smile"
,
is_award:
true
end
end
it
"returns grouped array of notes"
do
it
"returns grouped hash of notes"
do
expect
(
Note
.
grouped_awards
.
first
.
first
).
to
eq
(
"smile"
)
expect
(
Note
.
grouped_awards
.
keys
.
size
).
to
eq
(
3
)
expect
(
Note
.
grouped_awards
.
first
.
last
).
to
match_array
(
Note
.
all
)
expect
(
Note
.
grouped_awards
[
"smile"
]).
to
match_array
(
Note
.
all
)
end
it
"returns thumbsup and thumbsdown always"
do
expect
(
Note
.
grouped_awards
[
"thumbsup"
]).
to
match_array
(
Note
.
none
)
expect
(
Note
.
grouped_awards
[
"thumbsdown"
]).
to
match_array
(
Note
.
none
)
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