+ <% 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