# HG changeset patch # User luisf # Date 1295967470 0 # Node ID 6bd9b26ebd070852c164f6bbadea0d27fc003c31 # Parent 0f3210a90f46450a701f146f1e3ec7a961f1df82 DEV commit - added new logic and view details. diff -r 0f3210a90f46 -r 6bd9b26ebd07 app/controllers/users_controller.rb --- a/app/controllers/users_controller.rb Mon Jan 24 13:52:04 2011 +0000 +++ b/app/controllers/users_controller.rb Tue Jan 25 14:57:50 2011 +0000 @@ -138,7 +138,12 @@ @notification_option = @user.mail_notification @ssamr_user_details = @user.ssamr_user_detail + @selected_institution_id = @user.ssamr_user_detail.institution_id.to_i + + if @institution_type == "other" + @selected_institution_id = 11 + end @auth_sources = AuthSource.find(:all) @membership ||= Member.new diff -r 0f3210a90f46 -r 6bd9b26ebd07 app/views/account/register.rhtml --- a/app/views/account/register.rhtml Mon Jan 24 13:52:04 2011 +0000 +++ b/app/views/account/register.rhtml Tue Jan 25 14:57:50 2011 +0000 @@ -47,23 +47,14 @@
- <%= radio_button_tag(:institution_type, "other", :onchange => "alert ('mau')") %> - <%= label_tag(:institution_type, "Other institution: ") %> + <%= radio_button_tag(:institution_type, "other", false) %> + <%= label_tag("Other institution: ") %> <%= ssamr_user_detail.text_field(:institution_id) %>
<% end %> - - <% if Setting.openid? %><%= text_field 'user', 'identity_url' %>
diff -r 0f3210a90f46 -r 6bd9b26ebd07 app/views/users/_form.rhtml --- a/app/views/users/_form.rhtml Mon Jan 24 13:52:04 2011 +0000 +++ b/app/views/users/_form.rhtml Tue Jan 25 14:57:50 2011 +0000 @@ -25,11 +25,21 @@<%= ssamr_user_detail.text_area :description, :rows => 3, :cols => 40, :required => true, :class => 'wiki-edit' %>
-- - <%= ssamr_user_detail.collection_select(:institution_id, Institution.all, :id, :name, {:selected => @selected_institution_id} ) %> -
- <% end %> + + ++ <%= radio_button_tag(:institution_type, "list", true) %> + + <%= ssamr_user_detail.collection_select(:institution_id, Institution.all, :id, :name, {:selected => @selected_institution_id} ) %> +
+ ++ <%= radio_button_tag(:institution_type, "other", false) %> + <%= label_tag("Other institution: ") %> + <%= ssamr_user_detail.text_field(:institution_id) %> +
+ + <% end %>