[ARVADOS] updated: d7dc4d6026d2752b752b30dc627a22c158141ebb

git at public.curoverse.com git at public.curoverse.com
Tue Aug 5 14:22:05 EDT 2014


Summary of changes:
 .../app/controllers/application_controller.rb      |  3 +-
 apps/workbench/app/controllers/users_controller.rb |  3 +-
 apps/workbench/app/views/users/_profile.html.erb   | 48 ++++++++++++++++------
 3 files changed, 40 insertions(+), 14 deletions(-)

       via  d7dc4d6026d2752b752b30dc627a22c158141ebb (commit)
      from  85ee7f10d6aa8084da51a388011395c080842c70 (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 d7dc4d6026d2752b752b30dc627a22c158141ebb
Author: radhika <radhika at curoverse.com>
Date:   Tue Aug 5 14:20:45 2014 -0400

    3296: display read-only email, first name, last name, and identity url in the profile page.

diff --git a/apps/workbench/app/controllers/application_controller.rb b/apps/workbench/app/controllers/application_controller.rb
index 4b79cb4..fd94cf8 100644
--- a/apps/workbench/app/controllers/application_controller.rb
+++ b/apps/workbench/app/controllers/application_controller.rb
@@ -517,7 +517,8 @@ class ApplicationController < ActionController::Base
     if current_user && @profile_config
       missing_required_profile = false
 
-      user_prefs = User.limit(1).where(uuid: current_user.uuid).first.prefs
+      @this_user = User.limit(1).where(uuid: current_user.uuid).first
+      user_prefs = @this_user.prefs
       @current_user_profile = user_prefs[:profile] if user_prefs
 
       @profile_config.andand.each do |entry|
diff --git a/apps/workbench/app/controllers/users_controller.rb b/apps/workbench/app/controllers/users_controller.rb
index 441c99a..0d6f624 100644
--- a/apps/workbench/app/controllers/users_controller.rb
+++ b/apps/workbench/app/controllers/users_controller.rb
@@ -279,7 +279,8 @@ class UsersController < ApplicationController
 
   def manage_profile
     @profile_config = Rails.configuration.user_profile_form_fields
-    user_prefs = User.limit(1).where(uuid: current_user.uuid).first.prefs
+    @this_user = User.limit(1).where(uuid: current_user.uuid).first
+    user_prefs = @this_user.prefs
     @current_user_profile = user_prefs[:profile] if user_prefs
 
     respond_to do |f|
diff --git a/apps/workbench/app/views/users/_profile.html.erb b/apps/workbench/app/views/users/_profile.html.erb
index 9946914..7cc786a 100644
--- a/apps/workbench/app/views/users/_profile.html.erb
+++ b/apps/workbench/app/views/users/_profile.html.erb
@@ -13,12 +13,37 @@
           </div>
           <div>
             <%= form_tag update_profile_path, {method: 'get', id: 'save_profile_form', name: 'save_profile_form', class: 'form-horizontal', remote: true} do %>
-            <% @profile_config.andand.each do |entry| %>
-              <%
-                  label = entry['required'] ? '* ' : ''
-                  label += entry['form_field_title']
-                  value = @current_user_profile[entry['key'].to_sym] if @current_user_profile
-              %>
+              <div class="form-group">
+                  <label for="email" class="col-sm-3 control-label"> Email </label>
+                  <div class="col-sm-9">
+                    <input type="text" class="form-control" id="email" name="email" placeholder="Email" value="<%=current_user.email%>" disabled></input>
+                  </div>
+              </div>
+              <div class="form-group">
+                  <label for="first_name" class="col-sm-3 control-label"> First name </label>
+                  <div class="col-sm-9">
+                    <input type="text" class="form-control" id="first_name" name="first_name" placeholder="First name" value="<%=current_user.first_name%>" disabled></input>
+                  </div>
+              </div>
+              <div class="form-group">
+                  <label for="last_name" class="col-sm-3 control-label"> Last name </label>
+                  <div class="col-sm-9">
+                    <input type="text" class="form-control" id="last_name" name="last_name" placeholder="Last name" value="<%=current_user.last_name%>" disabled></input>
+                  </div>
+              </div>
+              <div class="form-group">
+                  <label for="identity_url" class="col-sm-3 control-label"> Identity URL </label>
+                  <div class="col-sm-9">
+                    <input type="text" class="form-control" id="identity_url" name="identity_url" placeholder="Identity URL" value="<%=@this_user.identity_url%>" disabled></input>
+                  </div>
+              </div>
+
+              <% @profile_config.andand.each do |entry| %>
+                <%
+                    label = entry['required'] ? '* ' : ''
+                    label += entry['form_field_title']
+                    value = @current_user_profile[entry['key'].to_sym] if @current_user_profile
+                %>
                 <div class="form-group">
                   <label for="<%=entry['key']%>"
                          class="col-sm-3 control-label"
@@ -40,13 +65,12 @@
                 </div>
               <% end %>
 
-                <div class="form-group">
-                  <div class="col-sm-offset-2 col-sm-10">
-                    <button type="submit" class="btn btn-primary">Save profile</button>
-                  </div>
+              <div class="form-group">
+                <div class="col-sm-offset-2 col-sm-10">
+                  <button type="submit" class="btn btn-primary">Save profile</button>
                 </div>
-
-              <% end %>
+              </div>
+            <% end %>
           </div>
         </div>
       </div>

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list