Use bootstrap/theme style defaults for user setup modal and form.
authorTom Clegg <tom@curoverse.com>
Tue, 8 Apr 2014 05:55:17 +0000 (01:55 -0400)
committerTom Clegg <tom@curoverse.com>
Tue, 8 Apr 2014 17:47:02 +0000 (13:47 -0400)
apps/workbench/app/assets/stylesheets/bootstrap-modal.css.scss [deleted file]
apps/workbench/app/views/layouts/application.html.erb
apps/workbench/app/views/users/_setup_popup.html.erb
apps/workbench/app/views/users/_show_admin.html.erb

diff --git a/apps/workbench/app/assets/stylesheets/bootstrap-modal.css.scss b/apps/workbench/app/assets/stylesheets/bootstrap-modal.css.scss
deleted file mode 100644 (file)
index a16eb32..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-// Place all the styles related to the bootstrap modal here.
-
-.modal {
-  left: 50%;
-  bottom: auto;
-  right: auto;
-  padding: 0;
-  width: 400px;
-  margin-left: -250px;
-  background-color: #ffffff;
-  border: 2px solid #999999;
-  border-radius: 6px;
-  box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);
-  background-clip: padding-box;
-}
-
-.modal.fade.in {
-  top: 10%;
-}
-
-.modal-backdrop,
-.modal-backdrop.fade.in{
-  opacity: 0.7;
-  background: #fff;
-}
-
-/* Modal Overflow */
-
-.modal-overflow.modal {
-top: 1%;
-}
-
-.modal-overflow.modal.fade {
-top: -100%;
-}
-
-.modal-overflow.modal.fade.in {
-top: 1%;
-}
-
-.modal-overflow .modal-body {
-overflow: auto;
--webkit-overflow-scrolling: touch;
-}
-
-/* Responsive */
-
-@media (min-width: 1200px) {
-.modal.container {
-width: 1170px;
-margin-left: -585px;
-}
-}
-
-@media (max-width: 979px) {
-.modal,
-.modal.container,
-.modal.modal-overflow {
-top: 1%;
-right: 1%;
-left: 1%;
-bottom: auto;
-width: auto !important;
-height: auto !important;
-margin: 0 !important;
-padding: 0 !important;
-}
-
-.modal.fade.in,
-.modal.container.fade.in,
-.modal.modal-overflow.fade.in {
-top: 1%;
-bottom: auto;
-}
-
-.modal-body,
-.modal-overflow .modal-body {
-position: static;
-margin: 0;
-height: auto !important;
-max-height: none !important;
-overflow: visible !important;
-}
-
-.modal-footer,
-.modal-overflow .modal-footer {
-position: static;
-}
-}
-
-.loading-spinner {
-position: absolute;
-top: 50%;
-left: 50%;
-margin: -12px 0 0 -12px;
-}
-
-#user-setup-modal-window{
-  overflow: hidden;
-}
index 63cf67c263f8b0f5eeb20be7c5add52e3acf0a31..724fa9bd9ffb52a0d71a961041fdf1181eaea353 100644 (file)
         </div>
   </div>
 
+  <%= yield :footer_html %>
   <%= piwik_tracking_tag %>
   <%= javascript_tag do %>
   <%= yield :footer_js %>
index 784ab6e3c89ba4d4eaefb19da1cb1e6aefa43a3a..c075ab5eb4f87f7e8184ad74637ae769a3b2d09b 100644 (file)
@@ -1,79 +1,72 @@
-<%= form_tag setup_user_path, {id: 'setup_form', name: 'setup_form', method: 'get', 
-                    class: 'form-search', remote: true} do %>
+<div class="modal-dialog">
+  <div class="modal-content">
 
-  <div class="modal-header">
-    <button type="button" class="close" onClick="reset_form()" data-dismiss="modal" aria-hidden="true">&times;</button>
-    <h3 class="modal-title">Setup User</h4>
-  </div
+    <%= form_tag setup_user_path, {id: 'setup_form', name: 'setup_form', method: 'get',
+        class: 'form-search', remote: true} do %>
 
-  <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] %>
+    <div class="modal-header">
+      <button type="button" class="close" onClick="reset_form()" data-dismiss="modal" aria-hidden="true">&times;</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>
-        <table><tbody><div class="form-group">
-          <tr>
-            <% if disable_email %>
-              <td> Email </td>
-              <td> <input id="email" maxlength="250" name="email" type="text" value="<%=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 &nbsp </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="<%= Rails.configuration.default_openid_prefix %>"> </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>
-        </div></tbody></table>
+      <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 %>
       </div>
-  </div>
+      <div class="form-group">
+        <label for="openid_prefix">Identity URL Prefix</label>
+        <% if disable_url_prefix %>
+        <input class="form-control" id="openid_prefix" maxlength="250" name="openid_prefix" type="text"
+               value="<%=identity_url_prefix%>" disabled=true>
+        <% else %>
+        <input class="form-control" id="openid_prefix" maxlength="250" name="openid_prefix" type="text"
+               value="<%= Rails.configuration.default_openid_prefix %>">
+        <% end %>
+      </div>
+      <div class="form-group">
+        <label for="repo_name">Repository Name</label>
+        <input class="form-control" id="repo_name" maxlength="250" name="repo_name" type="text" value="<%=selected_repo%>">
+      </div>
+      <div class="form-group">
+        <label for="vm_uuid">Virtual Machine</label>
+        <select class="form-control" name="vm_uuid">
+          <option value="" <%= 'selected' unless selected_vm %>>
+           Choose One:
+         </option>
+          <% @vms.each do |vm| %>
+            <option value="<%=vm.uuid%>"
+                   <%= 'selected' if selected_vm == vm.uuid %>>
+             <%= vm.hostname %>
+           </option>
+          <% end %>
+        </select>
+      </div>
+    </div>
 
-  <div class="modal-footer">
-    <button type="submit" id="register" class="btn btn-primary" autofocus>Submit</button>
-    <button class="btn btn-default" onClick="reset_form()" data-dismiss="modal" aria-hidden="true">Cancel</button>
-  </div>
+    <div class="modal-footer">
+      <button type="submit" id="register" class="btn btn-primary" autofocus>Submit</button>
+      <button class="btn btn-default" onClick="reset_form()" data-dismiss="modal" aria-hidden="true">Cancel</button>
+    </div>
 
-<% end %>
+    <% end #form %>
+  </div>
+</div>
 
 <script>
   var $input = $('input:text'),
index 9c803c9ee8fdc9ed9b948d365e6dd2f11809193a..e2f5fdfa64b354a3988e84683c761f90247c9499 100644 (file)
@@ -10,7 +10,6 @@ account.</p>
 
 <blockquote>
 <%= link_to "Setup #{@object.full_name}", setup_popup_user_url(id: @object.uuid),  {class: 'btn btn-primary', :remote => true, 'data-toggle' =>  "modal", 'data-target' => '#user-setup-modal-window'}  %>
-<div id="user-setup-modal-window" class="modal fade" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"></div>
 </blockquote>
 
 <p>As an admin, you can deactivate and reset this user. This will remove all repository/VM permissions for the user. If you "setup" the user again, the user will have to sign the user agreement again.</p>
@@ -19,3 +18,6 @@ account.</p>
 <%= button_to "Deactivate #{@object.full_name}", unsetup_user_url(id: @object.uuid), class: 'btn btn-primary', confirm: "Are you sure you want to deactivate #{@object.full_name}?"%>
 </blockquote>
 
+<% content_for :footer_html do %>
+<div id="user-setup-modal-window" class="modal fade" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"></div>
+<% end %>