# HG changeset patch # User Chris Cannam # Date 1296746130 0 # Node ID b46db3a8b1b4e0f22874c98334f80a051715574f # Parent be1bccc405d938b72272bdfcb7f432bb818ad694# Parent 0d3dd7562e6a614191b8979b9efea66f0c76b1e6 Merge from branch "feature_55" diff -r be1bccc405d9 -r b46db3a8b1b4 app/controllers/my_controller.rb --- a/app/controllers/my_controller.rb Wed Feb 02 12:12:47 2011 +0000 +++ b/app/controllers/my_controller.rb Thu Feb 03 15:15:30 2011 +0000 @@ -52,11 +52,38 @@ def account @user = User.current @pref = @user.pref + @ssamr_user_details = @user.ssamr_user_detail + + @selected_institution_id = @ssamr_user_details.institution_id.to_i + if request.post? @user.attributes = params[:user] @user.mail_notification = params[:notification_option] || 'only_my_events' @user.pref.attributes = params[:pref] @user.pref[:no_self_notified] = (params[:no_self_notified] == '1') + + if @user.ssamr_user_detail == nil + @ssamr_user_details = SsamrUserDetail.new() + @user.ssamr_user_detail = @ssamr_user_details + else + @ssamr_user_details = @user.ssamr_user_detail + end + + + if params[:ssamr_user_details].nil? or params[:ssamr_user_details].empty? + @ssamr_user_details.description = @user.ssamr_user_detail.description + @ssamr_user_details.institution_id = @user.ssamr_user_detail.institution_id + @institution_type = @ssamr_user_details.institution_type + @other_institution = @ssamr_user_details.other_institution + else + @ssamr_user_details.description = params[:ssamr_user_details][:description] + @ssamr_user_details.institution_id = params[:ssamr_user_details][:institution_id] + @ssamr_user_details.institution_type = params[:ssamr_user_details][:institution_type] + @ssamr_user_details.other_institution = params[:ssamr_user_details][:other_institution] + end + + @selected_institution_id = @ssamr_user_details.institution_id.to_i + if @user.save @user.pref.save @user.notified_project_ids = (params[:notification_option] == 'selected' ? params[:notified_project_ids] : []) diff -r be1bccc405d9 -r b46db3a8b1b4 app/controllers/users_controller.rb --- a/app/controllers/users_controller.rb Wed Feb 02 12:12:47 2011 +0000 +++ b/app/controllers/users_controller.rb Thu Feb 03 15:15:30 2011 +0000 @@ -54,6 +54,15 @@ if @user.ssamr_user_detail != nil @description = @user.ssamr_user_detail.description + + if @user.ssamr_user_detail.institution_type != nil + # institution_type is true for listed institutions + if (@user.ssamr_user_detail.institution_type) + @institution_name = Institution.find(@user.ssamr_user_detail.institution_id).name + else + @institution_name = @user.ssamr_user_detail.other_institution + end + end end # show projects based on current user visibility @@ -82,7 +91,6 @@ @auth_sources = AuthSource.find(:all) @ssamr_user_details = SsamrUserDetail.new - end verify :method => :post, :only => :create, :render => {:nothing => true, :status => :method_not_allowed } @@ -132,6 +140,8 @@ @ssamr_user_details = @user.ssamr_user_detail + @selected_institution_id = @user.ssamr_user_detail.institution_id.to_i + @auth_sources = AuthSource.find(:all) @membership ||= Member.new end @@ -163,12 +173,18 @@ else @ssamr_user_details = @user.ssamr_user_detail end - - + if params[:ssamr_user_details].nil? or params[:ssamr_user_details].empty? @ssamr_user_details.description = @user.ssamr_user_detail.description + @ssamr_user_details.institution_id = @user.ssamr_user_detail.institution_id + @ssamr_user_details.other_institution = @user.ssamr_user_detail.other_institution + @ssamr_user_details.institution_type = @user.ssamr_user_detail.institution_type + else @ssamr_user_details.description = params[:ssamr_user_details][:description] + @ssamr_user_details.institution_id = params[:ssamr_user_details][:institution_id] + @ssamr_user_details.other_institution = params[:ssamr_user_details][:other_institution] + @ssamr_user_details.institution_type = params[:ssamr_user_details][:institution_type] @ssamr_user_details.save! end diff -r be1bccc405d9 -r b46db3a8b1b4 app/models/institution.rb --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/models/institution.rb Thu Feb 03 15:15:30 2011 +0000 @@ -0,0 +1,2 @@ +class Institution < ActiveRecord::Base +end diff -r be1bccc405d9 -r b46db3a8b1b4 app/models/ssamr_user_detail.rb --- a/app/models/ssamr_user_detail.rb Wed Feb 02 12:12:47 2011 +0000 +++ b/app/models/ssamr_user_detail.rb Thu Feb 03 15:15:30 2011 +0000 @@ -2,4 +2,13 @@ belongs_to :user validates_presence_of :description + + validate :check_institution + + def check_institution() + errors.add(:institution_id, "Please insert an institution") if + institution_id.blank? and other_institution.blank? + end + + end diff -r be1bccc405d9 -r b46db3a8b1b4 app/views/account/register.rhtml --- a/app/views/account/register.rhtml Wed Feb 02 12:12:47 2011 +0000 +++ b/app/views/account/register.rhtml Thu Feb 03 15:15:30 2011 +0000 @@ -1,3 +1,6 @@ +<%= javascript_include_tag "ssamr_institutions" %> +<%= javascript_include_tag "ssamr_registration" %> +

