"
- s << textilizable(project.short_description, :project => project)
- s << "
"
- end
-
- s << "
"
-
- u = project.users_by_role
- if u
- u.keys.each do |r|
- if r.allowed_to?(:edit_project)
- mgrs = []
- u[r].sort.each do |m|
- mgrs << link_to_user(m)
- end
- if mgrs.size < 3
- s << '' << mgrs.join(', ') << ''
- else
- s << mgrs.join(', ')
- end
- end
- end
- end
-
- s << "
"
- s << "
" << format_date(project.created_on) << "
"
- s << "
" << format_date(project.updated_on) << "
"
-
- s << "
"
-
- ancestors << project
+ s << render_project_in_table(project, cycle('odd', 'even'), 0)
end
s << "
"
@@ -241,6 +184,58 @@
end
+ def render_project_in_table(project, oddeven, level)
+
+ # set the project environment to please macros.
+ @project = project
+
+ classes = (level == 0 ? 'root' : 'child')
+
+ s = ""
+
+ s << "
"
+ s << textilizable(project.short_description, :project => project)
+ s << "
"
+ end
+
+ s << "
"
+
+ u = project.users_by_role
+ if u
+ u.keys.each do |r|
+ if r.allowed_to?(:edit_project)
+ mgrs = []
+ u[r].sort.each do |m|
+ mgrs << link_to_user(m)
+ end
+ if mgrs.size < 3
+ s << '' << mgrs.join(', ') << ''
+ else
+ s << mgrs.join(', ')
+ end
+ end
+ end
+ end
+
+ s << "
"
+ s << "
" << format_date(project.created_on) << "
"
+ s << "
" << format_date(project.updated_on) << "
"
+
+ s << "
"
+
+ project.children.each do |child|
+ s << render_project_in_table(child, oddeven, level + 1)
+ end
+
+ s
+ end
+
# Returns a set of options for a select field, grouped by project.
def version_options_for_select(versions, selected=nil)
diff -r df89e7aa3ce8 -r 497c5985af72 app/models/institution.rb
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/app/models/institution.rb Thu Feb 17 19:47:09 2011 +0000
@@ -0,0 +1,2 @@
+class Institution < ActiveRecord::Base
+end
diff -r df89e7aa3ce8 -r 497c5985af72 app/models/project.rb
--- a/app/models/project.rb Thu Feb 17 19:46:11 2011 +0000
+++ b/app/models/project.rb Thu Feb 17 19:47:09 2011 +0000
@@ -83,6 +83,7 @@
named_scope :active, { :conditions => "#{Project.table_name}.status = #{STATUS_ACTIVE}"}
named_scope :all_public, { :conditions => { :is_public => true } }
named_scope :visible, lambda { { :conditions => Project.visible_by(User.current) } }
+ named_scope :visible_roots, lambda { { :conditions => Project.root_visible_by(User.current) } }
def identifier=(identifier)
super unless identifier_frozen?
@@ -114,6 +115,10 @@
end
end
+ def self.root_visible_by(user=nil)
+ return "#{Project.table_name}.parent_id IS NULL AND " + visible_by(user)
+ end
+
def self.allowed_to_condition(user, permission, options={})
statements = []
base_statement = "#{Project.table_name}.status=#{Project::STATUS_ACTIVE}"
diff -r df89e7aa3ce8 -r 497c5985af72 app/models/ssamr_user_detail.rb
--- a/app/models/ssamr_user_detail.rb Thu Feb 17 19:46:11 2011 +0000
+++ b/app/models/ssamr_user_detail.rb Thu Feb 17 19:47:09 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 df89e7aa3ce8 -r 497c5985af72 app/models/user.rb
--- a/app/models/user.rb Thu Feb 17 19:46:11 2011 +0000
+++ b/app/models/user.rb Thu Feb 17 19:47:09 2011 +0000
@@ -79,6 +79,8 @@
validates_length_of :mail, :maximum => 60, :allow_nil => true
validates_confirmation_of :password, :allow_nil => true
+ validates_acceptance_of :terms_and_conditions, :on => :create, :message => :must_accept_terms_and_conditions
+
def before_create
self.mail_notification = Setting.default_notification_option if self.mail_notification.blank?
true
diff -r df89e7aa3ce8 -r 497c5985af72 app/views/account/register.rhtml
--- a/app/views/account/register.rhtml Thu Feb 17 19:46:11 2011 +0000
+++ b/app/views/account/register.rhtml Thu Feb 17 19:47:09 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? %>
+ <% end %>
diff -r df89e7aa3ce8 -r 497c5985af72 app/views/users/show.rhtml
--- a/app/views/users/show.rhtml Thu Feb 17 19:46:11 2011 +0000
+++ b/app/views/users/show.rhtml Thu Feb 17 19:47:09 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 df89e7aa3ce8 -r 497c5985af72 config/locales/en-GB.yml
--- a/config/locales/en-GB.yml Thu Feb 17 19:46:11 2011 +0000
+++ b/config/locales/en-GB.yml Thu Feb 17 19:47:09 2011 +0000
@@ -123,6 +123,7 @@
not_same_project: "doesn't belong to the same project"
circular_dependency: "This relation would create a circular dependency"
cant_link_an_issue_with_a_descendant: "An issue can not be linked to one of its subtasks"
+ must_accept_terms_and_conditions: "You must accept the Terms and Conditions"
actionview_instancetag_blank_option: Please select
@@ -199,6 +200,10 @@
field_ssamr_user_detail:
description: User Description
+ institution: Institution
+
+ field_other_institution: ''
+
field_name: Name
field_description: Description
field_summary: Summary
@@ -379,8 +384,8 @@
permission_comment_news: Comment news
permission_manage_documents: Manage documents
permission_view_documents: View documents
- permission_manage_files: Manage files
- permission_view_files: View files
+ permission_manage_files: Manage downloads
+ permission_view_files: View downloads
permission_manage_wiki: Manage wiki
permission_rename_wiki_pages: Rename wiki pages
permission_delete_wiki_pages: Delete wiki pages
@@ -416,9 +421,11 @@
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
label_user: User
label_user_plural: Users
label_user_new: New user
@@ -427,7 +434,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
@@ -518,7 +525,7 @@
label_attachment: File
label_attachment_new: New file
label_attachment_delete: Delete file
- label_attachment_plural: Files
+ label_attachment_plural: Downloads
label_file_added: File added
label_report: Report
label_report_plural: Reports
@@ -718,7 +725,7 @@
label_updated_time_by: "Updated by {{author}} {{age}} ago"
label_updated_time: "Updated {{value}} ago"
label_jump_to_a_project: Jump to a project...
- label_file_plural: Files
+ label_file_plural: Downloads
label_changeset_plural: Changesets
label_default_columns: Default columns
label_no_change_option: (No change)
@@ -849,7 +856,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 df89e7aa3ce8 -r 497c5985af72 config/locales/en.yml
--- a/config/locales/en.yml Thu Feb 17 19:46:11 2011 +0000
+++ b/config/locales/en.yml Thu Feb 17 19:47:09 2011 +0000
@@ -86,7 +86,6 @@
gb: "GB"
tb: "TB"
-
# Used in array.to_sentence.
support:
array:
@@ -120,6 +119,7 @@
not_same_project: "doesn't belong to the same project"
circular_dependency: "This relation would create a circular dependency"
cant_link_an_issue_with_a_descendant: "An issue can not be linked to one of its subtasks"
+ must_accept_terms_and_conditions: "You must accept the Terms and Conditions"
actionview_instancetag_blank_option: Please select
@@ -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
@@ -304,6 +308,8 @@
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
@@ -393,8 +399,8 @@
permission_comment_news: Comment news
permission_manage_documents: Manage documents
permission_view_documents: View documents
- permission_manage_files: Manage files
- permission_view_files: View files
+ permission_manage_files: Manage Downloads
+ permission_view_files: View Downloads
permission_manage_wiki: Manage wiki
permission_rename_wiki_pages: Rename wiki pages
permission_delete_wiki_pages: Delete wiki pages
@@ -428,9 +434,9 @@
project_module_calendar: Calendar
project_module_gantt: Gantt chart
project_module_embedded: Embedded documentation (Javadoc or Doxygen)
-
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
@@ -439,7 +445,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
@@ -531,7 +537,7 @@
label_attachment: File
label_attachment_new: New file
label_attachment_delete: Delete file
- label_attachment_plural: Files
+ label_attachment_plural: Downloads
label_file_added: File added
label_report: Report
label_report_plural: Reports
@@ -732,7 +738,7 @@
label_updated_time_by: "Updated by {{author}} {{age}} ago"
label_updated_time: "Updated {{value}} ago"
label_jump_to_a_project: Jump to a project...
- label_file_plural: Files
+ label_file_plural: Downloads
label_changeset_plural: Changesets
label_default_columns: Default columns
label_no_change_option: (No change)
@@ -873,7 +879,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 df89e7aa3ce8 -r 497c5985af72 console/db/seeds.rb
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/console/db/seeds.rb Thu Feb 17 19:47:09 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 df89e7aa3ce8 -r 497c5985af72 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 17 19:47:09 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 df89e7aa3ce8 -r 497c5985af72 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 17 19:47:09 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 df89e7aa3ce8 -r 497c5985af72 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 17 19:47:09 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 df89e7aa3ce8 -r 497c5985af72 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 17 19:47:09 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 df89e7aa3ce8 -r 497c5985af72 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 17 19:47:09 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 df89e7aa3ce8 -r 497c5985af72 db/seed_data/institutions.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/db/seed_data/institutions.txt Thu Feb 17 19:47:09 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 df89e7aa3ce8 -r 497c5985af72 db/seeds.rb
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/db/seeds.rb Thu Feb 17 19:47:09 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 df89e7aa3ce8 -r 497c5985af72 extra/soundsoftware/SoundSoftware.pm
--- a/extra/soundsoftware/SoundSoftware.pm Thu Feb 17 19:46:11 2011 +0000
+++ b/extra/soundsoftware/SoundSoftware.pm Thu Feb 17 19:47:09 2011 +0000
@@ -160,7 +160,7 @@
sub access_handler {
my $r = shift;
- print STDERR "SoundSoftware.pm: In access handler\n";
+ print STDERR "SoundSoftware.pm: In access handler at " . scalar localtime() . "\n";
unless ($r->some_auth_required) {
$r->log_reason("No authentication has been configured");
@@ -178,6 +178,13 @@
}
my $dbh = connect_database($r);
+ unless ($dbh) {
+ print STDERR "SoundSoftware.pm: Database connection failed!: " . $DBI::errstr . "\n";
+ return FORBIDDEN;
+ }
+
+
+print STDERR "Connected to db, dbh is " . $dbh . "\n";
my $project_id = get_project_identifier($dbh, $r);
my $status = get_project_status($dbh, $project_id, $r);
@@ -201,9 +208,13 @@
sub authen_handler {
my $r = shift;
- print STDERR "SoundSoftware.pm: In authentication handler\n";
+ print STDERR "SoundSoftware.pm: In authentication handler at " . scalar localtime() . "\n";
my $dbh = connect_database($r);
+ unless ($dbh) {
+ print STDERR "SoundSoftware.pm: Database connection failed!: " . $DBI::errstr . "\n";
+ return AUTH_REQUIRED;
+ }
my $project_id = get_project_identifier($dbh, $r);
my $realm = get_realm($dbh, $project_id, $r);
@@ -415,8 +426,8 @@
(__PACKAGE__, $r->server, $r->per_dir_config);
return DBI->connect($cfg->{SoundSoftwareDSN},
- $cfg->{SoundSoftwareDbUser},
- $cfg->{SoundSoftwareDbPass});
+ $cfg->{SoundSoftwareDbUser},
+ $cfg->{SoundSoftwareDbPass});
}
1;
diff -r df89e7aa3ce8 -r 497c5985af72 public/javascripts/application.js
--- a/public/javascripts/application.js Thu Feb 17 19:46:11 2011 +0000
+++ b/public/javascripts/application.js Thu Feb 17 19:47:09 2011 +0000
@@ -239,3 +239,7 @@
}
Event.observe(window, 'load', hideOnLoad);
+
+
+
+
diff -r df89e7aa3ce8 -r 497c5985af72 public/javascripts/ssamr_institutions.js
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/public/javascripts/ssamr_institutions.js Thu Feb 17 19:47:09 2011 +0000
@@ -0,0 +1,32 @@
+
+
+/* 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();
+ else {
+ $('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 df89e7aa3ce8 -r 497c5985af72 public/javascripts/ssamr_registration.js
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/public/javascripts/ssamr_registration.js Thu Feb 17 19:47:09 2011 +0000
@@ -0,0 +1,19 @@
+
+
+/* SSAMR specific functions */
+
+/* institution related functions */
+Event.observe(window, 'load',
+ 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;
+ }
+ }
+);
+
+
+
diff -r df89e7aa3ce8 -r 497c5985af72 test/fixtures/institutions.yml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/fixtures/institutions.yml Thu Feb 17 19:47:09 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 df89e7aa3ce8 -r 497c5985af72 test/unit/institution_test.rb
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/unit/institution_test.rb Thu Feb 17 19:47:09 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