11917: Do not clear rails cache at boot time.
[arvados.git] / apps / workbench / app / views / users / _repositories.html.erb
index d409b8c44b3a1af64591c764e50407bbf4e3c211..057b6a2138eda7ba0cb02c3e648dcedd6099efe5 100644 (file)
@@ -1,3 +1,7 @@
+<%# Copyright (C) The Arvados Authors. All rights reserved.
+
+SPDX-License-Identifier: AGPL-3.0 %>
+
 <div class="panel panel-default">
   <div class="panel-heading">
     <div class="pull-right">
     </h4>
   </div>
 
-<div id="manage_repositories" class="panel-body">
-  <p>
-    For more information see <%= link_to raw('Writing a pipeline'),
-    "#{Rails.configuration.arvados_docsite}/user/tutorials/tutorial-firstscript.html", target: "_blank"%>.
-  </p>
+  <div id="manage_repositories" class="panel-body">
+    <p>
+      When you are using an Arvados virtual machine, you should clone the https:// URLs. This will authenticate automatically using your API token.
+    </p>
+    <p>
+      In order to clone git repositories using SSH, <%= link_to ssh_keys_user_path(current_user) do%> add an SSH key to your account<%end%> and clone the git@ URLs.
+    </p>
 
-  <% if !@my_repositories.any? %>
-    You do not seem to have access to any repositories. If you would like to request access, please contact your system admin.
-  <% else %>
-    <table class="table repositories-table">
-      <colgroup>
-        <col style="width: 30%" />
-        <col style="width: 10%" />
-        <col style="width: 60%" />
-      </colgroup>
-      <thead>
-        <tr>
-          <th> Name </th>
-          <th> Read/Write </th>
-          <th> URL </th>
-          <th> </th>
-        </tr>
-      </thead>
-      <tbody>
-        <% @my_repositories.andand.each do |repo| %>
-          <% writable = @repo_writable[repo.uuid] %>
+    <% if !@my_repositories.any? %>
+      You do not seem to have access to any repositories. If you would like to request access, please contact your system admin.
+    <% else %>
+      <table class="table repositories-table">
+        <colgroup>
+          <col style="width: 5%" />
+          <col style="width: 30%" />
+          <col style="width: 60%" />
+          <col style="width: 5%" />
+        </colgroup>
+        <thead>
           <tr>
-            <td style="word-break:break-all;">
-              <%= repo[:name] %>
-            </td>
-            <td>
-              <%= writable ? 'writable' : 'read-only' %>
-            </td>
-            <td style="word-break:break-all;">
-              <code><%= repo.http_fetch_url %></code><br/>
-              <code><%= writable ? repo.push_url : repo.fetch_url %></code>
-            </td>
-            <td>
-              <% if writable == 'can_manage' %>
-                <%= link_to "Share", "/repositories/#{repo[:uuid]}#Sharing" %>
-              <% end %>
-            </td>
+            <th></th>
+            <th> Name </th>
+            <th> URL </th>
+            <th></th>
           </tr>
-        <% end %>
-      </tbody>
-    </table>
-  <% end %>
-</div>
+        </thead>
+        <tbody>
+          <% @my_repositories.andand.each do |repo| %>
+            <tr>
+              <td>
+                <%= render :partial => "show_object_button", :locals => {object: repo, size: 'xs' } %>
+              </td>
+              <td style="word-break:break-all;">
+                <%= repo[:name] %>
+              </td>
+              <td style="word-break:break-all;">
+                <code><%= repo.http_fetch_url %></code><br/>
+                <code><%= @repo_writable[repo.uuid] ? repo.push_url : repo.fetch_url %></code>
+              </td>
+              <td>
+                <% if repo.editable? %>
+                    <%= link_to(repository_path(id: repo.uuid), method: :delete, class: 'btn btn-sm', data: {confirm: "Really delete '#{repo.name || repo.uuid}'?"}) do %>
+                        <i class="fa fa-fw fa-trash-o"></i>
+                    <% end %>
+                <% end %>
+              </td>
+            </tr>
+          <% end %>
+        </tbody>
+      </table>
+    <% end %>
+  </div>
 </div>
-  <p>When you are using an Arvados virtual machine, you should clone the https:// URLs. This will authenticate automatically using your API token.</p>
-  <p>In order to clone git repositories using SSH, <%= link_to ssh_keys_user_path(current_user) do%> add an SSH key to your account<%end%> and clone the git@ URLs.</p>