Merge branch '20300-rails7'
[arvados.git] / apps / workbench / app / views / projects / _choose.html.erb
1 <%# Copyright (C) The Arvados Authors. All rights reserved.
2
3 SPDX-License-Identifier: AGPL-3.0 %>
4
5 <div class="modal modal-with-loading-spinner">
6   <div class="modal-dialog">
7     <div class="modal-content">
8
9       <div class="modal-header">
10         <button type="button" class="close" onClick="reset_form()" data-dismiss="modal" aria-hidden="true">&times;</button>
11         <div>
12           <div class="col-sm-6"> <h4 class="modal-title"><%= params[:title] || 'Choose project' %></h4> </div>
13           <div class="spinner spinner-32px spinner-h-center col-sm-1" hidden="true"></div>
14         </div>
15         <br/>
16       </div>
17
18       <div class="modal-body">
19         <div class="selectable-container" style="height: 15em; overflow-y: scroll">
20           <% starred_projects = my_starred_projects current_user, 'project' %>
21           <% if starred_projects.andand.any? %>
22             <% writable_projects = starred_projects.select(&:editable?) %>
23             <% writable_projects.each do |projectnode| %>
24               <% row_name = projectnode.friendly_link_name || 'New project' %>
25               <div class="selectable project row"
26                    style="padding-left: 1em; margin-right: 0px"
27                    data-object-uuid="<%= projectnode.uuid %>">
28                 <i class="fa fa-fw fa-folder-o"></i> <%= row_name %> <i class="fa fa-fw fa-star"></i>
29               </div>
30             <% end %>
31           <% end %>
32
33           <% my_projects = my_wanted_projects_tree(current_user) %>
34           <% my_projects[0].each do |projectnode| %>
35             <% if projectnode[:object].uuid == current_user.uuid
36                  row_name = "Home"
37                else
38                  row_name = projectnode[:object].friendly_link_name || 'New project'
39                end %>
40             <div class="selectable project row"
41                  style="padding-left: <%= 1 + projectnode[:depth] %>em; margin-right: 0px"
42                  data-object-uuid="<%= projectnode[:object].uuid %>">
43               <i class="fa fa-fw fa-folder-o"></i> <%= row_name %>
44             </div>
45           <% end %>
46         </div>
47
48         <% if my_projects[1] or my_projects[2] or my_projects[0].size > 200 %>
49           <div>Some of your projects are omitted. Add projects of interest to favorites.</div>
50         <% end %>
51       </div>
52
53       <div class="modal-footer">
54         <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Cancel</button>
55         <button class="btn btn-primary" aria-hidden="true" data-enable-if-selection disabled><%= params[:action_name] || 'Select' %></button>
56         <div class="modal-error hide" style="text-align: left; margin-top: 1em;">
57         </div>
58       </div>
59     </div>
60   </div>
61 </div>