1 <div class="modal-body">
3 <% uuid = @object.uuid %>
4 <% email = @object.email %>
6 <% disable_email = uuid != nil %>
7 <% identity_url_prefix = @current_selections[:identity_url_prefix] %>
8 <% disable_url_prefix = (identity_url_prefix != nil) %>
9 <% selected_repo = @current_selections[:repo_name] %>
10 <% selected_vm = @current_selections[:vm_uuid] %>
12 <%= form_tag setup_user_path, {id: 'setup_form', name: 'setup_form', method: 'get',
13 class: 'form-search', remote: true} do %>
14 <input id="user_uuid" maxlength="250" name="user_uuid" type="hidden" value="<%=uuid%>">
18 <% if disable_email %>
20 <td> <input id="email" maxlength="250" name="email" type="text" value="<%=email%>"
24 <td> <input id="email" maxlength="250" name="email" type="text" > </td>
28 <% if disable_url_prefix %>
29 <td> Identity URL Prefix   </td>
30 <td> <input id="openid_prefix" maxlength="250" name="openid_prefix" type="text"
31 value="<%=identity_url_prefix%>" disabled=true > </td>
33 <td> Openid Prefix </td>
34 <td> <input id="openid_prefix" maxlength="250" name="openid_prefix" type="text"
35 value="<%= Rails.configuration.default_openid_prefix %>"> </td>
39 <td> Repository Name </td>
40 <td> <input id="repo_name" maxlength="250" name="repo_name" type="text" value="<%=selected_repo%>">
43 <td> Virtual Machine </td>
45 <select name="vm_uuid">
47 <option value=""> Choose One: </option>
49 <option value="" selected> Choose One: </option>
51 <% @vms.each do |vm| %>
52 <% if selected_vm == vm.uuid %>
53 <option value=<%=vm.uuid%> selected> <%=vm.hostname%> </option>
55 <option value=<%=vm.uuid%> > <%=vm.hostname%> </option>
65 <button type="submit" id="register" class="btn btn-primary" autofocus>Submit</button>
66 <button class="btn btn-primary" data-dismiss="modal" aria-hidden="true">Cancel</button>
72 var $input = $('input:text'),
73 $register = $('#register');
75 var email_value = document.forms["setup_form"]["email"].value;
76 var prefix_value = document.forms["setup_form"]["openid_prefix"].value;
77 if (email_value == null || email_value == "" || prefix_value == null || prefix_value == "") {
78 $register.attr('disabled', true);
81 $input.keyup(function() {
84 var email_value = document.forms["setup_form"]["email"].value;
85 var prefix_value = document.forms["setup_form"]["openid_prefix"].value;
86 if (email_value == null || email_value == "" || prefix_value == null || prefix_value == "") {
90 trigger ? $register.attr('disabled', true) : $register.removeAttr('disabled');