- <div class="modal-body">
- <% uuid = @object.uuid %>
- <% disable_email = @object.uuid? %>
- <% identity_url_prefix = @current_selections[:identity_url_prefix] %>
- <% disable_url_prefix = (identity_url_prefix != nil) %>
- <% selected_repo = @current_selections[:repo_name] %>
- <% selected_vm = @current_selections[:vm_uuid] %>
-
- <%= form_tag setup_user_url(id: uuid), {id: 'setup_form', name: 'setup_form', method: 'get', class: 'form-search', remote: true, onSubmit: "validate(); return false;"} do %>
- <div>
- <table><tbody>
- <tr>
- <% if disable_email %>
- <td> Email </td>
- <td> <input id="email" maxlength="250" name="email" type="text" value="<%=@object.email%>" disabled=true > </td>
- <% else %>
- <td> Email </td>
- <td> <input id="email" maxlength="250" name="email" type="text" > </td>
- <% end %>
- </tr>
- <tr>
- <% if disable_url_prefix %>
- <td> Identity URL Prefix   </td>
- <td> <input id="openid_prefix" maxlength="250" name="openid_prefix" type="text" value="<%=identity_url_prefix%>" disabled=true > </td>
- <% else %>
- <td> Openid Prefix </td>
- <td> <input id="openid_prefix" maxlength="250" name="openid_prefix" type="text" value="https://www.google.com/accounts/o8/id"> </td>
- <% end %>
- </tr>
- <tr>
- <td> Repository Name </td>
- <td> <input id="repo_name" maxlength="250" name="repo_name" type="text" value="<%=selected_repo%>">
- </tr>
- <tr>
- <td> Virtual Machine </td>
- <td>
- <select name="vm_uuid">
- <% if selected_vm %>
- <option value=""> Choose One: </option>
- <% else %>
- <option value="" selected> Choose One: </option>
- <% end %>
- <% @vms.each do |vm| %>
- <% if selected_vm == vm.uuid %>
- <option value=<%=vm.uuid%> selected> <%=vm.hostname%> </option>
- <% else %>
- <option value=<%=vm.uuid%> > <%=vm.hostname%> </option>
- <% end %>
- <% end %>
- </select>
- </td>
- </tr>
- </tbody></table>
+<div class="modal-dialog">
+ <div class="modal-content">
+
+ <%= form_tag setup_user_path, {id: 'setup_form', name: 'setup_form', method: 'get',
+ class: 'form-search', remote: true} do %>
+
+ <div class="modal-header">
+ <button type="button" class="close" onClick="reset_form()" data-dismiss="modal" aria-hidden="true">×</button>
+ <h4 class="modal-title">Setup User</h4>
+ </div>
+
+ <div class="modal-body">
+ <% if @object%>
+ <% uuid = @object.uuid %>
+ <% email = @object.email %>
+ <% end %>
+ <% disable_email = uuid != nil %>
+ <% identity_url_prefix = @current_selections[:identity_url_prefix] %>
+ <% disable_url_prefix = identity_url_prefix != nil %>
+ <% selected_repo = @current_selections[:repo_name] %>
+ <% selected_vm = @current_selections[:vm_uuid] %>
+
+ <input id="user_uuid" maxlength="250" name="user_uuid" type="hidden" value="<%=uuid%>">
+ <div class="form-group">
+ <label for="email">Email</label>
+ <% if disable_email %>
+ <input class="form-control" id="email" maxlength="250" name="email" type="text" value="<%=email%>" disabled>
+ <% else %>
+ <input class="form-control" id="email" maxlength="250" name="email" type="text">
+ <% end %>