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
3b06987c
Commit
3b06987c
authored
Jul 25, 2016
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hide resolve button when not allowed
parent
d76d051b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
23 deletions
+48
-23
app/views/discussions/_resolve_all.html.haml
app/views/discussions/_resolve_all.html.haml
+8
-4
app/views/projects/notes/_note.html.haml
app/views/projects/notes/_note.html.haml
+40
-19
No files found.
app/views/discussions/_resolve_all.html.haml
View file @
3b06987c
%resolve-all
{
":namespace"
=>
"'#{discussion.project.namespace.path}/#{discussion.project.path}'"
,
":discussion-id"
=>
"'#{discussion.id}'"
,
"inline-template"
=>
true
,
"v-cloak"
=>
true
}
-
if
discussion
.
can_resolve?
(
current_user
)
%resolve-all
{
":namespace"
=>
"'#{discussion.project.namespace.path}/#{discussion.project.path}'"
,
":discussion-id"
=>
"'#{discussion.id}'"
,
"inline-template"
=>
true
,
"v-cloak"
=>
true
}
%button
.btn.btn-default
{
type:
"button"
,
"@click"
=>
"resolve"
,
":disabled"
=>
"loading"
}
%button
.btn.btn-default
{
type:
"button"
,
"@click"
=>
"resolve"
,
":disabled"
=>
"loading"
}
=
icon
(
"spinner spin"
,
"v-show"
=>
"loading"
)
=
icon
(
"spinner spin"
,
"v-show"
=>
"loading"
)
{{ buttonText }}
{{ buttonText }}
app/views/projects/notes/_note.html.haml
View file @
3b06987c
...
@@ -16,20 +16,41 @@
...
@@ -16,20 +16,41 @@
commented
commented
%a
{
href:
"##{dom_id(note)}"
}
%a
{
href:
"##{dom_id(note)}"
}
=
time_ago_with_tooltip
(
note
.
created_at
,
placement:
'bottom'
,
html_class:
'note-created-ago'
)
=
time_ago_with_tooltip
(
note
.
created_at
,
placement:
'bottom'
,
html_class:
'note-created-ago'
)
-
unless
note
.
system?
.note-actions
.note-actions
-
access
=
note_max_access_for_user
(
note
)
-
access
=
note_max_access_for_user
(
note
)
-
if
access
and
not
note
.
system
-
if
access
%span
.note-role.hidden-xs
=
access
%span
.note-role.hidden-xs
=
access
-
if
!
note
.
system
&&
note
.
new_diff_note?
&&
current_user
%resolve-btn
{
":namespace"
=>
"'#{note.project.namespace.path}/#{note.project.path}'"
,
":discussion-id"
=>
"'#{note.discussion_id}'"
,
":note-id"
=>
note
.
id
,
":resolved"
=>
"false"
,
"inline-template"
=>
true
,
"v-ref:note_#{note.id}"
=>
true
}
-
if
note
.
resolvable?
-
if
can?
(
current_user
,
:resolve_note
,
note
)
%resolve-btn
{
":namespace"
=>
"'#{note.project.namespace.path}/#{note.project.path}'"
,
":discussion-id"
=>
"'#{note.discussion_id}'"
,
":note-id"
=>
note
.
id
,
":resolved"
=>
note
.
resolved?
,
"inline-template"
=>
true
,
"v-ref:note_#{note.id}"
=>
true
}
.note-action-button
.note-action-button
=
icon
(
"spin spinner"
,
"v-show"
=>
"loading"
)
=
icon
(
"spin spinner"
,
"v-show"
=>
"loading"
)
%button
.line-resolve-btn
{
type:
"button"
,
":class"
=>
"{ 'is-active': isResolved }"
,
":aria-label"
=>
"buttonText"
,
"@click"
=>
"resolve"
,
":title"
=>
"buttonText"
,
"v-show"
=>
"!loading"
,
"v-el:button"
=>
true
}
%button
.line-resolve-btn
{
type:
"button"
,
":class"
=>
"{ 'is-active': isResolved }"
,
":aria-label"
=>
"buttonText"
,
"@click"
=>
"resolve"
,
":title"
=>
"buttonText"
,
"v-show"
=>
"!loading"
,
"v-el:button"
=>
true
}
=
icon
(
"check"
)
=
icon
(
"check"
)
-
if
current_user
and
not
note
.
system
-
else
-# TODO: Just render status
-
if
current_user
-
if
note
.
emoji_awardable?
=
link_to
'#'
,
title:
'Award Emoji'
,
class:
'note-action-button note-emoji-button js-add-award js-note-emoji'
,
data:
{
position:
'right'
}
do
=
link_to
'#'
,
title:
'Award Emoji'
,
class:
'note-action-button note-emoji-button js-add-award js-note-emoji'
,
data:
{
position:
'right'
}
do
=
icon
(
'spinner spin'
)
=
icon
(
'spinner spin'
)
=
icon
(
'smile-o'
)
=
icon
(
'smile-o'
)
-
if
note_editable
-
if
note_editable
=
link_to
'#'
,
title:
'Edit comment'
,
class:
'note-action-button js-note-edit'
do
=
link_to
'#'
,
title:
'Edit comment'
,
class:
'note-action-button js-note-edit'
do
=
icon
(
'pencil'
)
=
icon
(
'pencil'
)
...
...
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