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
Tatuya Kamada
gitlab-ce
Commits
b7f0b22b
Commit
b7f0b22b
authored
Mar 29, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Started refactoring of note form
parent
3dd91f55
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
27 additions
and
39 deletions
+27
-39
app/assets/javascripts/notes.js.coffee
app/assets/javascripts/notes.js.coffee
+0
-9
app/assets/stylesheets/framework/common.scss
app/assets/stylesheets/framework/common.scss
+0
-7
app/assets/stylesheets/pages/note_form.scss
app/assets/stylesheets/pages/note_form.scss
+4
-3
app/views/projects/_zen.html.haml
app/views/projects/_zen.html.haml
+3
-4
app/views/projects/notes/_form.html.haml
app/views/projects/notes/_form.html.haml
+1
-1
app/views/projects/notes/_notes_with_form.html.haml
app/views/projects/notes/_notes_with_form.html.haml
+19
-15
No files found.
app/assets/javascripts/notes.js.coffee
View file @
b7f0b22b
...
@@ -251,14 +251,9 @@ class @Notes
...
@@ -251,14 +251,9 @@ class @Notes
Sets some hidden fields in the form.
Sets some hidden fields in the form.
###
###
setupMainTargetNoteForm
:
->
setupMainTargetNoteForm
:
->
# find the form
# find the form
form
=
$
(
".js-new-note-form"
)
form
=
$
(
".js-new-note-form"
)
# insert the form after the button
form
.
clone
().
replaceAll
$
(
".js-main-target-form"
)
form
=
form
.
prev
(
"form"
)
# show the form
# show the form
@
setupNoteForm
(
form
)
@
setupNoteForm
(
form
)
...
@@ -266,10 +261,6 @@ class @Notes
...
@@ -266,10 +261,6 @@ class @Notes
form
.
removeClass
"js-new-note-form"
form
.
removeClass
"js-new-note-form"
form
.
addClass
"js-main-target-form"
form
.
addClass
"js-main-target-form"
# remove unnecessary fields and buttons
form
.
find
(
"#note_line_code"
).
remove
()
form
.
find
(
".js-close-discussion-note-form"
).
remove
()
###
###
General note form setup.
General note form setup.
...
...
app/assets/stylesheets/framework/common.scss
View file @
b7f0b22b
...
@@ -125,13 +125,6 @@ p.time {
...
@@ -125,13 +125,6 @@ p.time {
height
:
150px
;
height
:
150px
;
}
}
// Fixes alignment on notes.
.new_note
{
label
{
text-align
:
left
;
}
}
// Fix issue with notes & lists creating a bunch of bottom borders.
// Fix issue with notes & lists creating a bunch of bottom borders.
li
.note
{
li
.note
{
img
{
max-width
:
100%
}
img
{
max-width
:
100%
}
...
...
app/assets/stylesheets/pages/note_form.scss
View file @
b7f0b22b
...
@@ -17,16 +17,17 @@
...
@@ -17,16 +17,17 @@
}
}
.diff-file
,
.diff-file
,
.discussion
{
.discussion
{
.new
_
note
{
.new
-
note
{
margin
:
0
;
margin
:
0
;
border
:
none
;
border
:
none
;
}
}
}
}
.new_note
{
.new-note
{
display
:
none
;
display
:
none
;
}
}
.new
_
note
,
.note-edit-form
{
.new
-
note
,
.note-edit-form
{
.note-form-actions
{
.note-form-actions
{
margin-top
:
$gl-padding
;
margin-top
:
$gl-padding
;
}
}
...
...
app/views/projects/_zen.html.haml
View file @
b7f0b22b
...
@@ -5,8 +5,7 @@
...
@@ -5,8 +5,7 @@
=
f
.
text_area
attr
,
class:
classes
=
f
.
text_area
attr
,
class:
classes
-
else
-
else
=
text_area_tag
attr
,
nil
,
class:
classes
=
text_area_tag
attr
,
nil
,
class:
classes
%a
.js-zen-enter
(
tabindex=
"-1"
href=
"#"
)
%a
.js-zen-enter
{
tabindex:
"-1"
,
href:
"#"
}
=
icon
(
'expand'
)
Go full screen
Edit in fullscreen
%a
.js-zen-leave
{
tabindex:
"-1"
,
href:
"#"
}
%a
.js-zen-leave
(
tabindex=
"-1"
href=
"#"
)
=
icon
(
'compress'
)
=
icon
(
'compress'
)
app/views/projects/notes/_form.html.haml
View file @
b7f0b22b
=
form_for
[
@project
.
namespace
.
becomes
(
Namespace
),
@project
,
@note
],
remote:
true
,
html:
{
:'data-type'
=>
'json'
,
multipart:
true
,
id:
nil
,
class:
"new
_
note js-new-note-form js-quick-submit common-note-form gfm-form"
},
authenticity_token:
true
do
|
f
|
=
form_for
[
@project
.
namespace
.
becomes
(
Namespace
),
@project
,
@note
],
remote:
true
,
html:
{
:'data-type'
=>
'json'
,
multipart:
true
,
id:
nil
,
class:
"new
-
note js-new-note-form js-quick-submit common-note-form gfm-form"
},
authenticity_token:
true
do
|
f
|
=
hidden_field_tag
:view
,
diff_view
=
hidden_field_tag
:view
,
diff_view
=
hidden_field_tag
:line_type
=
hidden_field_tag
:line_type
=
note_target_fields
(
@note
)
=
note_target_fields
(
@note
)
...
...
app/views/projects/notes/_notes_with_form.html.haml
View file @
b7f0b22b
%ul
#notes-list
.notes.main-notes-list.timeline
%ul
#notes-list
.notes.main-notes-list.timeline
=
render
"projects/notes/notes"
=
render
"projects/notes/notes"
.js-notes-busy
%li
.timeline-entry
.timeline-icon
.js-main-target-form
-
if
can?
current_user
,
:create_note
,
@project
-
if
can?
current_user
,
:create_note
,
@project
%a
.author_link
{
href:
user_path
(
current_user
)
}
=
render
"projects/notes/form"
,
view:
diff_view
=
image_tag
avatar_icon
(
current_user
),
alt:
current_user
.
to_reference
,
class:
'avatar s40'
-
else
.timeline-content
.disabled-comment-area
.js-main-target-form
.disabled-profile
-
if
can?
current_user
,
:create_note
,
@project
.disabled-comment
=
render
"projects/notes/form"
,
view:
diff_view
%span
-
else
Please
.disabled-comment-area
=
link_to
"register"
,
new_user_session_path
.disabled-profile
or
.disabled-comment
=
link_to
"login"
,
new_user_session_path
%span
to post a comment
Please
=
link_to
"register"
,
new_user_session_path
or
=
link_to
"login"
,
new_user_session_path
to post a comment
:javascript
:javascript
var
notes
=
new
Notes
(
"
#{
namespace_project_notes_path
(
namespace_id:
@project
.
namespace
,
target_id:
@noteable
.
id
,
target_type:
@noteable
.
class
.
name
.
underscore
)
}
"
,
#{
@notes
.
map
(
&
:id
).
to_json
}
,
#{
Time
.
now
.
to_i
}
,
"
#{
diff_view
}
"
)
var
notes
=
new
Notes
(
"
#{
namespace_project_notes_path
(
namespace_id:
@project
.
namespace
,
target_id:
@noteable
.
id
,
target_type:
@noteable
.
class
.
name
.
underscore
)
}
"
,
#{
@notes
.
map
(
&
:id
).
to_json
}
,
#{
Time
.
now
.
to_i
}
,
"
#{
diff_view
}
"
)
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