From 5403bf6725e41178a04a2a522d1eaea8d85b6310 Mon Sep 17 00:00:00 2001 From: Luke Bennett Date: Wed, 27 Jun 2018 01:50:43 +0100 Subject: Use correct conditional to show label edit and delete --- app/views/shared/_label.html.haml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/views/shared/_label.html.haml b/app/views/shared/_label.html.haml index 5eec7b02b54..2afe697fc52 100644 --- a/app/views/shared/_label.html.haml +++ b/app/views/shared/_label.html.haml @@ -21,6 +21,7 @@ = sprite_icon('star-o') %button.label-action.remove-priority.btn.btn-transparent.has-tooltip{ title: _('Remove priority'), type: 'button', data: { placement: 'top' }, aria_label: _('Deprioritize label') } = sprite_icon('star') + - if can?(current_user, :admin_label, label) %li.inline = link_to edit_label_path(label), class: 'btn btn-transparent label-action', aria_label: 'Edit label' do = sprite_icon('pencil') @@ -42,9 +43,10 @@ container: 'body', toggle: 'modal' } } = _('Promote to group label') - %li - %span{ data: { toggle: 'modal', target: "#modal-delete-label-#{label.id}" } } - %button.text-danger.remove-row{ type: 'button' }= _('Delete') + - if can?(current_user, :admin_label, label) + %li + %span{ data: { toggle: 'modal', target: "#modal-delete-label-#{label.id}" } } + %button.text-danger.remove-row{ type: 'button' }= _('Delete') - if current_user %li.inline.label-subscription - if can_subscribe_to_label_in_different_levels?(label) -- cgit v1.2.1