# HG changeset patch # User luisf # Date 1296493228 0 # Node ID bd3f92477cbb4c45beb766eda28894a09db27713 # Parent bad82329a115ff86be4d7bc40c515238ea3a20f2 new javascript to hold registration page specific functions. registration page specific behaviour. diff -r bad82329a115 -r bd3f92477cbb app/views/account/register.rhtml --- 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" %>
<%= ssamr_user_detail.text_area :description, :rows => 3, :cols => 40, :required => true, :class => 'wiki-edit' %>
+ +<%= ssamr_user_detail.radio_button :institution_type, true %> - <%= ssamr_user_detail.collection_select(:institution_id, Institution.all, :id, :name, {:selected => @selected_institution_id} ) %>
+ +<%= ssamr_user_detail.radio_button :institution_type, false %> Other: <%= ssamr_user_detail.text_field :other_institution %> diff -r bad82329a115 -r bd3f92477cbb public/javascripts/ssamr_institutions.js --- 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(); - } +} ); diff -r bad82329a115 -r bd3f92477cbb public/javascripts/ssamr_registration.js --- /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; +} +); + + +