Merge branch 'master' into 4570-multi-auth-method
[arvados.git] / apps / workbench / app / views / projects / _choose.html.erb
1 <div class="modal modal-with-loading-spinner">
2   <div class="modal-dialog">
3     <div class="modal-content">
4
5       <div class="modal-header">
6         <button type="button" class="close" onClick="reset_form()" data-dismiss="modal" aria-hidden="true">&times;</button>
7         <div>
8           <div class="col-sm-6"> <h4 class="modal-title"><%= params[:title] || 'Choose project' %></h4> </div>
9           <div class="spinner spinner-32px spinner-h-center col-sm-1" hidden="true"></div>
10         </div>
11         <br/>
12       </div>
13
14       <div class="modal-body">
15         <div class="selectable-container" style="height: 15em; overflow-y: scroll">
16           <% [my_project_tree, shared_project_tree].each do |tree| %>
17             <% tree.each do |projectnode| %>
18               <% if projectnode[:object].is_a? String %>
19                 <div class="row" style="padding-left: <%= 1 + projectnode[:depth] %>em; margin-right: 0px">
20                   <i class="fa fa-fw fa-share-alt"></i>
21                   <%= projectnode[:object] %>
22                 </div>
23               <% else
24                  row_selectable = !params[:editable] || projectnode[:object].editable?
25                  if projectnode[:object].uuid == current_user.uuid
26                    row_name = "Home"
27                    row_selectable = true
28                  else
29                    row_name = projectnode[:object].friendly_link_name || 'New project'
30                  end %>
31                 <div class="<%= 'selectable project' if row_selectable %> row"
32                      style="padding-left: <%= 1 + projectnode[:depth] %>em; margin-right: 0px" data-object-uuid="<%= projectnode[:object].uuid %>">
33                   <i class="fa fa-fw fa-folder-o"></i> <%= row_name %>
34                 </div>
35               <% end %>
36             <% end %>
37           <% end %>
38         </div>
39       </div>
40
41       <div class="modal-footer">
42         <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Cancel</button>
43         <button class="btn btn-primary" aria-hidden="true" data-enable-if-selection disabled><%= params[:action_name] || 'Select' %></button>
44         <div class="modal-error hide" style="text-align: left; margin-top: 1em;">
45         </div>
46       </div>
47     </div>
48   </div>
49 </div>