fix up editable stuff
[arvados.git] / apps / workbench / app / views / authorized_keys / index.html.erb
index 4658af851ee989fb3e7bbbd204a0ddb4b2c13a94..823a17eb96cb129697c9dd3cbe8a2ce18b99cd2d 100644 (file)
@@ -1,4 +1,4 @@
-<table class="table table-hover">
+<table class="table">
   <thead>
     <tr class="contain-align-left">
       <th>
@@ -8,38 +8,40 @@
       </th><th>
        name
       </th><th>
-       key_type
+       key&nbsp;type
       </th><th>
-       public_key
+       public&nbsp;key
       </th><th>
-       expires_at
+       expires
       </th>
     </tr>
   </thead>
   <tbody>
 
-    <% @objects.sort_by { |ak| ak[:created_at] }.reverse.each do |ak| %>
+    <% @objects.sort_by { |ak| ak[:created_at] }.each do |ak| %>
 
     <tr>
       <td>
         <%= link_to_if_arvados_object ak %>
       </td><td>
-        <%= ak.owner %>
+        <%= render_editable_attribute ak, 'owner' %>
       </td><td>
-        <%= ak.name %>
+        <%= render_editable_attribute ak, 'name' %>
       </td><td>
-        <%= ak.key_type %>
+        <%= render_editable_attribute ak, 'key_type', ak.key_type, "data-type" => "select", "data-source" => '[{value:"SSH",text:"SSH"}]' %>
       </td><td>
-        <%= ak.public_key %>
+        <%= render_editable_attribute ak, 'public_key', ak.public_key.andand.sub(/^(.{12}).{16,}(.{16,})$/, '\1...\2') %>
       </td><td>
-        <%= ak.expires_at %>
+        <%= render_editable_attribute ak, 'expires_at' %>
+      </td><td>
+        <%= link_to raw('<i class="icon-trash"></i>'), { action: 'destroy', id: ak.uuid }, { confirm: 'Delete this key?', method: 'delete' } %>
       </td>
     </tr>
 
     <% end %>
     <% if @objects.count == 0 %>
     <tr>
-      <td colspan="6">
+      <td colspan="7">
         (no authorized keys)
       </td>
     </tr>
@@ -47,3 +49,5 @@
 
   </tbody>
 </table>
+
+<%= button_to "Add a new key", { action: 'create', return_to: './' }, { class: 'btn btn-primary' } %>