3193: Show name column in the ssh key section.
[arvados.git] / apps / workbench / app / views / users / _manage_ssh_keys.html.erb
index 8e069dcd36254bb015b3f0f27d6e8355bb1990b4..8c436d65c3f7e6f5e1d5d9a2ef8c288e9c2388df 100644 (file)
@@ -9,26 +9,39 @@
      <p> When you have an SSH key you would like to use, add it using the <b>Add</b> button. </p>
   <% end %>
 
-  <table class="table virtual-machines-table">
-    <colgroup>
-      <col style="width: 95%" />
-      <col style="width: 5%" />
-    </colgroup>
-    <tbody>
-      <% @my_ssh_keys.andand.each do |key| %>
+  <% if @my_ssh_keys.andand.any? %>
+    <table class="table virtual-machines-table">
+      <colgroup>
+        <col style="width: 15%" />
+        <col style="width: 80%" />
+        <col style="width: 5%" />
+      </colgroup>
+      <thead>
         <tr>
-          <td style="word-break:break-all;">
-            <%= key[:public_key] %>
-          </td>
-          <td>
-            <%= link_to(authorized_key_path(id: key[:uuid]), method: 'delete', class: 'btn btn-sm', data: {confirm: "Really delete key"}) do %>
-                <i class="fa fa-fw fa-trash-o"></i>
-            <% end %>
-          </td>
+          <th> Name </th>
+          <th> Public Key </th>
+          <th> </th>
         </tr>
-      <% end %>
-    </tbody>
-  </table>
+      </thead>
+      <tbody>
+        <% @my_ssh_keys.andand.each do |key| %>
+          <tr>
+            <td style="word-break:break-all;">
+              <%= key[:name] %>
+            </td>
+            <td style="word-break:break-all;">
+              <%= key[:public_key] %>
+            </td>
+            <td>
+              <%= link_to(authorized_key_path(id: key[:uuid]), method: 'delete', class: 'btn btn-sm', data: {confirm: "Really delete key"}) do %>
+                  <i class="fa fa-fw fa-trash-o"></i>
+              <% end %>
+            </td>
+          </tr>
+        <% end %>
+      </tbody>
+    </table>
+  <% end %>
 </div>
 
 <hr>