<%=l(:label_register)%> <%=link_to l(:label_login_with_open_id_option), signin_url if Setting.openid? %>

<% form_tag({:action => 'register'}, :class => "tabular") do %> @@ -34,17 +37,21 @@ <% fields_for :ssamr_user_details, :builder => TabularFormBuilder, :lang => current_language do |ssamr_user_detail| %>

+ <%= ssamr_user_detail.text_area :description, :rows => 3, :cols => 40, :required => true, :class => 'wiki-edit' %> + <%=l(:text_user_ssamr_description_info)%> +

- <%= ssamr_user_detail.text_area :description, :rows => 3, :cols => 40, :required => true, :class => 'wiki-edit' %> - <%= wikitoolbar_for 'ssamr_user_details_description' %> +

+ <%= 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('&', '&') %> +

- <%=l(:text_user_ssamr_description_info)%> +

+ <%= ssamr_user_detail.radio_button :institution_type, false %> Other: + <%= ssamr_user_detail.text_field(:other_institution) %>

<% end %> - - - <% if Setting.openid? %>

<%= text_field 'user', 'identity_url' %>

diff -r be1bccc405d9 -r b46db3a8b1b4 app/views/my/account.rhtml --- a/app/views/my/account.rhtml Wed Feb 02 12:12:47 2011 +0000 +++ b/app/views/my/account.rhtml Thu Feb 03 15:15:30 2011 +0000 @@ -1,3 +1,6 @@ +<%= javascript_include_tag "ssamr_institutions" %> + +
<%= link_to(l(:button_change_password), :action => 'password') if @user.change_password_allowed? %> <%= call_hook(:view_my_account_contextual, :user => @user)%> @@ -9,6 +12,8 @@ :builder => TabularFormBuilder, :lang => current_language, :html => { :id => 'my_account_form' } do |f| %> + +

<%=l(:label_information_plural)%>

@@ -23,9 +28,35 @@ <% @user.custom_field_values.select(&:editable?).each do |value| %>

<%= custom_field_tag_with_label :user, value %>

<% end %> + <%= call_hook(:view_my_account, :user => @user, :form => f) %>
+

<%=l(:label_ssamr_details)%>

+
+ <% fields_for :ssamr_user_details, :builder => TabularFormBuilder, :lang => current_language do |ssamr_user_detail| %> +

+ <%= ssamr_user_detail.text_area :description, :rows => 3, :cols => 25, :required => true, :class => 'wiki-edit' %> +

+ + +

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

+ +

+ + <%= ssamr_user_detail.radio_button :institution_type, false %> Other: + <%= ssamr_user_detail.text_field :other_institution, :size => 19 %> + +

