11870: add infinite scrolling and "add new repository" button to repositories index...
[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
23     <% if !@my_repositories.any? %>
24       You do not seem to have access to any repositories. If you would like to request access, please contact your system admin.
25     <% else %>
26       <table class="table repositories-table">
27         <colgroup>
28           <col style="width: 5%" />
29           <col style="width: 30%" />
30           <col style="width: 60%" />
31           <col style="width: 5%" />
32         </colgroup>
33         <thead>
34           <tr>
35             <th></th>
36             <th> Name </th>
37             <th> URL </th>
38             <th></th>
39           </tr>
40         </thead>
41         <tbody>
42           <% @my_repositories.andand.each do |repo| %>
43             <tr>
44               <td>
45                 <%= render :partial => "show_object_button", :locals => {object: repo, size: 'xs' } %>
46               </td>
47               <td style="word-break:break-all;">
48                 <%= repo[:name] %>
49               </td>
50               <td style="word-break:break-all;">
51                 <code><%= repo.http_fetch_url %></code><br/>
52                 <code><%= @repo_writable[repo.uuid] ? repo.push_url : repo.fetch_url %></code>
53               </td>
54               <td>
55                 <% if repo.editable? %>
56                     <%= link_to(repository_path(id: repo.uuid), method: :delete, class: 'btn btn-sm', data: {confirm: "Really delete '#{repo.name || repo.uuid}'?"}) do %>
57                         <i class="fa fa-fw fa-trash-o"></i>
58                     <% end %>
59                 <% end %>
60               </td>
61             </tr>
62           <% end %>
63         </tbody>
64       </table>
65     <% end %>
66   </div>
67 </div>