summaryrefslogtreecommitdiff
path: root/app/views/shared
diff options
context:
space:
mode:
authorJarka Kadlecova <jarka@gitlab.com>2017-08-31 12:38:43 +0200
committerJarka Kadlecova <jarka@gitlab.com>2017-09-14 14:50:32 +0200
commit3d2917bf2e4799a7ba9bcb518c39605eca0a4b1d (patch)
tree7427f12c3289df2ad2860d201df44d5cf7d2ce78 /app/views/shared
parent073ba05d315881730de3995042cc4256c116e2c4 (diff)
downloadgitlab-ce-3d2917bf2e4799a7ba9bcb518c39605eca0a4b1d.tar.gz
Add the possibility to lock issuables from the frontend
Diffstat (limited to 'app/views/shared')
-rw-r--r--app/views/shared/issuable/_sidebar.html.haml11
-rw-r--r--app/views/shared/notes/_notes_with_form.html.haml10
2 files changed, 20 insertions, 1 deletions
diff --git a/app/views/shared/issuable/_sidebar.html.haml b/app/views/shared/issuable/_sidebar.html.haml
index 9cae3f51825..38a54c232d0 100644
--- a/app/views/shared/issuable/_sidebar.html.haml
+++ b/app/views/shared/issuable/_sidebar.html.haml
@@ -131,6 +131,17 @@
%button.btn.btn-default.pull-right.js-subscribe-button.issuable-subscribe-button.hide-collapsed{ type: "button" }
%span= subscribed ? 'Unsubscribe' : 'Subscribe'
+ - if can_edit_issuable
+ - locked = issuable.discussion_locked?
+ .block.light.discussion-lock{ data: { lock: (!locked).to_s, url: "#{issuable_json_path(issuable)}?basic=true", issuable_type: issuable.class.to_s.underscore } }
+ .sidebar-collapsed-icon
+ = icon('rss', 'aria-hidden': 'true')
+ %span.issuable-header-text.hide-collapsed.pull-left
+ Discussion Lock
+ - subscribtion_status = locked ? 'locked' : 'not locked'
+ %button.btn.btn-default.pull-right.js-discussion-lock-button.issuable-discussion-lock-button.hide-collapsed{ type: "button" }
+ %span= locked ? 'Unlock' : 'Lock'
+
- project_ref = cross_project_reference(@project, issuable)
.block.project-reference
.sidebar-collapsed-icon.dont-change-state
diff --git a/app/views/shared/notes/_notes_with_form.html.haml b/app/views/shared/notes/_notes_with_form.html.haml
index e3e86709b8f..371a9523de9 100644
--- a/app/views/shared/notes/_notes_with_form.html.haml
+++ b/app/views/shared/notes/_notes_with_form.html.haml
@@ -1,3 +1,6 @@
+- issuable = @issue || @merge_request
+- discussion_locked = issuable&.discussion_locked?
+
%ul#notes-list.notes.main-notes-list.timeline
= render "shared/notes/notes"
@@ -21,5 +24,10 @@
or
= link_to "sign in", new_session_path(:user, redirect_to_referer: 'yes'), class: 'js-sign-in-link'
to comment
-
+- elsif discussion_locked
+ .discussion_locked
+ %span
+ This
+ = issuable.class.to_s
+ has been locked. Posting comments has been restricted to project members.
%script.js-notes-data{ type: "application/json" }= initial_notes_data(autocomplete).to_json.html_safe