# HG changeset patch # User luisf # Date 1297081826 0 # Node ID d1713ab108133933412d2422aefc9fa3d25c03f6 # Parent 440c4f4bf2d681d1f37b374a3ab9c2d8ef6bd461 feature_64: link to terms and conditions wiki page; fixed form resubmission bug. diff -r 440c4f4bf2d6 -r d1713ab10813 app/controllers/account_controller.rb --- a/app/controllers/account_controller.rb Thu Feb 03 17:11:33 2011 +0000 +++ b/app/controllers/account_controller.rb Mon Feb 07 12:30:26 2011 +0000 @@ -108,7 +108,9 @@ # associates the 2 objects @user.ssamr_user_detail = @ssamr_user_details + @selected_institution_id = params[:ssamr_user_details][:institution_id].to_i + case Setting.self_registration when '1' register_by_email_activation(@user) diff -r 440c4f4bf2d6 -r d1713ab10813 app/views/account/register.rhtml --- a/app/views/account/register.rhtml Thu Feb 03 17:11:33 2011 +0000 +++ b/app/views/account/register.rhtml Mon Feb 07 12:30:26 2011 +0000 @@ -43,7 +43,7 @@

<%= ssamr_user_detail.radio_button :institution_type, true %> - <%= ssamr_user_detail.collection_select(:institution_id, Institution.find(:all, :order => "institutions.order"), :id, :name, {:prompt => true}).gsub('&', '&') %> + <%= ssamr_user_detail.collection_select(:institution_id, Institution.find(:all, :order => "institutions.order"), :id, :name, {:selected => @selected_institution_id, :prompt => true}).gsub('&', '&') %>

@@ -63,7 +63,7 @@ -<%= check_box :user, :terms_and_conditions %> I have read and agree with the terms and conditions. +<%= check_box :user, :terms_and_conditions %> <%= l(:accept_terms_and_conditions) %> <%= link_to("Terms and Conditions", "https://code.soundsoftware.ac.uk/projects/soundsoftware-site/wiki/TandCs", {:target => "_blank"}) %>.

diff -r 440c4f4bf2d6 -r d1713ab10813 config/locales/en-GB.yml --- a/config/locales/en-GB.yml Thu Feb 03 17:11:33 2011 +0000 +++ b/config/locales/en-GB.yml Mon Feb 07 12:30:26 2011 +0000 @@ -418,6 +418,7 @@ label_tipoftheday: Tip of the day label_notifications: Important Message field_terms_and_conditions: 'Terms and Conditions:' + accept_terms_and_conditions: 'I have read and agree with the ' label_ssamr_description: Research description label_ssamr_details: Other Details label_ssamr_institution: Institution diff -r 440c4f4bf2d6 -r d1713ab10813 config/locales/en.yml --- a/config/locales/en.yml Thu Feb 03 17:11:33 2011 +0000 +++ b/config/locales/en.yml Mon Feb 07 12:30:26 2011 +0000 @@ -308,6 +308,7 @@ setting_tipoftheday_text: Tip of the Day setting_notifications_text: Notifications field_terms_and_conditions: 'Terms and Conditions:' + accept_terms_and_conditions: 'I have read and agree with the ' label_ssamr_description: Research description setting_app_title: Application title setting_app_subtitle: Application subtitle diff -r 440c4f4bf2d6 -r d1713ab10813 public/javascripts/ssamr_registration.js --- a/public/javascripts/ssamr_registration.js Thu Feb 03 17:11:33 2011 +0000 +++ b/public/javascripts/ssamr_registration.js Mon Feb 07 12:30:26 2011 +0000 @@ -5,12 +5,14 @@ /* 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; -} + + if(!$('ssamr_user_details_institution_type_true').checked && $('ssamr_user_details_institution_type_true').checked){ + $('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; + } + } );