<%# Copyright (C) The Arvados Authors. All rights reserved. SPDX-License-Identifier: AGPL-3.0 %>
<%= link_to raw('' " Add new SSH key"), add_ssh_key_popup_url, {class: 'btn btn-xs btn-primary', :remote => true, 'data-toggle' => "modal", 'data-target' => '#add-ssh-key-modal-window'} %>

<%= link_to ssh_keys_user_path(current_user) do %> SSH Keys <%end%>

<% if !@my_ssh_keys.any? %>

You have not yet set up an SSH public key for use with Arvados. <%= link_to "Learn more.", "#{Rails.configuration.arvados_docsite}/user/getting_started/ssh-access-unix.html", style: "font-weight: bold", target: "_blank" %>

When you have an SSH key you would like to use, add it using the Add button.

<% else %> <% @my_ssh_keys.andand.each do |key| %> <% end %>
Name Key Fingerprint
<%= key[:name] %> <% if key[:public_key] && key[:public_key].size > 0 %>
<%= begin SSHKey.fingerprint key[:public_key] rescue "INVALID KEY: " + key[:public_key] end %>
<% else %> <%= key[:public_key] %> <% end %>
<%= link_to(authorized_key_path(id: key[:uuid]), method: :delete, class: 'btn btn-sm', data: {confirm: "Really delete key?"}) do %> <% end %>
<% end %>