+ <% end %> +
+ + <%= submit_tag l(:button_save) %>
@@ -43,6 +74,14 @@
<% end %> + + + + + + + + <% content_for :sidebar do %> <%= render :partial => 'sidebar' %> <% end %> diff -r be1bccc405d9 -r b46db3a8b1b4 app/views/users/_form.rhtml --- a/app/views/users/_form.rhtml Wed Feb 02 12:12:47 2011 +0000 +++ b/app/views/users/_form.rhtml Thu Feb 03 15:15:30 2011 +0000 @@ -1,3 +1,7 @@ + +<%= javascript_include_tag "ssamr_institutions" %> +<%= javascript_include_tag "ssamr_registration" %> + <%= error_messages_for 'user' %> @@ -23,12 +27,25 @@

<%=l(:label_ssamr_details)%>

<% fields_for :ssamr_user_details, :builder => TabularFormBuilder, :lang => current_language do |ssamr_user_detail| %>

- <%= ssamr_user_detail.text_area :description, :rows => 3, :cols => 40, :required => true, :class => 'wiki-edit' %> - <%= wikitoolbar_for 'ssamr_user_details_description' %> -
- <%=l(:text_user_ssamr_description_info)%> + <%= ssamr_user_detail.text_area :description, :rows => 3, :cols => 40, :required => true, :class => 'wiki-edit' %>

- <% end %> + +

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

+ + + +

+ + <%= ssamr_user_detail.radio_button :institution_type, false %> Other: + <%= ssamr_user_detail.text_field :other_institution %> + +

+ <% end %> diff -r be1bccc405d9 -r b46db3a8b1b4 app/views/users/show.rhtml --- a/app/views/users/show.rhtml Wed Feb 02 12:12:47 2011 +0000 +++ b/app/views/users/show.rhtml Thu Feb 03 15:15:30 2011 +0000 @@ -23,6 +23,9 @@

<%=l(:label_ssamr_description)%>

<%= textilizable @description %> +

<%=l(:label_ssamr_institution)%>

+<%= h @institution_name %> + <% unless @memberships.empty? %>

<%=l(:label_project_plural)%>

