6254: slight performance improvement where the can_login link is not retrieved and...
[arvados.git] / apps / workbench / app / views / users / _setup_popup.html.erb
1 <div class="modal-dialog modal-with-loading-spinner">
2   <div class="modal-content">
3
4     <%= form_tag setup_user_path, {id: 'setup_form', name: 'setup_form', method: 'get',
5         class: 'form-search', remote: true} do %>
6
7     <div class="modal-header">
8       <button type="button" class="close" onClick="reset_form()" data-dismiss="modal" aria-hidden="true">&times;</button>
9       <div>
10         <div class="col-sm-6"> <h4 class="modal-title">Setup User</h4> </div>
11         <div class="spinner spinner-32px spinner-h-center col-sm-1" hidden="true"></div>
12       </div>
13       <br/>
14     </div>
15
16     <div class="modal-body">
17       <% if @object%>
18         <% uuid = @object.uuid %>
19         <% email = @object.email %>
20       <% end %>
21       <% disable_email = uuid != nil %>
22       <% identity_url_prefix = @current_selections[:identity_url_prefix] %>
23       <% disable_url_prefix = identity_url_prefix != nil %>
24       <% selected_repo = @current_selections[:repo_name] %>
25       <% selected_vm = @current_selections[:vm_uuid] %>
26       <% groups = @current_selections[:groups] %>
27
28       <input id="user_uuid" maxlength="250" name="user_uuid" type="hidden" value="<%=uuid%>">
29       <div class="form-group">
30         <label for="email">Email</label>
31         <% if disable_email %>
32         <input class="form-control" id="email" maxlength="250" name="email" type="text" value="<%=email%>" disabled>
33         <% else %>
34         <input class="form-control" id="email" maxlength="250" name="email" type="text">
35         <% end %>
36       </div>
37       <div class="form-group">
38         <label for="openid_prefix">Identity URL Prefix</label>
39         <% if disable_url_prefix %>
40         <input class="form-control" id="openid_prefix" maxlength="250" name="openid_prefix" type="text"
41                value="<%=identity_url_prefix%>" disabled=true>
42         <% else %>
43         <input class="form-control" id="openid_prefix" maxlength="250" name="openid_prefix" type="text"
44                value="<%= Rails.configuration.default_openid_prefix %>">
45         <% end %>
46       </div>
47       <div class="form-group">
48         <label for="repo_name">Repository Name and Shell Login</label>
49         <input class="form-control" id="repo_name" maxlength="250" name="repo_name" type="text" value="<%=selected_repo%>">
50       </div>
51       <div class="form-group">
52         <label for="vm_uuid">Virtual Machine</label>
53         <select class="form-control" name="vm_uuid">
54           <option value="" <%= 'selected' unless selected_vm %>>
55             Choose One:
56           </option>
57           <% @vms.each do |vm| %>
58             <option value="<%=vm.uuid%>"
59               <%= 'selected' if selected_vm == vm.uuid %>>
60               <%= vm.hostname %>
61             </option>
62           <% end %>
63         </select>
64       </div>
65       <div class="groups-group">
66         <label for="groups">Groups</label>
67         <input user_email="user_email" maxlength="250" name="user_email" type="hidden" value="<%=email%>">
68         <input prev_groups="prev_groups" maxlength="250" name="prev_groups" type="hidden" value="<%=groups%>">
69         <input class="form-control" id="groups" maxlength="250" name="groups" type="text" value="<%=groups%>"
70           title="Comma separated list of groups to which this user belongs">
71       </div>
72     </div>
73
74     <div class="modal-footer">
75       <button class="btn btn-default" onClick="reset_form()" data-dismiss="modal" aria-hidden="true">Cancel</button>
76       <button type="submit" id="register" class="btn btn-primary" autofocus>Submit</button>
77     </div>
78
79     <% end #form %>
80   </div>
81 </div>