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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
7c491d4f
Commit
7c491d4f
authored
Aug 17, 2017
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Misc tweaks
parent
5f758aff
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
18 additions
and
21 deletions
+18
-21
app/helpers/notes_helper.rb
app/helpers/notes_helper.rb
+4
-4
app/serializers/note_entity.rb
app/serializers/note_entity.rb
+2
-2
app/serializers/note_user_entity.rb
app/serializers/note_user_entity.rb
+3
-0
app/serializers/user_note_entity.rb
app/serializers/user_note_entity.rb
+0
-9
app/views/projects/issues/_discussion.html.haml
app/views/projects/issues/_discussion.html.haml
+3
-5
app/views/projects/issues/show.html.haml
app/views/projects/issues/show.html.haml
+5
-0
app/views/shared/notes/_notes_with_form.html.haml
app/views/shared/notes/_notes_with_form.html.haml
+1
-1
No files found.
app/helpers/notes_helper.rb
View file @
7c491d4f
...
...
@@ -93,13 +93,13 @@ module NotesHelper
end
end
def
notes_url
(
extra_
params
=
{})
def
notes_url
(
params
=
{})
if
@snippet
.
is_a?
(
PersonalSnippet
)
snippet_notes_path
(
@snippet
,
extra_
params
)
snippet_notes_path
(
@snippet
,
params
)
else
params
=
{
target_id:
@noteable
.
id
,
target_type:
@noteable
.
class
.
name
.
underscore
}
params
.
merge!
(
target_id:
@noteable
.
id
,
target_type:
@noteable
.
class
.
name
.
underscore
)
project_noteable_notes_path
(
@project
,
params
.
merge
(
extra_params
)
)
project_noteable_notes_path
(
@project
,
params
)
end
end
...
...
app/serializers/note_entity.rb
View file @
7c491d4f
...
...
@@ -3,7 +3,7 @@ class NoteEntity < API::Entities::Note
expose
:type
expose
:author
,
using:
UserNote
Entity
expose
:author
,
using:
NoteUser
Entity
expose
:human_access
do
|
note
|
note
.
project
.
team
.
human_max_access
(
note
.
author_id
)
...
...
@@ -15,7 +15,7 @@ class NoteEntity < API::Entities::Note
expose
:redacted_note_html
,
as: :note_html
expose
:last_edited_at
,
if:
->
(
note
,
_
)
{
note
.
is_edited?
}
expose
:last_edited_by
,
using:
UserNote
Entity
,
if:
->
(
note
,
_
)
{
note
.
is_edited?
}
expose
:last_edited_by
,
using:
NoteUser
Entity
,
if:
->
(
note
,
_
)
{
note
.
is_edited?
}
expose
:current_user
do
expose
:can_edit
do
|
note
|
...
...
app/serializers/note_user_entity.rb
0 → 100644
View file @
7c491d4f
class
NoteUserEntity
<
UserEntity
unexpose
:web_url
end
app/serializers/user_note_entity.rb
deleted
100644 → 0
View file @
5f758aff
class
UserNoteEntity
<
API
::
Entities
::
UserBasic
include
RequestAwareEntity
unexpose
:web_url
expose
:path
do
|
user
|
user_path
(
user
)
end
end
app/views/projects/issues/_discussion.html.haml
View file @
7c491d4f
-
@gfm_form
=
true
-
content_for
:note_actions
do
-
if
can?
(
current_user
,
:update_issue
,
@issue
)
=
link_to
'Reopen issue'
,
issue_path
(
@issue
,
issue:
{
state_event: :reopen
},
format:
'json'
),
data:
{
original_text:
"Reopen issue"
,
alternative_text:
"Comment & reopen issue"
},
class:
"btn btn-nr btn-reopen btn-comment js-note-target-reopen
#{
issue_button_visibility
(
@issue
,
false
)
}
"
,
title:
'Reopen issue'
=
link_to
'Close issue'
,
issue_path
(
@issue
,
issue:
{
state_event: :close
},
format:
'json'
),
data:
{
original_text:
"Close issue"
,
alternative_text:
"Comment & close issue"
},
class:
"btn btn-nr btn-close btn-comment js-note-target-close
#{
issue_button_visibility
(
@issue
,
true
)
}
"
,
title:
'Close issue'
%section
.js-vue-notes-event
#js-vue-notes
{
data:
{
discussions_path:
discussions_
namespace_project_issue_path
(
@project
.
namespace
,
@project
,
@issue
,
format: :json
),
register_path:
"#{new_session_path(:user, redirect_to_referer: 'yes')}#register-pane"
,
#js-vue-notes
{
data:
{
discussions_path:
discussions_
project_issue_path
(
@project
,
@issue
,
format: :json
),
register_path:
new_session_path
(
:user
,
redirect_to_referer:
'yes'
,
anchor:
'register-pane'
)
,
new_session_path:
new_session_path
(
:user
,
redirect_to_referer:
'yes'
),
markdown_docs_path:
help_page_path
(
'user/markdown'
),
quick_actions_docs_path:
help_page_path
(
'user/project/quick_actions'
),
...
...
@@ -14,6 +15,3 @@
last_fetched_at:
Time
.
now
.
to_i
,
issue_data:
serialize_issuable
(
@issue
),
current_user_data:
UserSerializer
.
new
.
represent
(
current_user
).
to_json
}
}
-
content_for
:page_specific_javascripts
do
=
webpack_bundle_tag
'common_vue'
=
webpack_bundle_tag
'notes'
app/views/projects/issues/show.html.haml
View file @
7c491d4f
...
...
@@ -2,6 +2,11 @@
-
page_title
"
#{
@issue
.
title
}
(
#{
@issue
.
to_reference
}
)"
,
"Issues"
-
page_description
@issue
.
description
-
page_card_attributes
@issue
.
card_attributes
-
content_for
:page_specific_javascripts
do
=
webpack_bundle_tag
'common_vue'
=
webpack_bundle_tag
'notes'
-
can_update_issue
=
can?
(
current_user
,
:update_issue
,
@issue
)
-
can_report_spam
=
@issue
.
submittable_as_spam_by?
(
current_user
)
...
...
app/views/shared/notes/_notes_with_form.html.haml
View file @
7c491d4f
...
...
@@ -17,7 +17,7 @@
-
elsif
!
current_user
.disabled-comment.text-center.prepend-top-default
Please
=
link_to
"register"
,
new_session_path
(
:user
,
redirect_to_referer:
'yes'
),
class:
'js-register-link'
=
link_to
"register"
,
new_session_path
(
:user
,
redirect_to_referer:
'yes'
,
anchor:
'register-pane'
),
class:
'js-register-link'
or
=
link_to
"sign in"
,
new_session_path
(
:user
,
redirect_to_referer:
'yes'
),
class:
'js-sign-in-link'
to comment
...
...
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