[ARVADOS] updated: 7a123a79df7bd5849342a70c6b9268d100b6ee10

git at public.curoverse.com git at public.curoverse.com
Wed Apr 2 19:53:29 EDT 2014


Summary of changes:
 apps/workbench/app/controllers/users_controller.rb |    9 ++++++---
 .../workbench/app/views/application/index.html.erb |   19 ++++++++++++++-----
 .../app/views/users/_setup_popup.html.erb          |   13 +++++++++----
 apps/workbench/app/views/users/setup.js.erb        |    1 +
 apps/workbench/config/routes.rb                    |    3 ++-
 5 files changed, 32 insertions(+), 13 deletions(-)

       via  7a123a79df7bd5849342a70c6b9268d100b6ee10 (commit)
       via  e68869893b61dfb57fab95f6e14660d88aa02a10 (commit)
      from  04589f063341ff2438ffb62217362c6998346e86 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 7a123a79df7bd5849342a70c6b9268d100b6ee10
Author: radhika chippada <radhika at radhika.curoverse>
Date:   Wed Apr 2 19:51:45 2014 -0400

    New user creation using setup action is working

diff --git a/apps/workbench/app/views/application/index.html.erb b/apps/workbench/app/views/application/index.html.erb
index d456443..7108c70 100644
--- a/apps/workbench/app/views/application/index.html.erb
+++ b/apps/workbench/app/views/application/index.html.erb
@@ -4,18 +4,20 @@
 
 <% content_for :tab_line_buttons do %>
 
-<% if controller.model_class.creatable? %>
-  <% if controller.model_class.name != 'User' %>
-    <%= button_to "Add a new #{controller.model_class.to_s.underscore.gsub '_', ' '}", 
-      { action: 'create', return_to: request.url }, 
-      { class: 'btn btn-primary pull-right' } %>
-  <% else %>
-    <%= link_to "Add a new #{controller.model_class.to_s.underscore.gsub '_', ' '}", setup_user_popup_path,  
-      {class: 'btn btn-primary pull-right', :remote => true, 'data-toggle' =>  "modal", 'data-target' => '#modal-window'}  %>
-    <div id="modal-window" class="modal fade" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"></div>
-  <% end %>
+  <% if controller.model_class.creatable? %>
 
-<% end %>
+    <% if controller.model_class.name == 'User' %>
+      <%= link_to "Add a new #{controller.model_class.to_s.underscore.gsub '_', ' '}", setup_user_popup_path,
+        {class: 'btn btn-primary pull-right', :remote => true, 'data-toggle' =>  "modal", 
+          'data-target' => '#modal-window', return_to: request.url}  %>
+      <div id="modal-window" class="modal fade" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"></div>
+    <% else %>
+      <%= button_to "Add a new #{controller.model_class.to_s.underscore.gsub '_', ' '}", 
+        { action: 'create', return_to: request.url }, 
+        { class: 'btn btn-primary pull-right' } %>
+    <% end %>
+
+  <% end %>
 
 <% end %>
 
diff --git a/apps/workbench/app/views/users/setup.js.erb b/apps/workbench/app/views/users/setup.js.erb
index c4059f0..9134623 100644
--- a/apps/workbench/app/views/users/setup.js.erb
+++ b/apps/workbench/app/views/users/setup.js.erb
@@ -1 +1,2 @@
 $("#modal-window").modal("hide");
+document.location.reload();

commit e68869893b61dfb57fab95f6e14660d88aa02a10
Author: radhika chippada <radhika at radhika.curoverse>
Date:   Wed Apr 2 18:52:04 2014 -0400

    "Add a new user" link uses setup method to create a "loaded" user.

diff --git a/apps/workbench/app/controllers/users_controller.rb b/apps/workbench/app/controllers/users_controller.rb
index dbd084d..087224d 100644
--- a/apps/workbench/app/controllers/users_controller.rb
+++ b/apps/workbench/app/controllers/users_controller.rb
@@ -149,13 +149,16 @@ class UsersController < ApplicationController
     respond_to do |format|
       if current_user.andand.is_admin
         setup_params = {}
