Mercurial > hg > soundsoftware-site
changeset 153:6bd9b26ebd07 feature_55
DEV commit - added new logic and view details.
author | luisf |
---|---|
date | Tue, 25 Jan 2011 14:57:50 +0000 |
parents | 0f3210a90f46 |
children | 2d5da64204bc |
files | app/controllers/users_controller.rb app/views/account/register.rhtml app/views/users/_form.rhtml |
diffstat | 3 files changed, 22 insertions(+), 16 deletions(-) [+] |
line wrap: on
line diff
--- 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
--- 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 @@ </p> <p> - <%= 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) %> </p> <% end %> -<script language="javascript"> - -if(document.getElementById('myText')==false) - alert("Falso"); -else - alert("True"); - -</script> - <% if Setting.openid? %> <p><label for="user_identity_url"><%=l(:field_identity_url)%></label> <%= text_field 'user', 'identity_url' %></p>
--- 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 @@ <p> <%= ssamr_user_detail.text_area :description, :rows => 3, :cols => 40, :required => true, :class => 'wiki-edit' %> </p> - <p> - <label for="ssamr_user_institution"><%=l(:label_ssamr_institution)%></label> - <%= ssamr_user_detail.collection_select(:institution_id, Institution.all, :id, :name, {:selected => @selected_institution_id} ) %> - </p> - <% end %> + + + <p> + <%= radio_button_tag(:institution_type, "list", true) %> + <label for="ssamr_user_institution"><%=l(:label_ssamr_institution)%></label> + <%= ssamr_user_detail.collection_select(:institution_id, Institution.all, :id, :name, {:selected => @selected_institution_id} ) %> + </p> + + <p> + <%= radio_button_tag(:institution_type, "other", false) %> + <%= label_tag("Other institution: ") %> + <%= ssamr_user_detail.text_field(:institution_id) %> + </p> + + <% end %> </div>