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
6d19d6a2
Commit
6d19d6a2
authored
May 20, 2016
by
ZJ van de Weg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor js fixes
parent
4d6c51e2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
151 additions
and
132 deletions
+151
-132
dispatcher.js.coffee
app/assets/javascripts/dispatcher.js.coffee
+2
-2
notes.js.coffee
app/assets/javascripts/notes.js.coffee
+1
-1
notes.scss
app/assets/stylesheets/pages/notes.scss
+141
-116
_note.html.haml
app/views/projects/notes/_note.html.haml
+7
-13
No files found.
app/assets/javascripts/dispatcher.js.coffee
View file @
6d19d6a2
...
@@ -23,7 +23,7 @@ class Dispatcher
...
@@ -23,7 +23,7 @@ class Dispatcher
new
Issue
()
new
Issue
()
shortcut_handler
=
new
ShortcutsIssuable
()
shortcut_handler
=
new
ShortcutsIssuable
()
new
ZenMode
()
new
ZenMode
()
window
.
awards
_h
andler
=
new
AwardsHandler
()
window
.
awards
H
andler
=
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'
...
@@ -54,7 +54,7 @@ class Dispatcher
...
@@ -54,7 +54,7 @@ class Dispatcher
new
Diff
()
new
Diff
()
shortcut_handler
=
new
ShortcutsIssuable
(
true
)
shortcut_handler
=
new
ShortcutsIssuable
(
true
)
new
ZenMode
()
new
ZenMode
()
window
.
awards
_h
andler
=
new
AwardsHandler
()
window
.
awards
H
andler
=
new
AwardsHandler
()
when
"projects:merge_requests:diffs"
when
"projects:merge_requests:diffs"
new
Diff
()
new
Diff
()
new
ZenMode
()
new
ZenMode
()
...
...
app/assets/javascripts/notes.js.coffee
View file @
6d19d6a2
...
@@ -167,7 +167,7 @@ class @Notes
...
@@ -167,7 +167,7 @@ class @Notes
return
return
if
note
.
award
if
note
.
award
awardsHandler
.
addAwardToEmojiBar
(
note
.
n
ot
e
)
awardsHandler
.
addAwardToEmojiBar
(
note
.
n
am
e
)
awardsHandler
.
scrollToAwards
()
awardsHandler
.
scrollToAwards
()
# render note if it not present in loaded list
# render note if it not present in loaded list
...
...
app/assets/stylesheets/pages/notes.scss
View file @
6d19d6a2
...
@@ -20,9 +20,15 @@ ul.notes {
...
@@ -20,9 +20,15 @@ ul.notes {
.timeline-content
{
.timeline-content
{
margin-left
:
55px
;
margin-left
:
55px
;
&
.timeline-content-form
{
@media
(
max-width
:
$screen-sm-max
)
{
margin-left
:
0
;
}
}
}
}
.note
_created_
ago
,
.note-updated-at
{
.note
-created-
ago
,
.note-updated-at
{
white-space
:
nowrap
;
white-space
:
nowrap
;
}
}
...
@@ -39,53 +45,6 @@ ul.notes {
...
@@ -39,53 +45,6 @@ ul.notes {
}
}
}
}
.discussion-header
,
.note-header
{
@extend
.cgray
;
a
:hover
{
text-decoration
:
none
;
}
.avatar
{
float
:
left
;
margin-right
:
10px
;
}
.discussion-last-update
,
.note-last-update
{
&
:before
{
content
:
"\00b7"
;
}
a
{
color
:
$gl-gray
;
&
:hover
{
text-decoration
:
underline
;
}
}
}
.author
{
color
:
#4c4e54
;
margin-right
:
3px
;
&
:hover
{
color
:
$gl-link-color
;
}
}
.author-username
{
}
.note-role
{
float
:
right
;
margin-top
:
1px
;
border
:
1px
solid
#bbb
;
background-color
:
transparent
;
color
:
$gl-gray
;
}
}
.discussion-body
{
.discussion-body
{
padding-top
:
15px
;
padding-top
:
15px
;
}
}
...
@@ -99,12 +58,12 @@ ul.notes {
...
@@ -99,12 +58,12 @@ ul.notes {
.note
{
.note
{
display
:
block
;
display
:
block
;
position
:
relative
;
position
:
relative
;
border-bottom
:
1px
solid
$table-border-gray
;
&
.is-editting
{
&
.is-editting
{
.note-header
,
.note-header
,
.note-text
,
.note-text
,
.edited-text
,
.edited-text
{
.note-awards
{
display
:
none
;
display
:
none
;
}
}
...
@@ -114,16 +73,16 @@ ul.notes {
...
@@ -114,16 +73,16 @@ ul.notes {
}
}
.note-body
{
.note-body
{
overflow
:
auto
;
.note-text
{
.note-text
{
overflow
:
auto
;
overflow
:
auto
;
word-wrap
:
break-word
;
word-wrap
:
break-word
;
@include
md-typography
;
@include
md-typography
;
// On diffs code should wrap nicely and not overflow
// On diffs code should wrap nicely and not overflow
pre
{
code
{
code
{
white-space
:
pre-wrap
;
white-space
:
pre-wrap
;
}
}
}
// Reset ul style types since we're nested inside a ul already
// Reset ul style types since we're nested inside a ul already
...
@@ -150,6 +109,10 @@ ul.notes {
...
@@ -150,6 +109,10 @@ ul.notes {
border-color
:
darken
(
#f5f5f5
,
8%
);
border-color
:
darken
(
#f5f5f5
,
8%
);
margin
:
10px
0
;
margin
:
10px
0
;
}
}
code
{
word-break
:
keep-all
;
}
}
}
}
}
...
@@ -157,9 +120,6 @@ ul.notes {
...
@@ -157,9 +120,6 @@ ul.notes {
padding-bottom
:
3px
;
padding-bottom
:
3px
;
}
}
&
:last-child
{
border-bottom
:
1px
solid
$border-color
;
}
}
}
}
}
...
@@ -177,60 +137,149 @@ ul.notes {
...
@@ -177,60 +137,149 @@ ul.notes {
font-family
:
$regular_font
;
font-family
:
$regular_font
;
td
{
td
{
border
:
1px
solid
#ddd
;
border
:
1px
solid
$table-border-gray
;
border-left
:
none
;
border-left
:
none
;
&
.notes_line
{
&
.notes_line
{
vertical-align
:
middle
;
vertical-align
:
middle
;
text-align
:
center
;
text-align
:
center
;
padding
:
10px
0
;
padding
:
10px
0
;
background
:
#fff
;
background
:
$background-color
;
color
:
$text-color
;
color
:
$text-color
;
}
}
&
.notes_line2
{
&
.notes_line2
{
text-align
:
center
;
text-align
:
center
;
padding
:
10px
0
;
padding
:
10px
0
;
border-left
:
1px
solid
#ddd
!
important
;
border-left
:
1px
solid
#ddd
!
important
;
}
}
&
.notes_content
{
&
.notes_content
{
background-color
:
#fff
;
background-color
:
$background-color
;
border-width
:
1px
0
;
border-width
:
1px
0
;
padding
-top
:
0
;
padding
:
0
;
vertical-align
:
top
;
vertical-align
:
top
;
&
.parallel
{
white-space
:
normal
;
&
.parallel
{
border-width
:
1px
;
border-width
:
1px
;
}
}
.notes
{
background-color
:
$white-light
;
}
a
code
{
top
:
0
;
margin-right
:
0
;
}
}
}
}
}
}
}
.discussion-header
,
.note-header
{
a
{
color
:
inherit
;
&
:hover
{
color
:
$gl-link-color
;
text-decoration
:
none
;
}
}
.author_link
{
color
:
$gl-gray
;
}
}
.note-headline-light
,
.discussion-headline-light
{
color
:
$notes-light-color
;
}
.discussion-headline-light
{
a
{
color
:
$gl-link-color
;
}
}
/**
/**
* Actions for Discussions/Notes
* Actions for Discussions/Notes
*/
*/
.discussion
,
.discussion-actions
,
.note
{
.note-actions
{
.discussion-actions
,
float
:
right
;
.note-actions
{
margin-left
:
10px
;
float
:
right
;
color
:
$notes-action-color
;
margin-left
:
10px
;
}
.discussion-actions
{
@media
(
max-width
:
$screen-md-max
)
{
float
:
none
;
margin-left
:
0
;
.note-action-button
{
margin-left
:
0
;
}
}
}
a
{
.note-action-button
{
margin-left
:
5px
;
display
:
inline-block
;
color
:
$gl-gray
;
margin-left
:
10px
;
line-height
:
24px
;
i
.fa
{
.fa
{
font-size
:
16px
;
color
:
$notes-action-color
;
line-height
:
16px
;
position
:
relative
;
top
:
1px
;
font-size
:
17px
;
}
&
.js-note-delete
{
i
{
&
:hover
{
color
:
$gl-text-red
;
}
}
}
}
&
.js-note-edit
{
i
{
&
:hover
{
&
:hover
{
@extend
.cgray
;
color
:
$gl-link-color
;
&
.danger
{
@extend
.cred
;
}
}
}
}
}
}
}
}
}
.discussion-toggle-button
{
line-height
:
20px
;
font-size
:
13px
;
.fa
{
margin-right
:
3px
;
font-size
:
10px
;
line-height
:
18px
;
vertical-align
:
top
;
}
}
.note-role
{
position
:
relative
;
top
:
-2px
;
display
:
inline-block
;
padding-left
:
4px
;
padding-right
:
4px
;
color
:
$notes-role-color
;
font-size
:
12px
;
line-height
:
20px
;
border
:
1px
solid
$notes-role-border-color
;
border-radius
:
$border-radius-base
;
}
.diff-file
.note
.note-actions
{
.diff-file
.note
.note-actions
{
right
:
0
;
right
:
0
;
top
:
0
;
top
:
0
;
...
@@ -243,8 +292,7 @@ ul.notes {
...
@@ -243,8 +292,7 @@ ul.notes {
.diff-file
tr
.line_holder
{
.diff-file
tr
.line_holder
{
@mixin
show-add-diff-note
{
@mixin
show-add-diff-note
{
filter
:
alpha
(
opacity
=
100
);
display
:
inline-block
;
opacity
:
1
.0
;
}
}
.add-diff-note
{
.add-diff-note
{
...
@@ -254,17 +302,12 @@ ul.notes {
...
@@ -254,17 +302,12 @@ ul.notes {
padding
:
4px
;
padding
:
4px
;
font-size
:
16px
;
font-size
:
16px
;
color
:
$gl-link-color
;
color
:
$gl-link-color
;
margin-left
:
-
60
px
;
margin-left
:
-
56
px
;
position
:
absolute
;
position
:
absolute
;
z-index
:
10
;
z-index
:
10
;
width
:
32px
;
width
:
32px
;
transition
:
all
0
.2s
ease
;
// "hide" it by default
// "hide" it by default
opacity
:
0
.0
;
display
:
none
;
filter
:
alpha
(
opacity
=
0
);
&
:hover
{
&
:hover
{
background
:
$gl-info
;
background
:
$gl-info
;
color
:
#fff
;
color
:
#fff
;
...
@@ -280,38 +323,20 @@ ul.notes {
...
@@ -280,38 +323,20 @@ ul.notes {
}
}
}
}
.note-award-control
{
.disabled-comment
{
display
:
block
;
margin-left
:
-
$gl-padding-top
;
margin-right
:
-
$gl-padding-top
;
&
:hover
,
background-color
:
$gray-light
;
&
:focus
{
border-radius
:
$border-radius-base
;
text-decoration
:
none
;
border
:
1px
solid
$border-gray-normal
;
}
color
:
$note-disabled-comment-color
;
line-height
:
200px
;
.award-control-icon-loading
{
display
:
none
;
.disabled-comment-text
{
}
line-height
:
normal
;
&
.is-loading
{
.award-control-icon-normal
{
display
:
none
;
}
.award-control-icon-loading
{
display
:
block
;
}
}
}
.note-awards
{
.awards
{
padding-top
:
10px
;
}
}
.award-control
{
a
{
padding-top
:
2px
;
color
:
$gl-link-color
;
padding-bottom
:
2px
;
color
:
#8f8f8f
;
font-size
:
13px
;
}
}
}
}
app/views/projects/notes/_note.html.haml
View file @
6d19d6a2
...
@@ -9,20 +9,14 @@
...
@@ -9,20 +9,14 @@
=
image_tag
avatar_icon
(
note
.
author
),
alt:
''
,
class:
'avatar s40'
=
image_tag
avatar_icon
(
note
.
author
),
alt:
''
,
class:
'avatar s40'
.timeline-content
.timeline-content
.note-header
.note-header
=
link_to_member
(
note
.
project
,
note
.
author
,
avatar:
false
)
.inline.note-headline-light
=
note
.
author
.
to_reference
-
unless
note
.
system
commented
%a
{
href:
"##{dom_id(note)}"
}
=
time_ago_with_tooltip
(
note
.
created_at
,
placement:
'bottom'
,
html_class:
'note-created-ago'
)
.note-actions
.note-actions
-
if
current_user
.award-menu-holder.note-action-award-holder.js-award-holder.js-award-action-btn
{
data:
{
target:
"##{dom_id(note)} .js-awards-block"
}
}
=
link_to
'#'
,
title:
'Award emoji'
,
class:
'note-award-control js-add-award'
,
data:
{
award_menu_url:
emojis_path
,
position:
"right"
}
do
=
icon
(
'smile-o'
,
{
class:
"award-control-icon award-control-icon-normal"
})
=
icon
(
'spinner spin'
,
{
class:
"award-control-icon award-control-icon-loading"
})
-
if
note_editable?
(
note
)
=
link_to
'#'
,
title:
'Edit comment'
,
class:
'js-note-edit'
do
=
icon
(
'pencil-square-o'
)
=
link_to
namespace_project_note_path
(
note
.
project
.
namespace
,
note
.
project
,
note
),
title:
'Remove comment'
,
method: :delete
,
data:
{
confirm:
'Are you sure you want to remove this comment?'
},
remote:
true
,
class:
'js-note-delete danger'
do
=
icon
(
'trash-o'
)
-
unless
note
.
system
-
access
=
note
.
project
.
team
.
human_max_access
(
note
.
author
.
id
)
-
access
=
note
.
project
.
team
.
human_max_access
(
note
.
author
.
id
)
-
if
access
-
if
access
%span
.note-role
%span
.note-role
...
...
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