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
Jérome Perrin
gitlab-ce
Commits
83a588c3
Commit
83a588c3
authored
Sep 01, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'comment-and-close' into 'master'
Comment and close Fixes #1240 See merge request !1055
parents
2dc31b76
99425a12
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
6 deletions
+37
-6
app/assets/javascripts/notes.js.coffee
app/assets/javascripts/notes.js.coffee
+33
-2
app/views/projects/issues/show.html.haml
app/views/projects/issues/show.html.haml
+2
-2
app/views/projects/merge_requests/_show.html.haml
app/views/projects/merge_requests/_show.html.haml
+2
-2
No files found.
app/assets/javascripts/notes.js.coffee
View file @
83a588c3
...
...
@@ -16,13 +16,18 @@ class Notes
$
(
document
).
on
"ajax:success"
,
".js-main-target-form"
,
@
addNote
$
(
document
).
on
"ajax:success"
,
".js-discussion-note-form"
,
@
addDiscussionNote
# change note in UI after update
# change note in UI after update
$
(
document
).
on
"ajax:success"
,
"form.edit_note"
,
@
updateNote
# Edit note link
$
(
document
).
on
"click"
,
".js-note-edit"
,
@
showEditForm
$
(
document
).
on
"click"
,
".note-edit-cancel"
,
@
cancelEdit
# Reopen and close actions for Issue/MR combined with note form submit
$
(
document
).
on
"click"
,
".js-note-target-reopen"
,
@
targetReopen
$
(
document
).
on
"click"
,
".js-note-target-close"
,
@
targetClose
$
(
document
).
on
"keyup"
,
".js-note-text"
,
@
updateTargetButtons
# remove a note (in general)
$
(
document
).
on
"click"
,
".js-note-delete"
,
@
removeNote
...
...
@@ -78,7 +83,9 @@ class Notes
$
(
document
).
off
"click"
,
".js-add-diff-note-button"
$
(
document
).
off
"visibilitychange"
$
(
document
).
off
"keypress"
,
@
notes_forms
$
(
document
).
off
"keyup"
,
".js-note-text"
$
(
document
).
off
"click"
,
".js-note-target-reopen"
$
(
document
).
off
"click"
,
".js-note-target-close"
initRefresh
:
->
clearInterval
(
Notes
.
interval
)
...
...
@@ -478,4 +485,28 @@ class Notes
visibilityChange
:
=>
@
refresh
()
targetReopen
:
(
e
)
=>
@
submitNoteForm
(
$
(
e
.
target
).
parents
(
'form'
))
targetClose
:
(
e
)
=>
@
submitNoteForm
(
$
(
e
.
target
).
parents
(
'form'
))
submitNoteForm
:
(
form
)
=>
noteText
=
form
.
find
(
".js-note-text"
).
val
()
if
noteText
.
trim
().
length
>
0
form
.
submit
()
updateTargetButtons
:
(
e
)
=>
textarea
=
$
(
e
.
target
)
form
=
textarea
.
parents
(
'form'
)
if
textarea
.
val
().
trim
().
length
>
0
form
.
find
(
'.js-note-target-reopen'
).
text
(
'Comment & reopen'
)
form
.
find
(
'.js-note-target-close'
).
text
(
'Comment & close'
)
else
form
.
find
(
'.js-note-target-reopen'
).
text
(
'Reopen'
)
form
.
find
(
'.js-note-target-close'
).
text
(
'Close'
)
@
Notes
=
Notes
app/views/projects/issues/show.html.haml
View file @
83a588c3
...
...
@@ -57,9 +57,9 @@
-
content_for
:note_actions
do
-
if
can?
(
current_user
,
:modify_issue
,
@issue
)
-
if
@issue
.
closed?
=
link_to
'Reopen Issue'
,
project_issue_path
(
@project
,
@issue
,
issue:
{
state_event: :reopen
},
status_only:
true
),
method: :put
,
class:
"btn btn-grouped btn-reopen"
=
link_to
'Reopen Issue'
,
project_issue_path
(
@project
,
@issue
,
issue:
{
state_event: :reopen
},
status_only:
true
),
method: :put
,
class:
"btn btn-grouped btn-reopen js-note-target-reopen"
,
title:
'Reopen Issue'
-
else
=
link_to
'Close Issue'
,
project_issue_path
(
@project
,
@issue
,
issue:
{
state_event: :close
},
status_only:
true
),
method: :put
,
class:
"btn btn-grouped btn-close"
,
title:
"Close Issue"
=
link_to
'Close Issue'
,
project_issue_path
(
@project
,
@issue
,
issue:
{
state_event: :close
},
status_only:
true
),
method: :put
,
class:
"btn btn-grouped btn-close
js-note-target-close
"
,
title:
"Close Issue"
.participants
%cite
.cgray
#{
@issue
.
participants
.
count
}
participants
...
...
app/views/projects/merge_requests/_show.html.haml
View file @
83a588c3
...
...
@@ -22,9 +22,9 @@
-
content_for
:note_actions
do
-
if
can?
(
current_user
,
:modify_merge_request
,
@merge_request
)
-
unless
@merge_request
.
closed?
||
@merge_request
.
merged?
=
link_to
'Close'
,
project_merge_request_path
(
@project
,
@merge_request
,
merge_request:
{
state_event: :close
}),
method: :put
,
class:
"btn btn-grouped btn-close close-mr-link"
,
title:
"Close merge request"
=
link_to
'Close'
,
project_merge_request_path
(
@project
,
@merge_request
,
merge_request:
{
state_event: :close
}),
method: :put
,
class:
"btn btn-grouped btn-close close-mr-link
js-note-target-close
"
,
title:
"Close merge request"
-
if
@merge_request
.
closed?
=
link_to
'Reopen'
,
project_merge_request_path
(
@project
,
@merge_request
,
merge_request:
{
state_event: :reopen
}),
method: :put
,
class:
"btn btn-grouped btn-reopen reopen-mr-link
"
,
title:
"Close
merge request"
=
link_to
'Reopen'
,
project_merge_request_path
(
@project
,
@merge_request
,
merge_request:
{
state_event: :reopen
}),
method: :put
,
class:
"btn btn-grouped btn-reopen reopen-mr-link
js-note-target-reopen"
,
title:
"Reopen
merge request"
.diffs.tab-content
-
if
current_page?
(
action:
'diffs'
)
...
...
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