# HG changeset patch # User luisf # Date 1297177628 0 # Node ID f5860b03d36529e342e44d472c24b9bf69e6b50e # Parent bb7cac2ac146e3a79bf15e16d789329fb44a324c added js to external repository URL text field and checkbox. diff -r bb7cac2ac146 -r f5860b03d365 app/views/projects/settings/_repository.rhtml --- a/app/views/projects/settings/_repository.rhtml Tue Feb 08 13:15:47 2011 +0000 +++ b/app/views/projects/settings/_repository.rhtml Tue Feb 08 15:07:08 2011 +0000 @@ -1,3 +1,6 @@ + +<%= javascript_include_tag 'repository' %> + <% remote_form_for :repository, @repository, :url => { :controller => 'repositories', :action => 'edit', :id => @project }, :builder => TabularFormBuilder, @@ -15,14 +18,14 @@

<%= label_tag('repository_is_external', l(:label_is_external_repository)) %> - <%= check_box :repository, :is_external %> + <%= check_box :repository, :is_external, :onclick => "toggle_ext_url()" %> <%= l(:setting_external_repository) %>

<%= label_tag('repository_external_url', l(:label_repository_external_url)) %> - <%= text_field :repository, :external_url %> + <%= text_field :repository, :external_url, :disabled => true %> <%= l(:setting_external_repository_url) %>

diff -r bb7cac2ac146 -r f5860b03d365 public/javascripts/repository.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/public/javascripts/repository.js Tue Feb 08 15:07:08 2011 +0000 @@ -0,0 +1,7 @@ +function toggle_ext_url(){ + if($('repository_is_external').checked) + $('repository_external_url').enable(); + else + $('repository_external_url').disable(); +} + diff -r bb7cac2ac146 -r f5860b03d365 public/javascripts/ssamr_registration.js --- a/public/javascripts/ssamr_registration.js Tue Feb 08 13:15:47 2011 +0000 +++ b/public/javascripts/ssamr_registration.js Tue Feb 08 15:07:08 2011 +0000 @@ -4,13 +4,12 @@ /* institution related functions */ Event.observe(window, 'load', - function() { - + function() { 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; + $('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; } } );