summaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorJacob Schatz <jacobschatz@Jacobs-MBP.fios-router.home>2016-04-07 07:09:31 -0400
committerJacob Schatz <jacobschatz@Jacobs-MBP.fios-router.home>2016-04-07 07:09:31 -0400
commit92649ca97a02021695eb4dc36fa59c1a8454bd11 (patch)
tree8bdf4ee4716b92e811533f860064986c9530e7a2 /app/views
parent936be025cde7fad6857410ef2cd842f2b1fc2a67 (diff)
downloadgitlab-ce-92649ca97a02021695eb4dc36fa59c1a8454bd11.tar.gz
Hide "assign to me" link if not alloweddont-assign-me-if-you-arent-allow
Diffstat (limited to 'app/views')
-rw-r--r--app/views/shared/issuable/_sidebar.html.haml12
1 files changed, 7 insertions, 5 deletions
diff --git a/app/views/shared/issuable/_sidebar.html.haml b/app/views/shared/issuable/_sidebar.html.haml
index 47e544acf52..43883a18fa9 100644
--- a/app/views/shared/issuable/_sidebar.html.haml
+++ b/app/views/shared/issuable/_sidebar.html.haml
@@ -20,6 +20,7 @@
Next
= form_for [@project.namespace.becomes(Namespace), @project, issuable], remote: true, html: {class: 'issuable-context-form inline-update js-issuable-update'} do |f|
+ - can_edit_assignee = can?(current_user, :"admin_#{issuable.to_ability_name}", @project)
.block.assignee
.sidebar-collapsed-icon.sidebar-collapsed-user{data: {toggle: "tooltip", placement: "left", container: "body"}, title: (issuable.assignee.to_reference if issuable.assignee)}
- if issuable.assignee
@@ -29,9 +30,9 @@
.title.hide-collapsed
Assignee
= icon('spinner spin', class: 'block-loading')
- - if can?(current_user, :"admin_#{issuable.to_ability_name}", @project)
+ - if can_edit_assignee
= link_to 'Edit', '#', class: 'edit-link pull-right'
- .value.bold.hide-collapsed
+ .value.bold.hide-collapsed{data: {can_edit_assign: can_edit_assignee}}
- if issuable.assignee
= link_to_member(@project, issuable.assignee, size: 32) do
- if issuable.instance_of?(MergeRequest) && !issuable.can_be_merged_by?(issuable.assignee)
@@ -41,9 +42,10 @@
= issuable.assignee.to_reference
- else
%span.assign-yourself
- No assignee -
- %a.js-assign-yourself{ href: '#' }
- assign yourself
+ No assignee
+ - if can_edit_assignee
+ %a.js-assign-yourself{ href: '#' }
+ \- assign yourself
.selectbox.hide-collapsed
= f.hidden_field 'assignee_id', value: issuable.assignee_id, id: 'issue_assignee_id'