11060: show all repositories that are accessible to the user in <user_uuid>/repositor...
[arvados.git] / apps / workbench / app / views / users / _repositories.html.erb
1 <div class="panel panel-default">
2   <div class="panel-heading">
3     <div class="pull-right">
4       <%= link_to raw('<i class="fa fa-plus"></i> Add new repository'), "#",
5                    {class: 'btn btn-xs btn-primary', 'data-toggle' => "modal",
6                     'data-target' => '#add-repository-modal'}  %>
7     </div>
8     <h4 class="panel-title">
9       <%= link_to repositories_user_path(current_user) do%>
10         Repositories
11       <%end%>
12     </h4>
13   </div>
14
15   <div id="manage_repositories" class="panel-body">
16     <p>
17       When you are using an Arvados virtual machine, you should clone the https:// URLs. This will authenticate automatically using your API token.
18     </p>
19     <p>
20       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.
21     </p>
22     <p>
23       For more information see <%= link_to raw('Writing a pipeline'),
24       "#{Rails.configuration.arvados_docsite}/user/tutorials/tutorial-firstscript.html", target: "_blank"%>.
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 repositories?"}) 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>