diff options
author | Jan Provaznik <jprovaznik@gitlab.com> | 2019-05-28 13:05:20 +0300 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2019-05-28 13:05:20 +0300 |
commit | 4df0e2599bc9bd7c50b6acea02278c1fb97d3ead (patch) | |
tree | 9ec579188c4fe083d71da187c64277e3337df22b /app/views/shared | |
parent | 2d12e22299114490385693a57666d658f0909da7 (diff) |
Fix display of promote to group label
Since label presenter is used in label index view, label class
check doesn't work as expected because the class is now LabelPresenter.
Also `label.subject` doesn't work as expected now because Label's model
`subject` method is shadowed by Gitlab's presenter's method which uses
`subject` for referencing the original object.
Instead we use a presenter's method for both checks now.
`label_deletion_confirm_text` is not used anywhere so it's removed
Diffstat (limited to 'app/views/shared')
-rw-r--r-- | app/views/shared/_delete_label_modal.html.haml | 2 | ||||
-rw-r--r-- | app/views/shared/_label.html.haml | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/app/views/shared/_delete_label_modal.html.haml b/app/views/shared/_delete_label_modal.html.haml index 6bd8cadd7d9..f37dd2cdf02 100644 --- a/app/views/shared/_delete_label_modal.html.haml +++ b/app/views/shared/_delete_label_modal.html.haml @@ -9,7 +9,7 @@ .modal-body %p %strong= label.name - %span will be permanently deleted from #{label.subject.name}. This cannot be undone. + %span will be permanently deleted from #{label.subject_name}. This cannot be undone. .modal-footer %a{ href: '#', data: { dismiss: 'modal' }, class: 'btn btn-default' } Cancel diff --git a/app/views/shared/_label.html.haml b/app/views/shared/_label.html.haml index 2b4a24a001f..c4b7ef481fd 100644 --- a/app/views/shared/_label.html.haml +++ b/app/views/shared/_label.html.haml @@ -30,7 +30,7 @@ = sprite_icon('ellipsis_v') .dropdown-menu.dropdown-open-left %ul - - if label.is_a?(ProjectLabel) && label.project.group && can?(current_user, :admin_label, label.project.group) + - if label.project_label? && label.project.group && can?(current_user, :admin_label, label.project.group) %li %button.js-promote-project-label-button.btn.btn-transparent.btn-action{ disabled: true, type: 'button', data: { url: promote_project_label_path(label.project, label), |