Arvados-DCO-1.1-Signed-off-by: Radhika Chippada <radhika@curoverse.com>
[arvados.git] / apps / workbench / app / views / users / _setup_popup.html.erb
1 <%# Copyright (C) The Arvados Authors. All rights reserved.
2
3 SPDX-License-Identifier: AGPL-3.0 %>
4
5 <div class="modal-dialog modal-with-loading-spinner">
6   <div class="modal-content">
7
8     <%= form_tag setup_user_path, {id: 'setup_form', name: 'setup_form', method: 'get',
9         class: 'form-search', remote: true} do %>
10
11     <div class="modal-header">
12       <button type="button" class="close" onClick="reset_form()" data-dismiss="modal" aria-hidden="true">&times;</button>
13       <div>
14         <div class="col-sm-6"> <h4 class="modal-title">Setup Shell Account</h4> </div>
15         <div class="spinner spinner-32px spinner-h-center col-sm-1" hidden="true"></div>
16       </div>
17       <br/>
18     </div>
19
20     <div class="modal-body">
21       <% if @object%>
22         <% uuid = @object.uuid %>
23         <% email = @object.email %>
24       <% end %>
25       <% disable_email = uuid != nil %>
26       <% identity_url_prefix = @current_selections[:identity_url_prefix] %>
27       <% disable_url_prefix = identity_url_prefix != nil %>
28       <% selected_vm = @current_selections[:vm_uuid] %>
29       <% groups = @current_selections[:groups] %>
30
31       <input id="user_uuid" maxlength="250" name="user_uuid" type="hidden" value="<%=uuid%>">
32       <div class="form-group">
33         <label for="email">Email</label>
34         <% if disable_email %>
35         <input class="form-control" id="email" maxlength="250" name="email" type="text" value="<%=email%>" disabled>
36         <% else %>
37         <input class="form-control" id="email" maxlength="250" name="email" type="text">
38         <% end %>
39       </div>
40       <div class="form-group">
41         <label for="openid_prefix">Identity URL Prefix</label>
42         <% if disable_url_prefix %>
43         <input class="form-control" id="openid_prefix" maxlength="250" name="openid_prefix" type="text"
44                value="<%=identity_url_prefix%>" disabled=true>
45         <% else %>
46         <input class="form-control" id="openid_prefix" maxlength="250" name="openid_prefix" type="text"
47                value="<%= Rails.configuration.default_openid_prefix %>">
48         <% end %>
49       </div>
50       <div class="form-group">
51         <label for="vm_uuid">Virtual Machine</label>
52         <select class="form-control" name="vm_uuid">
53           <option value="" <%= 'selected' unless selected_vm %>>
54             Choose One:
55           </option>
56           <% @vms.each do |vm| %>
57             <option value="<%=vm.uuid%>"
58               <%= 'selected' if selected_vm == vm.uuid %>>
59               <%= vm.hostname %>
60             </option>
61           <% end %>
62         </select>
63       </div>
64       <div class="groups-group">
65         <label for="groups">Groups for virtual machine (comma separated list)</label>
66         <input class="form-control" id="groups" maxlength="250" name="groups" type="text" value="<%=groups%>">
67       </div>
68     </div>
69
70     <div class="modal-footer">
71       <button class="btn btn-default" onClick="reset_form()" data-dismiss="modal" aria-hidden="true">Cancel</button>
72       <button type="submit" id="register" class="btn btn-primary" autofocus>Submit</button>
73     </div>
74
75     <% end #form %>
76   </div>
77 </div>