summaryrefslogtreecommitdiff
path: root/app/views/profiles/keys
diff options
context:
space:
mode:
authorNick Thomas <nick@gitlab.com>2017-08-21 15:01:05 +0100
committerNick Thomas <nick@gitlab.com>2017-08-30 20:50:44 +0100
commitb49b7bc147955df6589b13942d0437a3b4518c7b (patch)
treec796cb83a10509aad8b5aeae39e139db2fdb3156 /app/views/profiles/keys
parentb0f982fbdf69c292ab4530c0aaaf1ab42f4e7a01 (diff)
downloadgitlab-ce-b49b7bc147955df6589b13942d0437a3b4518c7b.tar.gz
Warn users when their keys are invalid
Diffstat (limited to 'app/views/profiles/keys')
-rw-r--r--app/views/profiles/keys/_key.html.haml8
-rw-r--r--app/views/profiles/keys/_key_details.html.haml1
2 files changed, 8 insertions, 1 deletions
diff --git a/app/views/profiles/keys/_key.html.haml b/app/views/profiles/keys/_key.html.haml
index d2a60ac2867..99b9a05fff6 100644
--- a/app/views/profiles/keys/_key.html.haml
+++ b/app/views/profiles/keys/_key.html.haml
@@ -1,6 +1,12 @@
%li.key-list-item
.pull-left.append-right-10
- = icon 'key', class: "settings-list-icon hidden-xs"
+ - if key.valid?
+ = icon 'key', class: 'settings-list-icon hidden-xs'
+ - else
+ = icon 'exclamation-triangle', class: 'settings-list-icon hidden-xs',
+ title: 'The key is disabled because it is invalid'
+
+
.key-list-item-info
= link_to path_to_key(key, is_admin), class: "title" do
= key.title
diff --git a/app/views/profiles/keys/_key_details.html.haml b/app/views/profiles/keys/_key_details.html.haml
index d44603c638c..cf70320e7a8 100644
--- a/app/views/profiles/keys/_key_details.html.haml
+++ b/app/views/profiles/keys/_key_details.html.haml
@@ -16,6 +16,7 @@
%strong= @key.last_used_at.try(:to_s, :medium) || 'N/A'
.col-md-8
+ = form_errors(@key, 'The key has the following') unless @key.valid?
%p
%span.light Fingerprint:
%code.key-fingerprint= @key.fingerprint