Commit 930f4366ba3030d54f994a6e454470adca74f888

Authored by Dmitriy Zaporozhets
1 parent 3022b9fd

Usability improvements to deploy leys

app/controllers/deploy_keys_controller.rb
... ... @@ -54,6 +54,6 @@ class DeployKeysController < ProjectResourceController
54 54 protected
55 55  
56 56 def available_keys
57   - @available_keys ||= DeployKey.in_projects(current_user.owned_projects)
  57 + @available_keys ||= DeployKey.in_projects(current_user.owned_projects).uniq
58 58 end
59 59 end
... ...
app/views/deploy_keys/index.html.haml
... ... @@ -18,9 +18,15 @@
18 18 %small for this project
19 19 %ul.bordered-list
20 20 = render @enabled_keys
  21 + - if @enabled_keys.blank?
  22 + .light-well
  23 + %p.nothing_here_message Create #{link_to 'new deploy key', new_project_deploy_key_path(@project)} or add existing one
21 24 .span6.available-keys
22 25 %h5
23 26 Available deploy keys
24 27 %small from projects you are able to manage
25 28 %ul.bordered-list
26 29 = render @available_keys
  30 + - if @available_keys.blank?
  31 + .light-well
  32 + %p.nothing_here_message All deploy keys from projects you can manage will be displayed here
... ...