Commit 3b06987c authored by Douwe Maan's avatar Douwe Maan

Hide resolve button when not allowed

parent d76d051b
%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 }}
...@@ -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')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment