changeset 162:bd3f92477cbb feature_55

new javascript to hold registration page specific functions. registration page specific behaviour.
author luisf
date Mon, 31 Jan 2011 17:00:28 +0000
parents bad82329a115
children 9a5a265e77f0
files app/views/account/register.rhtml app/views/users/_form.rhtml public/javascripts/ssamr_institutions.js public/javascripts/ssamr_registration.js
diffstat 4 files changed, 24 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/app/views/account/register.rhtml	Mon Jan 31 13:41:00 2011 +0000
+++ b/app/views/account/register.rhtml	Mon Jan 31 17:00:28 2011 +0000
@@ -1,4 +1,5 @@
 <%= javascript_include_tag "ssamr_institutions" %>
+<%= javascript_include_tag "ssamr_registration" %>
 
 <h2><%=l(:label_register)%> <%=link_to l(:label_login_with_open_id_option), signin_url if Setting.openid? %></h2>
 
--- a/app/views/users/_form.rhtml	Mon Jan 31 13:41:00 2011 +0000
+++ b/app/views/users/_form.rhtml	Mon Jan 31 17:00:28 2011 +0000
@@ -28,12 +28,15 @@
             <p>
               <%= ssamr_user_detail.text_area :description, :rows => 3, :cols => 40, :required => true, :class => 'wiki-edit'  %>                            
             </p>
+
+
             <p>
               <%= ssamr_user_detail.radio_button :institution_type, true %>
-              
               <%= ssamr_user_detail.collection_select(:institution_id, Institution.all, :id, :name, {:selected => @selected_institution_id} ) %>
             </p>
 
+
+
             <p>
                <%= ssamr_user_detail.radio_button :institution_type, false %> Other:
                <%= ssamr_user_detail.text_field :other_institution %>
--- a/public/javascripts/ssamr_institutions.js	Mon Jan 31 13:41:00 2011 +0000
+++ b/public/javascripts/ssamr_institutions.js	Mon Jan 31 17:00:28 2011 +0000
@@ -14,12 +14,12 @@
 	    $('ssamr_user_details_other_institution').enable();
 		$('ssamr_user_details_institution_id').disable();
 	});
-
+        
     if($('ssamr_user_details_institution_type_true').checked)
         $('ssamr_user_details_other_institution').disable();
     else if($('ssamr_user_details_institution_type_false').checked)
         $('ssamr_user_details_institution_id').disable();
-  }
+}
 );
 
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/public/javascripts/ssamr_registration.js	Mon Jan 31 17:00:28 2011 +0000
@@ -0,0 +1,17 @@
+
+
+/* SSAMR specific functions */
+
+/* institution related functions */
+Event.observe(window, 'load',
+  function() {
+	
+  $('ssamr_user_details_other_institution').disable();
+  $('ssamr_user_details_institution_id').enable();
+  $('ssamr_user_details_institution_type_true').checked = true;
+  $('ssamr_user_details_institution_type_false').checked = false;
+}
+);
+
+
+