From f0085d034b33adc78753e2952a5e04842ca979e3 Mon Sep 17 00:00:00 2001 From: Marin Jankovski Date: Mon, 29 Dec 2014 17:09:39 +0100 Subject: Reuse show page for user keys. --- app/views/admin/users/key.html.haml | 4 ++++ app/views/profiles/keys/_key_details.html.haml | 19 +++++++++++++++++++ app/views/profiles/keys/show.html.haml | 20 +------------------- 3 files changed, 24 insertions(+), 19 deletions(-) create mode 100644 app/views/admin/users/key.html.haml create mode 100644 app/views/profiles/keys/_key_details.html.haml diff --git a/app/views/admin/users/key.html.haml b/app/views/admin/users/key.html.haml new file mode 100644 index 00000000000..c2b6ffc1fa8 --- /dev/null +++ b/app/views/admin/users/key.html.haml @@ -0,0 +1,4 @@ += render "profiles/keys/key_details" + +.pull-right + = link_to 'Remove', remove_user_key_admin_user_path(@user, @key), data: {confirm: 'Are you sure?'}, method: :delete, class: "btn btn-remove delete-key" diff --git a/app/views/profiles/keys/_key_details.html.haml b/app/views/profiles/keys/_key_details.html.haml new file mode 100644 index 00000000000..b7e0029a8ac --- /dev/null +++ b/app/views/profiles/keys/_key_details.html.haml @@ -0,0 +1,19 @@ +.row + .col-md-4 + .panel.panel-default + .panel-heading + SSH Key + %ul.well-list + %li + %span.light Title: + %strong= @key.title + %li + %span.light Created on: + %strong= @key.created_at.stamp("Aug 21, 2011") + + .col-md-8 + %p + %span.light Fingerprint: + %strong= @key.fingerprint + %pre.well-pre + = @key.key diff --git a/app/views/profiles/keys/show.html.haml b/app/views/profiles/keys/show.html.haml index c4fc1bb269c..470b984d16c 100644 --- a/app/views/profiles/keys/show.html.haml +++ b/app/views/profiles/keys/show.html.haml @@ -1,22 +1,4 @@ -.row - .col-md-4 - .panel.panel-default - .panel-heading - SSH Key - %ul.well-list - %li - %span.light Title: - %strong= @key.title - %li - %span.light Created on: - %strong= @key.created_at.stamp("Aug 21, 2011") - - .col-md-8 - %p - %span.light Fingerprint: - %strong= @key.fingerprint - %pre.well-pre - = @key.key += render "key_details" .pull-right = link_to 'Remove', profile_key_path(@key), data: {confirm: 'Are you sure?'}, method: :delete, class: "btn btn-remove delete-key" -- cgit v1.2.1