Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Slaughter <pslaughter@gitlab.com>2019-05-29 16:47:40 +0300
committerDenys Mishunov <dmishunov@gitlab.com>2019-05-31 17:13:53 +0300
commit6e83a31f3388d2d1abadcc4775a168db35892e2c (patch)
tree82f3eaa37b2832a9164c0589272c322bd3087be5 /app/views/profiles
parentbe01c431423eaba1e9aefdca77eb9ac5c054e6ad (diff)
Resolved EE differences in app/views/profiles/keys
**How?** It creates a base method `can_delete?` on Key which will always be true in CE and is overridden in EE. Added changelog entry
Diffstat (limited to 'app/views/profiles')
-rw-r--r--app/views/profiles/keys/_key.html.haml7
-rw-r--r--app/views/profiles/keys/_key_details.html.haml3
2 files changed, 6 insertions, 4 deletions
diff --git a/app/views/profiles/keys/_key.html.haml b/app/views/profiles/keys/_key.html.haml
index 47494fc3f06..b9d73d89334 100644
--- a/app/views/profiles/keys/_key.html.haml
+++ b/app/views/profiles/keys/_key.html.haml
@@ -18,6 +18,7 @@
.float-right
%span.key-created-at
= s_('Profiles|Created %{time_ago}'.html_safe) % { time_ago:time_ago_with_tooltip(key.created_at)}
- = link_to path_to_key(key, is_admin), data: { confirm: _('Are you sure?')}, method: :delete, class: "btn btn-transparent prepend-left-10" do
- %span.sr-only= _('Remove')
- = icon('trash')
+ - if key.can_delete?
+ = link_to path_to_key(key, is_admin), data: { confirm: _('Are you sure?')}, method: :delete, class: "btn btn-transparent prepend-left-10" do
+ %span.sr-only= _('Remove')
+ = icon('trash')
diff --git a/app/views/profiles/keys/_key_details.html.haml b/app/views/profiles/keys/_key_details.html.haml
index dcdb7fc63b1..0ef01dec493 100644
--- a/app/views/profiles/keys/_key_details.html.haml
+++ b/app/views/profiles/keys/_key_details.html.haml
@@ -24,4 +24,5 @@
= @key.key
.col-md-12
.float-right
- = link_to _('Remove'), path_to_key(@key, is_admin), data: {confirm: _('Are you sure?')}, method: :delete, class: "btn btn-remove delete-key qa-delete-key-button"
+ - if @key.can_delete?
+ = link_to _('Remove'), path_to_key(@key, is_admin), data: {confirm: _('Are you sure?')}, method: :delete, class: "btn btn-remove delete-key qa-delete-key-button"