diff -r be1bccc405d9 -r b46db3a8b1b4 config/locales/en-GB.yml --- a/config/locales/en-GB.yml Wed Feb 02 12:12:47 2011 +0000 +++ b/config/locales/en-GB.yml Thu Feb 03 15:15:30 2011 +0000 @@ -199,6 +199,10 @@ field_ssamr_user_detail: description: User Description + institution: Institution + + field_other_institution: '' + field_name: Name field_description: Description field_summary: Summary @@ -415,7 +419,7 @@ label_notifications: Important Message label_ssamr_description: Research description label_ssamr_details: Other Details - + label_ssamr_institution: Institution label_user: User label_user_plural: Users label_user_new: New user @@ -423,8 +427,6 @@ label_project: Project label_project_new: New project label_project_plural: Projects - label_my_project_plural: My Projects - label_other_project_plural: "Everyone Else's Projects" label_x_projects: zero: no projects one: 1 project @@ -704,7 +706,7 @@ label_week: Week label_date_from: From label_date_to: To - label_language_based: "Based on user's language" + label_language_based: Based on user's language label_sort_by: "Sort by {{value}}" label_send_test_email: Send a test email label_feeds_access_key: RSS access key @@ -846,7 +848,7 @@ text_project_homepage_info: 'Link to an external project page.' text_project_name_info: "This will be the name of your project throughout this site.
You can change your project's name at any time, in the project's settings." text_project_visibility_info: "If your project is not public, it will only be visible to users that you have added as project members." - text_user_ssamr_description_info: 'Please describe your current research or development interests, within the fields of audio and music.
This information is publicly visible in your profile and you can edit it at any time.
It may also be used to establish eligibility for your initial registration.' + text_user_ssamr_description_info: 'Please describe your current research or development interests, within the fields of audio and music.
This information is publicly visible in your profile and you can edit it at any time.' text_issue_parent_issue_info: 'If this is a subtask, please insert its parent task number or write the main task name.' text_caracters_maximum: "{{count}} characters maximum." text_caracters_minimum: "Must be at least {{count}} characters long." diff -r be1bccc405d9 -r b46db3a8b1b4 config/locales/en.yml --- a/config/locales/en.yml Wed Feb 02 12:12:47 2011 +0000 +++ b/config/locales/en.yml Thu Feb 03 15:15:30 2011 +0000 @@ -203,6 +203,10 @@ field_ssamr_user_detail: description: User Description + institution: Institution + + field_other_institution: '' + field_name: Name field_description: Description field_summary: Summary @@ -427,9 +431,9 @@ project_module_boards: Boards project_module_calendar: Calendar project_module_gantt: Gantt - label_tipoftheday: Tip of the day label_ssamr_details: Other Details + label_ssamr_institution: Institution label_user: User label_user_plural: Users label_user_new: New user @@ -438,7 +442,7 @@ label_project_new: New project label_project_plural: Projects label_my_project_plural: My Projects - label_other_project_plural: "Everyone Else's Projects" + label_other_project_plural: Other Projects label_x_projects: zero: no projects one: 1 project @@ -872,7 +876,7 @@ text_project_name_info: "This will be the name of your project throughout this site.
You can change your project's name at any time, in the project's settings." text_project_visibility_info: "If your project is not public, it will only be visible to users that you have added as project members." text_project_homepage_info: 'Link to an external project page.' - text_user_ssamr_description_info: 'Please describe your current research or development interests, within the fields of audio and music.
This information is publicly visible in your profile and you can edit it at any time.
It may also be used to establish eligibility for your initial registration.' + text_user_ssamr_description_info: 'Please describe your current research or development interests, within the fields of audio and music.
This information is publicly visible in your profile and you can edit it at any time.' text_issue_parent_issue_info: 'If this is a subtask, please insert its parent task number or write the main task name.' text_caracters_maximum: "{{count}} characters maximum." text_caracters_minimum: "Must be at least {{count}} characters long." diff -r be1bccc405d9 -r b46db3a8b1b4 console/db/seeds.rb --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/console/db/seeds.rb Thu Feb 03 15:15:30 2011 +0000 @@ -0,0 +1,9 @@ +# This file should contain all the record creation needed to seed the database with its default values. +# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup). +# +# Examples: +# +# cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }]) +# Major.create(:name => 'Daley', :city => cities.first) + +puts "this is a test" \ No newline at end of file diff -r be1bccc405d9 -r b46db3a8b1b4 db/migrate/20101216140621_create_institutions.rb --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/db/migrate/20101216140621_create_institutions.rb Thu Feb 03 15:15:30 2011 +0000 @@ -0,0 +1,13 @@ +class CreateInstitutions < ActiveRecord::Migration + def self.up + create_table :institutions do |t| + t.string :name + + t.timestamps + end + end + + def self.down + drop_table :institutions + end +end diff -r be1bccc405d9 -r b46db3a8b1b4 db/migrate/20101216145813_fix_university_name_in_ssamr_details_table.rb --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/db/migrate/20101216145813_fix_university_name_in_ssamr_details_table.rb Thu Feb 03 15:15:30 2011 +0000 @@ -0,0 +1,10 @@ +class FixUniversityNameInSsamrDetailsTable < ActiveRecord::Migration + def self.up + rename_column :ssamr_user_details, :university, :institution_id + end + + def self.down + # there's no need to rollback the name of this column + # because it was not used previously + end +end diff -r be1bccc405d9 -r b46db3a8b1b4 db/migrate/20110126153504_add_other_institution_column_to_ssamr_user_details.rb --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/db/migrate/20110126153504_add_other_institution_column_to_ssamr_user_details.rb Thu Feb 03 15:15:30 2011 +0000 @@ -0,0 +1,9 @@ +class AddOtherInstitutionColumnToSsamrUserDetails < ActiveRecord::Migration + def self.up + add_column :ssamr_user_details, :other_institution, :string + end + + def self.down + remove_column :ssamr_user_details, :other_institution + end +end diff -r be1bccc405d9 -r b46db3a8b1b4 db/migrate/20110127161758_add_institution_type_column_to_ssamr_user_details.rb --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/db/migrate/20110127161758_add_institution_type_column_to_ssamr_user_details.rb Thu Feb 03 15:15:30 2011 +0000 @@ -0,0 +1,9 @@ +class AddInstitutionTypeColumnToSsamrUserDetails < ActiveRecord::Migration + def self.up + add_column :ssamr_user_details, :institution_type, :boolean + end + + def self.down + remove_column :ssamr_user_details, :institution_type + end +end diff -r be1bccc405d9 -r b46db3a8b1b4 db/migrate/20110202170156_add_order_column_to_institutions.rb --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/db/migrate/20110202170156_add_order_column_to_institutions.rb Thu Feb 03 15:15:30 2011 +0000 @@ -0,0 +1,9 @@ +class AddOrderColumnToInstitutions < ActiveRecord::Migration + def self.up + add_column :institutions, :order, :integer + end + + def self.down + remove_column :institutions, :order + end +end diff -r be1bccc405d9 -r b46db3a8b1b4 db/seed_data/institutions.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/db/seed_data/institutions.txt Thu Feb 03 15:15:30 2011 +0000 @@ -0,0 +1,141 @@ +University of Aberdeen|1 +University of Abertay Dundee |2 +Aberystwyth University|3 +Anglia Ruskin University|4 +University of the Arts London|5 +Aston University|6 +Bangor University|7 +University of Bath|8 +Bath Spa University|9 +University of Bedfordshire|10 +Birkbeck, University of London|11 +University of Birmingham|12 +Birmingham City University|13 +Birmingham Conservatoire|14 +University Centre at Blackburn College|15 +University of Bolton|16 +Bournemouth University|17 +University of Bradford|18 +University of Brighton|19 +University of Bristol|20 +Brunel University|21 +University of Buckingham|22 +Buckinghamshire New University|23 +University of Cambridge|24 +Institute of Cancer Research, University of London|25 +Canterbury Christ Church University|26 +Cardiff University|27 +University of Central Lancashire|28 +Central School of Speech and Drama, University of London|29 +University of Chester|30 +University of Chichester|31 +City University London|32 +Courtauld Institute of Art|33 +Coventry University|34 +Cranfield University|35 +University for the Creative Arts|36 +University of Cumbria|37 +De Montfort University|38 +University of Derby|39 +University of Dundee|40 +Durham University|41 +University of East Anglia|42 +University of East London|43 +Edge Hill University|44 +University of Edinburgh|45 +Edinburgh Napier University|46 +Institute of Education, University of London|47 +University of Essex|48 +University of Exeter|49 +University of Glamorgan|50 +University of Glasgow|51 +Glasgow Caledonian University|52 +University of Gloucestershire|53 +Goldsmiths, University of London|54 +University of Greenwich|55 +Glyndŵr University|56 +Heriot-Watt University|57 +University of Hertfordshire|58 +Heythrop College|59 +University of Huddersfield|60 +University of Hull|61 +Hull York Medical School|62 +Imperial College London|63 +Keele University|64 +University of Kent|65 +King's College London|66 +Kingston University|67 +Lancaster University|68 +University of Leeds|69 +Leeds Metropolitan University|70 +University of Leicester|71 +University of Lincoln|72 +University of Liverpool|73 +Liverpool Hope University|74 +Liverpool John Moores University|75 +London Business School|76 +London College of Music|77 +London Metropolitan University|78 +London School of Economics and Political Science|79 +London School of Hygiene and Tropical Medicine|80 +London South Bank University|81 +Loughborough University|82 +University of Manchester|83 +Manchester Metropolitan University|84 +Middlesex University|85 +Newcastle University|86 +University of Northampton|87 +Northumbria University|88 +University of Nottingham|89 +Nottingham Trent University|90 +The Open University|91 +University of Oxford|92 +Oxford Brookes University|93 +Peninsula College of Medicine and Dentistry|94 +University of Plymouth|95 +University of Portsmouth|96 +Queen's University Belfast|97 +Queen Margaret University|98 +Queen Mary, University of London|99 +University of Reading|100 +The Robert Gordon University, Aberdeen|101 +Roehampton University|102 +Royal Academy of Music|103 +Royal College of Art|104 +Royal Holloway, University of London|105 +Royal Veterinary College|106 +University of St Andrews|107 +St George's, University of London|108 +University of Salford|109 +School of Advanced Study, University of London|110 +School of Oriental and African Studies|111 +School of Pharmacy, University of London|112 +University of Sheffield|113 +Sheffield Hallam University|114 +University of Southampton|115 +Southampton Solent University|116 +Staffordshire University|117 +University of Stirling|118 +University of Strathclyde|119 +University of Sunderland|120 +University of Surrey|121 +University of Sussex|122 +Swansea Metropolitan University|123 +Swansea University|124 +University of Teesside|125 +Thames Valley University|126 +University of Ulster|127 +University College London|128 +University of Wales|129 +University of Wales Institute, Cardiff|130 +University of Wales, Newport|131 +University of Wales, Trinity Saint David|132 +University of Warwick|133 +University of Westminster|134 +University of the West of England|135 +University of the West of Scotland|136 +University of Winchester|137 +University of Wolverhampton|138 +University of Worcester|139 +University of York|140 +York St John University|141 diff -r be1bccc405d9 -r b46db3a8b1b4 db/seeds.rb --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/db/seeds.rb Thu Feb 03 15:15:30 2011 +0000 @@ -0,0 +1,27 @@ +# This file should contain all the record creation needed to seed the database with its default values. +# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup). +# +# Examples: +# +# cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }]) +# Major.create(:name => 'Daley', :city => cities.first) + +def truncate_table(table_name) + quoted = connection.quote_table_name(table_name) + connection.execute("TRUNCATE #{quoted}") +end + +def connection + ActiveRecord::Base.connection +end + +truncate_table('institutions') + +open("db/seed_data/institutions.txt") do |institutions| + institutions.read.each_line do |institution| + inst=institution.split('|') + + + Institution.create(:name => inst[0].chomp, :order => inst[1].chomp) + end +end \ No newline at end of file diff -r be1bccc405d9 -r b46db3a8b1b4 public/javascripts/application.js --- a/public/javascripts/application.js Wed Feb 02 12:12:47 2011 +0000 +++ b/public/javascripts/application.js Thu Feb 03 15:15:30 2011 +0000 @@ -239,3 +239,7 @@ } Event.observe(window, 'load', hideOnLoad); + + + + diff -r be1bccc405d9 -r b46db3a8b1b4 public/javascripts/ssamr_institutions.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/public/javascripts/ssamr_institutions.js Thu Feb 03 15:15:30 2011 +0000 @@ -0,0 +1,26 @@ + + +/* SSAMR specific functions */ + +/* institution related functions */ +Event.observe(window, 'load', + function() { + $('ssamr_user_details_institution_type_true').observe('click', function(e, el) { + $('ssamr_user_details_other_institution').disable(); + $('ssamr_user_details_institution_id').enable(); + }); + + $('ssamr_user_details_institution_type_false').observe('click', function(e, el) { + $('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 be1bccc405d9 -r b46db3a8b1b4 public/javascripts/ssamr_registration.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/public/javascripts/ssamr_registration.js Thu Feb 03 15:15:30 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; +} +); + + + diff -r be1bccc405d9 -r b46db3a8b1b4 test/fixtures/institutions.yml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/fixtures/institutions.yml Thu Feb 03 15:15:30 2011 +0000 @@ -0,0 +1,7 @@ +# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html + +one: + name: MyString + +two: + name: MyString diff -r be1bccc405d9 -r b46db3a8b1b4 test/unit/institution_test.rb --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/unit/institution_test.rb Thu Feb 03 15:15:30 2011 +0000 @@ -0,0 +1,8 @@ +require 'test_helper' + +class InstitutionTest < ActiveSupport::TestCase + # Replace this with your real tests. + test "the truth" do + assert true + end +end