11917: Do not clear rails cache at boot time.
[arvados.git] / apps / workbench / app / views / users / _repositories.html.erb
1 <%# Copyright (C) The Arvados Authors. All rights reserved.
2
3 SPDX-License-Identifier: AGPL-3.0 %>
4
5 <div class="panel panel-default">
6   <div class="panel-heading">
7     <div class="pull-right">
8       <%= link_to raw('<i class="fa fa-plus"></i> Add new repository'), "#",
9                    {class: 'btn btn-xs btn-primary', 'data-toggle' => "modal",
10                     'data-target' => '#add-repository-modal'}  %>
11     </div>
12     <h4 class="panel-title">
13       <%= link_to repositories_user_path(current_user) do%>
14         Repositories
15       <%end%>
16     </h4>
17   </div>
18
19   <div id="manage_repositories" class="panel-body">
20     <p>
21       When you are using an Arvados virtual machine, you should clone the https:// URLs. This will authenticate automatically using your API token.
22     </p>
23     <p>
24       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.
25     </p>
26
27     <% if !@my_repositories.any? %>
28       You do not seem to have access to any repositories. If you would like to request access, please contact your system admin.
29     <% else %>
30       <table class="table repositories-table">
31         <colgroup>
32           <col style="width: 5%" />
33           <col style="width: 30%" />
34           <col style="width: 60%" />
35           <col style="width: 5%" />
36         </colgroup>
37         <thead>
38           <tr>
39             <th></th>
40             <th> Name </th>
41             <th> URL </th>
42             <th></th>
43           </tr>
44         </thead>
45         <tbody>
46           <% @my_repositories.andand.each do |repo| %>
47             <tr>
48               <td>
49                 <%= render :partial => "show_object_button", :locals => {object: repo, size: 'xs' } %>
50               </td>
51               <td style="word-break:break-all;">
52                 <%= repo[:name] %>
53               </td>
54               <td style="word-break:break-all;">
55                 <code><%= repo.http_fetch_url %></code><br/>
56                 <code><%= @repo_writable[repo.uuid] ? repo.push_url : repo.fetch_url %></code>
57               </td>
58               <td>
59                 <% if repo.editable? %>
60                     <%= link_to(repository_path(id: repo.uuid), method: :delete, class: 'btn btn-sm', data: {confirm: "Really delete '#{repo.name || repo.uuid}'?"}) do %>
61                         <i class="fa fa-fw fa-trash-o"></i>
62                     <% end %>
63                 <% end %>
64               </td>
65             </tr>
66           <% end %>
67         </tbody>
68       </table>
69     <% end %>
70   </div>
71 </div>