-        if params['uuid'] && params['uuid'].size>0
-          setup_params[:uuid] = params['uuid']
+        if params['user_uuid'] && params['user_uuid'].size>0
+          setup_params[:uuid] = params['user_uuid']
         end
         if params['email'] && params['email'].size>0
-          user = {email: params['email'], openid_prefix: params['openid_prefix']}
+          user = {email: params['email']}
           setup_params[:user] = user
         end
+        if params['openid_prefix'] && params['openid_prefix'].size>0
+          setup_params[:openid_prefix] = params['openid_prefix']
+        end
         if params['repo_name'] && params['repo_name'].size>0
           setup_params[:repo_name] = params['repo_name']
         end
diff --git a/apps/workbench/app/views/application/index.html.erb b/apps/workbench/app/views/application/index.html.erb
index 67b5004..d456443 100644
--- a/apps/workbench/app/views/application/index.html.erb
+++ b/apps/workbench/app/views/application/index.html.erb
@@ -5,9 +5,16 @@
 <% content_for :tab_line_buttons do %>
 
 <% if controller.model_class.creatable? %>
-<%= button_to "Add a new #{controller.model_class.to_s.underscore.gsub '_', ' '}", 
-    { action: 'create', return_to: request.url }, 
-    { class: 'btn btn-primary pull-right' } %>
+  <% if controller.model_class.name != 'User' %>
+    <%= button_to "Add a new #{controller.model_class.to_s.underscore.gsub '_', ' '}", 
+      { action: 'create', return_to: request.url }, 
+      { class: 'btn btn-primary pull-right' } %>
+  <% else %>
+    <%= link_to "Add a new #{controller.model_class.to_s.underscore.gsub '_', ' '}", setup_user_popup_path,  
+      {class: 'btn btn-primary pull-right', :remote => true, 'data-toggle' =>  "modal", 'data-target' => '#modal-window'}  %>
+    <div id="modal-window" class="modal fade" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"></div>
+  <% end %>
+
 <% end %>
 
 <% end %>
diff --git a/apps/workbench/app/views/users/_setup_popup.html.erb b/apps/workbench/app/views/users/_setup_popup.html.erb
index 5711d95..f1c15db 100644
--- a/apps/workbench/app/views/users/_setup_popup.html.erb
+++ b/apps/workbench/app/views/users/_setup_popup.html.erb
@@ -1,18 +1,23 @@
   <div class="modal-body">
-    <% uuid = @object.uuid %>
-    <% disable_email =  @object.uuid? %>
+    <% 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] %>
     
-    <%= 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 %>    
+<% puts "\n\n **************** setup_user_url = #{setup_user_url.inspect}" %>
+    <%= form_tag setup_user_path, {id: 'setup_form', name: 'setup_form', method: 'get', class: 'form-search', remote: true} do %>
+      <input id="user_uuid" maxlength="250" name="user_uuid" type="hidden" value="<%=uuid%>">
       <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>
+              <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>
diff --git a/apps/workbench/config/routes.rb b/apps/workbench/config/routes.rb
index 43e9bfa..8c89238 100644
--- a/apps/workbench/config/routes.rb
+++ b/apps/workbench/config/routes.rb
@@ -7,6 +7,8 @@ ArvadosWorkbench::Application.routes.draw do
     get 'signatures', on: :collection
   end
   get '/user_agreements/signatures' => 'user_agreements#signatures'
+  get "users/setup_popup" => 'users#setup_popup', :as => :setup_user_popup
+  get "users/setup" => 'users#setup', :as => :setup_user
   resources :nodes
   resources :humans
   resources :traits
@@ -24,7 +26,6 @@ ArvadosWorkbench::Application.routes.draw do
     get 'activity', :on => :collection
     post 'sudo', :on => :member
     post 'unsetup', :on => :member
-    get 'setup', :on => :member
     get 'setup_popup', :on => :member
   end
   resources :logs

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list