Merge branch 'master' into 3106-modal-loading-indicator
[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       <h4 class="modal-title">Setup User</h4>
10     </div>
11
12     <div class="modal-body">
13       <div class="spinner spinner-32px spinner-h-center spinner-v-center" hidden="true"></div>
14       <% if @object%>
15         <% uuid = @object.uuid %>
16         <% email = @object.email %>
17       <% end %>
18       <% disable_email = uuid != nil %>
19       <% identity_url_prefix = @current_selections[:identity_url_prefix] %>
20       <% disable_url_prefix = identity_url_prefix != nil %>
21       <% selected_repo = @current_selections[:repo_name] %>
22       <% selected_vm = @current_selections[:vm_uuid] %>
23
24       <input id="user_uuid" maxlength="250" name="user_uuid" type="hidden" value="<%=uuid%>">
25       <div class="form-group">
26         <label for="email">Email</label>
27         <% if disable_email %>
28         <input class="form-control" id="email" maxlength="250" name="email" type="text" value="<%=email%>" disabled>
29         <% else %>
30         <input class="form-control" id="email" maxlength="250" name="email" type="text">
31         <% end %>
32       </div>
33       <div class="form-group">
34         <label for="openid_prefix">Identity URL Prefix</label>
35         <% if disable_url_prefix %>
36         <input class="form-control" id="openid_prefix" maxlength="250" name="openid_prefix" type="text"
37                value="<%=identity_url_prefix%>" disabled=true>
38         <% else %>
39         <input class="form-control" id="openid_prefix" maxlength="250" name="openid_prefix" type="text"
40                value="<%= Rails.configuration.default_openid_prefix %>">
41         <% end %>
42       </div>
43       <div class="form-group">
44         <label for="repo_name">Repository Name</label>
45         <input class="form-control" id="repo_name" maxlength="250" name="repo_name" type="text" value="<%=selected_repo%>">
46       </div>
47       <div class="form-group">
48         <label for="vm_uuid">Virtual Machine</label>
49         <select class="form-control" name="vm_uuid">
50           <option value="" <%= 'selected' unless selected_vm %>>
51             Choose One:
52           </option>
53           <% @vms.each do |vm| %>
54             <option value="<%=vm.uuid%>"
55                     <%= 'selected' if selected_vm == vm.uuid %>>
56               <%= vm.hostname %>
57             </option>
58           <% end %>
59         </select>
60       </div>
61     </div>
62
63     <div class="modal-footer">
64       <button type="submit" id="register" class="btn btn-primary" autofocus>Submit</button>
65       <button class="btn btn-default" onClick="reset_form()" data-dismiss="modal" aria-hidden="true">Cancel</button>
66     </div>
67
68     <% end #form %>
69   </div>
70 </div>