diff options
Diffstat (limited to 'app/views/projects/buttons/_remove_tag.html.haml')
-rw-r--r-- | app/views/projects/buttons/_remove_tag.html.haml | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/app/views/projects/buttons/_remove_tag.html.haml b/app/views/projects/buttons/_remove_tag.html.haml index 58af0d91f30..060a854d4e4 100644 --- a/app/views/projects/buttons/_remove_tag.html.haml +++ b/app/views/projects/buttons/_remove_tag.html.haml @@ -1,6 +1,11 @@ - project = local_assigns.fetch(:project, nil) - tag = local_assigns.fetch(:tag, nil) - return unless project && tag +- title = s_('TagsPage|Delete tag') +- if protected_tag?(project, tag) + - title = s_('TagsPage|Delete protected tag') + - if !can?(current_user, :maintainer_access, project) + - title = s_('TagsPage|Only a project maintainer or owner can delete a protected tag') + - disabled = true -%button{ type: "button", class: "js-remove-tag js-confirm-modal-button gl-button btn btn-default btn-icon has-tooltip gl-ml-3\! #{protected_tag?(project, tag) ? 'disabled' : ''}", title: s_('TagsPage|Delete tag'), data: { container: 'body', path: project_tag_path(@project, tag.name), modal_attributes: delete_tag_modal_attributes(tag.name) } } - = sprite_icon('remove', css_class: 'gl-icon') += render Pajamas::ButtonComponent.new(variant: :default, icon: 'remove', button_options: { class: "js-delete-tag-button gl-ml-3\!", 'aria-label': s_('TagsPage|Delete tag'), title: title, disabled: disabled, data: { toggle: 'tooltip', container: 'body', path: project_tag_path(@project, tag.name), tag_name: tag.name, is_protected: protected_tag?(project, tag).to_s } }) |