From 930f4366ba3030d54f994a6e454470adca74f888 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Mon, 6 May 2013 20:41:08 +0300 Subject: [PATCH] Usability improvements to deploy leys --- app/controllers/deploy_keys_controller.rb | 2 +- app/views/deploy_keys/index.html.haml | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/controllers/deploy_keys_controller.rb b/app/controllers/deploy_keys_controller.rb index ca5c605..c413c2f 100644 --- a/app/controllers/deploy_keys_controller.rb +++ b/app/controllers/deploy_keys_controller.rb @@ -54,6 +54,6 @@ class DeployKeysController < ProjectResourceController protected def available_keys - @available_keys ||= DeployKey.in_projects(current_user.owned_projects) + @available_keys ||= DeployKey.in_projects(current_user.owned_projects).uniq end end diff --git a/app/views/deploy_keys/index.html.haml b/app/views/deploy_keys/index.html.haml index 3e8a873..9e136a6 100644 --- a/app/views/deploy_keys/index.html.haml +++ b/app/views/deploy_keys/index.html.haml @@ -18,9 +18,15 @@ %small for this project %ul.bordered-list = render @enabled_keys + - if @enabled_keys.blank? + .light-well + %p.nothing_here_message Create #{link_to 'new deploy key', new_project_deploy_key_path(@project)} or add existing one .span6.available-keys %h5 Available deploy keys %small from projects you are able to manage %ul.bordered-list = render @available_keys + - if @available_keys.blank? + .light-well + %p.nothing_here_message All deploy keys from projects you can manage will be displayed here -- libgit2 0.21.2