Merge branch 'master' into 3036-collection-uuids
[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-folder-open-o"></i>
21                   <%= projectnode[:object] %>
22                 </div>
23               <% else
24                  row_selectable = !params[:editable] || projectnode[:object].editable?
25                  folder_class = "fa-folder-o"
26                  if projectnode[:object].uuid == current_user.uuid
27                    row_name = "My Projects"
28                    row_selectable &&= params[:my_root_selectable]
29                    folder_class = "fa-folder-open-o" if not row_selectable
30                  else
31                    row_name = projectnode[:object].friendly_link_name || 'New project'
32                  end %>
33                 <div class="<%= 'selectable project' if row_selectable %> row"
34                      style="padding-left: <%= 1 + projectnode[:depth] %>em; margin-right: 0px" data-object-uuid="<%= projectnode[:object].uuid %>">
35                   <i class="fa fa-fw <%= folder_class %>"></i> <%= row_name %>
36                 </div>
37               <% end %>
38             <% end %>
39           <% end %>
40         </div>
41       </div>
42
43       <div class="modal-footer">
44         <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Cancel</button>
45         <button class="btn btn-primary" aria-hidden="true" data-enable-if-selection disabled><%= params[:action_name] || 'Select' %></button>
46         <div class="modal-error hide" style="text-align: left; margin-top: 1em;">
47         </div>
48       </div>
49     </div>
50   </div>
51 </div>