diff --git a/cms/templates/signup.html b/cms/templates/signup.html index d3eedc8070..f22e3c7950 100644 --- a/cms/templates/signup.html +++ b/cms/templates/signup.html @@ -10,10 +10,10 @@
-
+
-
-
+ +
@@ -64,17 +64,17 @@ }); } - $('form#enroll_form').submit(function(e) { + $('form#register_form').submit(function(e) { e.preventDefault(); - var submit_data = $('#enroll_form').serialize(); + var submit_data = $('#register_form').serialize(); postJSON('/create_account', submit_data, function(json) { if(json.success) { - $('#enroll').html(json.value); + $('#register').html(json.value); } else { - $('#enroll_error').html(json.value).stop().css("background-color", "#933").animate({ backgroundColor: "#333"}, 2000); + $('#register_error').html(json.value).stop().css("background-color", "#933").animate({ backgroundColor: "#333"}, 2000); } } ); diff --git a/common/djangoapps/student/migrations/0011_auto__chg_field_courseenrollment_user__del_unique_courseenrollment_use.py b/common/djangoapps/student/migrations/0011_auto__chg_field_courseenrollment_user__del_unique_courseenrollment_use.py index 769c08fd29..bb74eed0b4 100644 --- a/common/djangoapps/student/migrations/0011_auto__chg_field_courseenrollment_user__del_unique_courseenrollment_use.py +++ b/common/djangoapps/student/migrations/0011_auto__chg_field_courseenrollment_user__del_unique_courseenrollment_use.py @@ -8,19 +8,22 @@ from django.db import models class Migration(SchemaMigration): def forwards(self, orm): - # Removing unique constraint on 'CourseEnrollment', fields ['user'] - db.delete_unique('student_courseenrollment', ['user_id']) - - - # Changing field 'CourseEnrollment.user' - db.alter_column('student_courseenrollment', 'user_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])) + # This table is dropped in a subsequent migration. This migration was causing problems when using InnoDB, + # so we are just dropping it. + pass + # # Removing unique constraint on 'CourseEnrollment', fields ['user'] + # db.delete_unique('student_courseenrollment', ['user_id']) + # + # + # # Changing field 'CourseEnrollment.user' + # db.alter_column('student_courseenrollment', 'user_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])) def backwards(self, orm): - - # Changing field 'CourseEnrollment.user' - db.alter_column('student_courseenrollment', 'user_id', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['auth.User'], unique=True)) - # Adding unique constraint on 'CourseEnrollment', fields ['user'] - db.create_unique('student_courseenrollment', ['user_id']) + pass + # # Changing field 'CourseEnrollment.user' + # db.alter_column('student_courseenrollment', 'user_id', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['auth.User'], unique=True)) + # # Adding unique constraint on 'CourseEnrollment', fields ['user'] + # db.create_unique('student_courseenrollment', ['user_id']) models = { diff --git a/common/djangoapps/student/migrations/0016_auto__add_field_courseenrollment_date__chg_field_userprofile_country.py b/common/djangoapps/student/migrations/0016_auto__add_field_courseenrollment_date__chg_field_userprofile_country.py new file mode 100644 index 0000000000..38e25db095 --- /dev/null +++ b/common/djangoapps/student/migrations/0016_auto__add_field_courseenrollment_date__chg_field_userprofile_country.py @@ -0,0 +1,142 @@ +# -*- coding: utf-8 -*- +import datetime +from south.db import db +from south.v2 import SchemaMigration +from django.db import models + + +class Migration(SchemaMigration): + + def forwards(self, orm): + # Adding field 'CourseEnrollment.date' + db.add_column('student_courseenrollment', 'date', + self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, null=True, blank=True), + keep_default=False) + + + # Changing field 'UserProfile.country' + db.alter_column('auth_userprofile', 'country', self.gf('django_countries.fields.CountryField')(max_length=2, null=True)) + + def backwards(self, orm): + # Deleting field 'CourseEnrollment.date' + db.delete_column('student_courseenrollment', 'date') + + + # Changing field 'UserProfile.country' + db.alter_column('auth_userprofile', 'country', self.gf('django.db.models.fields.CharField')(max_length=255, null=True)) + + models = { + 'auth.group': { + 'Meta': {'object_name': 'Group'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), + 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) + }, + 'auth.permission': { + 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, + 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) + }, + 'auth.user': { + 'Meta': {'object_name': 'User'}, + 'about': ('django.db.models.fields.TextField', [], {'blank': 'True'}), + 'avatar_type': ('django.db.models.fields.CharField', [], {'default': "'n'", 'max_length': '1'}), + 'bronze': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), + 'consecutive_days_visit_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'blank': 'True'}), + 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + 'display_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), + 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), + 'email_isvalid': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'email_key': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}), + 'email_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '1'}), + 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'gold': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), + 'gravatar': ('django.db.models.fields.CharField', [], {'max_length': '32'}), + 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'ignored_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), + 'interesting_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), + 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'location': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), + 'new_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'questions_per_page': ('django.db.models.fields.SmallIntegerField', [], {'default': '10'}), + 'real_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), + 'reputation': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}), + 'seen_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'show_country': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'silver': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), + 'status': ('django.db.models.fields.CharField', [], {'default': "'w'", 'max_length': '2'}), + 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), + 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}), + 'website': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}) + }, + 'contenttypes.contenttype': { + 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, + 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) + }, + 'student.courseenrollment': { + 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, + 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), + 'date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) + }, + 'student.pendingemailchange': { + 'Meta': {'object_name': 'PendingEmailChange'}, + 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'new_email': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), + 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) + }, + 'student.pendingnamechange': { + 'Meta': {'object_name': 'PendingNameChange'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'new_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), + 'rationale': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}), + 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) + }, + 'student.registration': { + 'Meta': {'object_name': 'Registration', 'db_table': "'auth_registration'"}, + 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) + }, + 'student.userprofile': { + 'Meta': {'object_name': 'UserProfile', 'db_table': "'auth_userprofile'"}, + 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'null': 'True', 'blank': 'True'}), + 'courseware': ('django.db.models.fields.CharField', [], {'default': "'course.xml'", 'max_length': '255', 'blank': 'True'}), + 'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + 'gender': ('django.db.models.fields.CharField', [], {'max_length': '6', 'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'language': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), + 'location': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), + 'mailing_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'meta': ('django.db.models.fields.TextField', [], {'blank': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), + 'occupation': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), + 'telephone_number': ('django.db.models.fields.CharField', [], {'max_length': '25', 'null': 'True', 'blank': 'True'}), + 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile'", 'unique': 'True', 'to': "orm['auth.User']"}) + }, + 'student.usertestgroup': { + 'Meta': {'object_name': 'UserTestGroup'}, + 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), + 'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'db_index': 'True', 'symmetrical': 'False'}) + } + } + + complete_apps = ['student'] \ No newline at end of file diff --git a/common/djangoapps/student/migrations/0017_rename_date_to_created.py b/common/djangoapps/student/migrations/0017_rename_date_to_created.py new file mode 100644 index 0000000000..9b387ed2e9 --- /dev/null +++ b/common/djangoapps/student/migrations/0017_rename_date_to_created.py @@ -0,0 +1,133 @@ +# -*- coding: utf-8 -*- +import datetime +from south.db import db +from south.v2 import SchemaMigration +from django.db import models + + +class Migration(SchemaMigration): + + def forwards(self, orm): + # Rename 'date' field to 'created' + db.rename_column('student_courseenrollment', 'date', 'created') + + def backwards(self, orm): + # Rename 'created' field to 'date' + db.rename_column('student_courseenrollment', 'created', 'date') + + + models = { + 'auth.group': { + 'Meta': {'object_name': 'Group'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), + 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) + }, + 'auth.permission': { + 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, + 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) + }, + 'auth.user': { + 'Meta': {'object_name': 'User'}, + 'about': ('django.db.models.fields.TextField', [], {'blank': 'True'}), + 'avatar_type': ('django.db.models.fields.CharField', [], {'default': "'n'", 'max_length': '1'}), + 'bronze': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), + 'consecutive_days_visit_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'blank': 'True'}), + 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + 'display_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), + 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), + 'email_isvalid': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'email_key': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}), + 'email_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '1'}), + 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'gold': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), + 'gravatar': ('django.db.models.fields.CharField', [], {'max_length': '32'}), + 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'ignored_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), + 'interesting_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), + 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'location': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), + 'new_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'questions_per_page': ('django.db.models.fields.SmallIntegerField', [], {'default': '10'}), + 'real_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), + 'reputation': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}), + 'seen_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'show_country': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'silver': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), + 'status': ('django.db.models.fields.CharField', [], {'default': "'w'", 'max_length': '2'}), + 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), + 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}), + 'website': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}) + }, + 'contenttypes.contenttype': { + 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, + 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) + }, + 'student.courseenrollment': { + 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, + 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), + 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) + }, + 'student.pendingemailchange': { + 'Meta': {'object_name': 'PendingEmailChange'}, + 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'new_email': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), + 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) + }, + 'student.pendingnamechange': { + 'Meta': {'object_name': 'PendingNameChange'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'new_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), + 'rationale': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}), + 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) + }, + 'student.registration': { + 'Meta': {'object_name': 'Registration', 'db_table': "'auth_registration'"}, + 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) + }, + 'student.userprofile': { + 'Meta': {'object_name': 'UserProfile', 'db_table': "'auth_userprofile'"}, + 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'null': 'True', 'blank': 'True'}), + 'courseware': ('django.db.models.fields.CharField', [], {'default': "'course.xml'", 'max_length': '255', 'blank': 'True'}), + 'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + 'gender': ('django.db.models.fields.CharField', [], {'max_length': '6', 'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'language': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), + 'location': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), + 'mailing_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'meta': ('django.db.models.fields.TextField', [], {'blank': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), + 'occupation': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), + 'telephone_number': ('django.db.models.fields.CharField', [], {'max_length': '25', 'null': 'True', 'blank': 'True'}), + 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile'", 'unique': 'True', 'to': "orm['auth.User']"}) + }, + 'student.usertestgroup': { + 'Meta': {'object_name': 'UserTestGroup'}, + 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), + 'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'db_index': 'True', 'symmetrical': 'False'}) + } + } + + complete_apps = ['student'] \ No newline at end of file diff --git a/common/djangoapps/student/migrations/0018_auto.py b/common/djangoapps/student/migrations/0018_auto.py new file mode 100644 index 0000000000..1f91bf9d4a --- /dev/null +++ b/common/djangoapps/student/migrations/0018_auto.py @@ -0,0 +1,134 @@ +# -*- coding: utf-8 -*- +import datetime +from south.db import db +from south.v2 import SchemaMigration +from django.db import models + + +class Migration(SchemaMigration): + + def forwards(self, orm): + # Adding index on 'CourseEnrollment', fields ['created'] + db.create_index('student_courseenrollment', ['created']) + + + def backwards(self, orm): + # Removing index on 'CourseEnrollment', fields ['created'] + db.delete_index('student_courseenrollment', ['created']) + + + models = { + 'auth.group': { + 'Meta': {'object_name': 'Group'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), + 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) + }, + 'auth.permission': { + 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, + 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) + }, + 'auth.user': { + 'Meta': {'object_name': 'User'}, + 'about': ('django.db.models.fields.TextField', [], {'blank': 'True'}), + 'avatar_type': ('django.db.models.fields.CharField', [], {'default': "'n'", 'max_length': '1'}), + 'bronze': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), + 'consecutive_days_visit_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'blank': 'True'}), + 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + 'display_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), + 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), + 'email_isvalid': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'email_key': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}), + 'email_tag_filter_strategy': ('django.db.models.fields.SmallIntegerField', [], {'default': '1'}), + 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'gold': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), + 'gravatar': ('django.db.models.fields.CharField', [], {'max_length': '32'}), + 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'ignored_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), + 'interesting_tags': ('django.db.models.fields.TextField', [], {'blank': 'True'}), + 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'location': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), + 'new_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'questions_per_page': ('django.db.models.fields.SmallIntegerField', [], {'default': '10'}), + 'real_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), + 'reputation': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}), + 'seen_response_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'show_country': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'silver': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}), + 'status': ('django.db.models.fields.CharField', [], {'default': "'w'", 'max_length': '2'}), + 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), + 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}), + 'website': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}) + }, + 'contenttypes.contenttype': { + 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, + 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) + }, + 'student.courseenrollment': { + 'Meta': {'unique_together': "(('user', 'course_id'),)", 'object_name': 'CourseEnrollment'}, + 'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), + 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) + }, + 'student.pendingemailchange': { + 'Meta': {'object_name': 'PendingEmailChange'}, + 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'new_email': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), + 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) + }, + 'student.pendingnamechange': { + 'Meta': {'object_name': 'PendingNameChange'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'new_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), + 'rationale': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}), + 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) + }, + 'student.registration': { + 'Meta': {'object_name': 'Registration', 'db_table': "'auth_registration'"}, + 'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) + }, + 'student.userprofile': { + 'Meta': {'object_name': 'UserProfile', 'db_table': "'auth_userprofile'"}, + 'country': ('django_countries.fields.CountryField', [], {'max_length': '2', 'null': 'True', 'blank': 'True'}), + 'courseware': ('django.db.models.fields.CharField', [], {'default': "'course.xml'", 'max_length': '255', 'blank': 'True'}), + 'date_of_birth': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + 'gender': ('django.db.models.fields.CharField', [], {'max_length': '6', 'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'language': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), + 'location': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), + 'mailing_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'meta': ('django.db.models.fields.TextField', [], {'blank': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}), + 'occupation': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), + 'telephone_number': ('django.db.models.fields.CharField', [], {'max_length': '25', 'null': 'True', 'blank': 'True'}), + 'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'profile'", 'unique': 'True', 'to': "orm['auth.User']"}) + }, + 'student.usertestgroup': { + 'Meta': {'object_name': 'UserTestGroup'}, + 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), + 'users': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'db_index': 'True', 'symmetrical': 'False'}) + } + } + + complete_apps = ['student'] \ No newline at end of file diff --git a/common/djangoapps/student/models.py b/common/djangoapps/student/models.py index bab39f2ad3..f73698c517 100644 --- a/common/djangoapps/student/models.py +++ b/common/djangoapps/student/models.py @@ -112,6 +112,8 @@ class CourseEnrollment(models.Model): user = models.ForeignKey(User) course_id = models.CharField(max_length=255, db_index=True) + created = models.DateTimeField(auto_now_add=True, null=True, db_index=True) + class Meta: unique_together = (('user', 'course_id'), ) diff --git a/common/djangoapps/student/views.py b/common/djangoapps/student/views.py index 8748dec062..038606e556 100644 --- a/common/djangoapps/student/views.py +++ b/common/djangoapps/student/views.py @@ -79,18 +79,16 @@ def index(request): return render_to_response('index.html', {'universities': universities, 'entries': entries}) +def course_from_id(id): + course_loc = CourseDescriptor.id_to_location(id) + return modulestore().get_item(course_loc) @login_required @ensure_csrf_cookie def dashboard(request): - csrf_token = csrf(request)['csrf_token'] user = request.user enrollments = CourseEnrollment.objects.filter(user=user) - def course_from_id(id): - course_loc = CourseDescriptor.id_to_location(id) - return modulestore().get_item(course_loc) - # Build our courses list for the user, but ignore any courses that no longer # exist (because the course IDs have changed). Still, we don't delete those # enrollments, because it could have been a data push snafu. @@ -101,18 +99,80 @@ def dashboard(request): except ItemNotFoundError: log.error("User {0} enrolled in non-existant course {1}" .format(user.username, enrollment.course_id)) + + + message = "" + if not user.is_active: + message = render_to_string('registration/activate_account_notice.html', {'email': user.email}) - context = {'csrf': csrf_token, 'courses': courses} + context = {'courses': courses, 'message' : message} return render_to_response('dashboard.html', context) +def try_change_enrollment(request): + """ + This method calls change_enrollment if the necessary POST + parameters are present, but does not return anything. It + simply logs the result or exception. This is usually + called after a registration or login, as secondary action. + It should not interrupt a successful registration or login. + """ + if 'enrollment_action' in request.POST: + try: + enrollment_output = change_enrollment(request) + # There isn't really a way to display the results to the user, so we just log it + # We expect the enrollment to be a success, and will show up on the dashboard anyway + log.info("Attempted to automatically enroll after login. Results: {0}".format(enrollment_output)) + except Exception, e: + log.exception("Exception automatically enrolling after login: {0}".format(str(e))) + + +@login_required +def change_enrollment_view(request): + return HttpResponse(json.dumps(change_enrollment(request))) + +def change_enrollment(request): + if request.method != "POST": + raise Http404 + + action = request.POST.get("enrollment_action" , "") + user = request.user + course_id = request.POST.get("course_id", None) + if course_id == None: + return HttpResponse(json.dumps({'success': False, 'error': 'There was an error receiving the course id.'})) + + if action == "enroll": + # Make sure the course exists + # We don't do this check on unenroll, or a bad course id can't be unenrolled from + try: + course = course_from_id(course_id) + except ItemNotFoundError: + log.error("User {0} tried to enroll in non-existant course {1}" + .format(user.username, enrollment.course_id)) + return {'success': False, 'error': 'The course requested does not exist.'} + + enrollment, created = CourseEnrollment.objects.get_or_create(user=user, course_id=course.id) + return {'success': True} + + elif action == "unenroll": + try: + enrollment = CourseEnrollment.objects.get(user=user, course_id=course_id) + enrollment.delete() + return {'success': True} + except CourseEnrollment.DoesNotExist: + return {'success': False, 'error': 'You are not enrolled for this course.'} + else: + return {'success': False, 'error': 'Invalid enrollment_action.'} + + return {'success': False, 'error': 'We weren\'t able to unenroll you. Please try again.'} + # Need different levels of logging @ensure_csrf_cookie def login_user(request, error=""): ''' AJAX request to log in the user. ''' if 'email' not in request.POST or 'password' not in request.POST: return HttpResponse(json.dumps({'success': False, - 'error': 'Invalid login'})) # TODO: User error message + 'value': 'There was an error receiving your login information. Please email us.'})) # TODO: User error message email = request.POST['email'] password = request.POST['password'] @@ -121,14 +181,14 @@ def login_user(request, error=""): except User.DoesNotExist: log.warning("Login failed - Unknown user email: {0}".format(email)) return HttpResponse(json.dumps({'success': False, - 'error': 'Invalid login'})) # TODO: User error message + 'value': 'Email or password is incorrect.'})) # TODO: User error message username = user.username user = authenticate(username=username, password=password) if user is None: log.warning("Login failed - password for {0} is invalid".format(email)) return HttpResponse(json.dumps({'success': False, - 'error': 'Invalid login'})) + 'value': 'Email or password is incorrect.'})) if user is not None and user.is_active: try: @@ -143,11 +203,14 @@ def login_user(request, error=""): log.exception(e) log.info("Login success - {0} ({1})".format(username, email)) + + try_change_enrollment(request) + return HttpResponse(json.dumps({'success':True})) log.warning("Login failed - Account not active for user {0}".format(username)) return HttpResponse(json.dumps({'success':False, - 'error': 'Account not active. Check your e-mail.'})) + 'value': 'This account has not been activated. Please check your e-mail for the activation instructions.'})) @ensure_csrf_cookie def logout_user(request): @@ -278,10 +341,17 @@ def create_account(request, post_override=None): log.exception(sys.exc_info()) js['value'] = 'Could not send activation e-mail.' return HttpResponse(json.dumps(js)) - - js={'success': True, - 'value': render_to_string('registration/reg_complete.html', {'email': post_vars['email'], - 'csrf': csrf(request)['csrf_token']})} + + # Immediately after a user creates an account, we log them in. They are only + # logged in until they close the browser. They can't log in again until they click + # the activation link from the email. + login_user = authenticate(username=post_vars['username'], password = post_vars['password'] ) + login(request, login_user) + request.session.set_expiry(0) + + try_change_enrollment(request) + + js={'success': True} return HttpResponse(json.dumps(js), mimetype="application/json") def create_random_account(create_account_function): @@ -311,14 +381,15 @@ def activate_account(request, key): ''' r=Registration.objects.filter(activation_key=key) if len(r)==1: + user_logged_in = request.user.is_authenticated() + already_active = True if not r[0].user.is_active: r[0].activate() - resp = render_to_response("activation_complete.html",{'csrf':csrf(request)['csrf_token']}) - return resp - resp = render_to_response("activation_active.html",{'csrf':csrf(request)['csrf_token']}) + already_active = False + resp = render_to_response("registration/activation_complete.html",{'user_logged_in':user_logged_in, 'already_active' : already_active}) return resp if len(r)==0: - return render_to_response("activation_invalid.html",{'csrf':csrf(request)['csrf_token']}) + return render_to_response("registration/activation_invalid.html",{'csrf':csrf(request)['csrf_token']}) return HttpResponse("Unknown error. Please e-mail us to let us know how it happened.") @ensure_csrf_cookie diff --git a/common/djangoapps/util/cache.py b/common/djangoapps/util/cache.py index e253b5b633..35715946a9 100644 --- a/common/djangoapps/util/cache.py +++ b/common/djangoapps/util/cache.py @@ -38,7 +38,7 @@ def cache_if_anonymous(view_func): @wraps(view_func) def _decorated(request, *args, **kwargs): - if not request.user.is_authenticated(): + if False and not request.user.is_authenticated(): #Use the cache cache_key = "cache_if_anonymous." + request.path response = cache.get(cache_key) diff --git a/lms/djangoapps/courseware/views.py b/lms/djangoapps/courseware/views.py index 07303be06a..d5f24db9d0 100644 --- a/lms/djangoapps/courseware/views.py +++ b/lms/djangoapps/courseware/views.py @@ -1,4 +1,5 @@ from collections import defaultdict +import json import logging import urllib import itertools @@ -8,7 +9,7 @@ from django.core.context_processors import csrf from django.core.urlresolvers import reverse from django.contrib.auth.models import User from django.contrib.auth.decorators import login_required -from django.http import Http404 +from django.http import Http404, HttpResponse from django.shortcuts import redirect from mitxmako.shortcuts import render_to_response, render_to_string #from django.views.decorators.csrf import ensure_csrf_cookie @@ -268,17 +269,7 @@ def course_about(request, course_id): course = check_course(course_id, course_must_be_open=False) registered = registered_for_course(course, request.user) return render_to_response('portal/course_about.html', {'course': course, 'registered': registered}) - - -@login_required -@ensure_csrf_cookie -def enroll(request, course_id): - course = check_course(course_id, course_must_be_open=False) - user = request.user - enrollment, created = CourseEnrollment.objects.get_or_create(user=user, course_id=course.id) - - return redirect(reverse('dashboard')) @ensure_csrf_cookie @@ -295,5 +286,3 @@ def university_profile(request, org_id): template_file = "university_profile/{0}.html".format(org_id).lower() return render_to_response(template_file, context) - - diff --git a/lms/static/.gitignore b/lms/static/.gitignore index 93ba314176..03f1cdabff 100644 --- a/lms/static/.gitignore +++ b/lms/static/.gitignore @@ -4,4 +4,5 @@ *.swp *.orig *.DS_Store -application.css \ No newline at end of file +application.css +ie.css \ No newline at end of file diff --git a/lms/static/js/toggle_login_modal.js b/lms/static/js/toggle_login_modal.js index 4f07f81bb5..663a04453d 100644 --- a/lms/static/js/toggle_login_modal.js +++ b/lms/static/js/toggle_login_modal.js @@ -7,9 +7,11 @@ closeButton: null, position: 'fixed' } - - var overlay = $("
"); - $("body").append(overlay); + + if ($("#lean_overlay").length == 0) { + var overlay = $("
"); + $("body").append(overlay); + } options = $.extend(defaults, options); @@ -51,7 +53,11 @@ $(modal_id).find(".notice").hide().html(""); var notice = $(this).data('notice') if(notice !== undefined) { - $(modal_id).find(".notice").show().html(notice); + $notice = $(modal_id).find(".notice"); + $notice.show().html(notice); + // This is for activating leanModal links that were in the notice. We should have a cleaner way of + // allowing all dynamically added leanmodal links to work. + $notice.find("a[rel*=leanModal]").leanModal({ top : 120, overlay: 1, closeButton: ".close-modal", position: 'absolute' }); } window.scrollTo(0, 0); e.preventDefault(); diff --git a/lms/static/sass/_dashboard.scss b/lms/static/sass/_dashboard.scss index 906c8081c1..a3d21cb1b3 100644 --- a/lms/static/sass/_dashboard.scss +++ b/lms/static/sass/_dashboard.scss @@ -147,7 +147,7 @@ @include clearfix; height: 120px; margin-right: flex-gutter(); - margin-bottom: 25px; + margin-bottom: 10px; overflow: hidden; position: relative; width: flex-grid(12); @@ -383,5 +383,19 @@ } } } + + a.unenroll { + float: right; + font-style: italic; + color: #a0a0a0; + text-decoration: underline; + font-size: .8em; + @include inline-block; + margin-bottom: 40px; + + &:hover { + color: #333; + } + } } } diff --git a/lms/static/sass/sass_old/layout/_leanmodal.scss b/lms/static/sass/sass_old/layout/_leanmodal.scss index 81639493ee..0c96e6524a 100644 --- a/lms/static/sass/sass_old/layout/_leanmodal.scss +++ b/lms/static/sass/sass_old/layout/_leanmodal.scss @@ -84,7 +84,7 @@ div.leanModal_box { form { text-align: left; - div#enroll_error, div#login_error, div#pwd_error { + div#register_error, div#login_error, div#pwd_error { $error-color: #333; background-color: $error-color; border: darken($error-color, 20%); diff --git a/lms/templates/activation_active.html b/lms/templates/activation_active.html deleted file mode 100644 index b3ac51d055..0000000000 --- a/lms/templates/activation_active.html +++ /dev/null @@ -1,14 +0,0 @@ -<%! from django.core.urlresolvers import reverse %> -<%inherit file="main.html" /> - -<%namespace name='static' file='static_content.html'/> - -
- -
-

Account already active!

-
- -

This account has already been activated. You can now login.

-
-
diff --git a/lms/templates/activation_complete.html b/lms/templates/activation_complete.html deleted file mode 100644 index f48e8896b4..0000000000 --- a/lms/templates/activation_complete.html +++ /dev/null @@ -1,14 +0,0 @@ -<%! from django.core.urlresolvers import reverse %> -<%inherit file="main.html" /> - -<%namespace name='static' file='static_content.html'/> - -
- -
-

Activation Complete!

-
- -

Thanks for activating your account. You can now login.

-
-
diff --git a/lms/templates/dashboard.html b/lms/templates/dashboard.html index 9a1784ba8d..676b9587c6 100644 --- a/lms/templates/dashboard.html +++ b/lms/templates/dashboard.html @@ -9,6 +9,11 @@ <%block name="title">Dashboard
+ +
+ ${message} +
+
@@ -48,10 +53,10 @@
${get_course_about_section(course, 'university')} -

${get_course_about_section(course, "title")}

+

${course.number} ${course.title}

-

Class Starts - 9/2/2012

+

Class Starts - ${course.start_date_text}

@@ -61,11 +66,12 @@
-

60% compleat

+ ##

60% complete

+ Unenroll % endfor % else: @@ -77,3 +83,52 @@ + + + + + + + + diff --git a/lms/templates/login.html b/lms/templates/login.html deleted file mode 100644 index 0ab5206073..0000000000 --- a/lms/templates/login.html +++ /dev/null @@ -1,34 +0,0 @@ - -
-
-

Log in to edX

- -
- - -
-
    -
  1. - - -
  2. - -
  3. - - -
  4. - -
  5. - -
  6. - -
- -
- -
- -
-
diff --git a/lms/templates/login_modal.html b/lms/templates/login_modal.html index 28d116c9de..0d23a477f6 100644 --- a/lms/templates/login_modal.html +++ b/lms/templates/login_modal.html @@ -44,9 +44,9 @@ location.href="${reverse('dashboard')}"; } else { if($('#login_error').length == 0) { - $('#login_form').prepend(''); + $('#login_form').prepend(''); } - $('#login_error').stop().css("display", "block"); + $('#login_error').html(json.value).stop().css("display", "block"); } }); })(this) diff --git a/lms/templates/marketing.html b/lms/templates/marketing.html deleted file mode 100644 index a0d53802b5..0000000000 --- a/lms/templates/marketing.html +++ /dev/null @@ -1,178 +0,0 @@ -<%! from django.core.urlresolvers import reverse %> -<%namespace name='static' file='static_content.html'/> - - - - <%block name="title">MITx: MIT's new online learning initiative</%block> - - MITx will offer a portfolio of MIT courses for free to a virtual community of learners around the world" /> - - MITx, online learning, MIT, online laboratory, education, learners, undergraduate, certificate" /> - - - - - - - - - - - - - - - - <%block name="headextra"/> - - - - - - - <%block name="header"> -
"> -
- <%block name="header_nav"> - - - - <%block name="header_text"> -
-

MITx

-

MIT’s new online learning initiative

-
- -
-
- - - ${self.body()} - <%block name="bodyextra"/> - - - - % if settings.COURSEWARE_ENABLED: -
<%include file="login.html" />
- % endif -
<%include file="password_reset_form.html" />
-
- - - - <%block name="js_extra"/> - - diff --git a/lms/templates/portal/course_about.html b/lms/templates/portal/course_about.html index 9498620527..3a33723949 100644 --- a/lms/templates/portal/course_about.html +++ b/lms/templates/portal/course_about.html @@ -25,10 +25,10 @@ %if registered: You are registered for this course (${course.number}). %else: - Register for ${course.number} + Register for ${course.number} %endif %else: - Register for ${course.number} + Register for ${course.number} %endif @@ -107,4 +107,51 @@ +%if not registered: +
+
+
+ + +
+
+ +
+
+
+ %if user.is_authenticated(): + ## If the user is authenticated, clicking the enroll button just submits a form + + %else: + ## If the user is not authenticated, clicking the enroll button pops up the register + ## field. We also slip in the registration fields into the login/register fields so + ## the user is automatically registered after logging in / registering + + %endif +%endif + + <%include file="../video_modal.html" /> diff --git a/lms/templates/registration/activate_account_notice.html b/lms/templates/registration/activate_account_notice.html new file mode 100644 index 0000000000..ca051902b1 --- /dev/null +++ b/lms/templates/registration/activate_account_notice.html @@ -0,0 +1,3 @@ +

Thanks For Registering!

+

Your account is not active yet. An activation link has been sent to ${ email }, along with +instructions for activating your account.

diff --git a/lms/templates/registration/activation_complete.html b/lms/templates/registration/activation_complete.html new file mode 100644 index 0000000000..7d3579b34e --- /dev/null +++ b/lms/templates/registration/activation_complete.html @@ -0,0 +1,30 @@ +<%! from django.core.urlresolvers import reverse %> +<%inherit file="../main.html" /> + +<%namespace name='static' file='../static_content.html'/> + +
+ +
+ %if not already_active: +

Activation Complete!

+ %else: +

Account already active!

+ %endif +
+ +

+ %if not already_active: + Thanks for activating your account. + %else: + This account has already been activated. + %endif + + %if user_logged_in: + Visit your dashboard to see your courses. + %else: + You can now login. + %endif +

+
+
diff --git a/lms/templates/activation_invalid.html b/lms/templates/registration/activation_invalid.html similarity index 86% rename from lms/templates/activation_invalid.html rename to lms/templates/registration/activation_invalid.html index 09832d0df5..09d373a39d 100644 --- a/lms/templates/activation_invalid.html +++ b/lms/templates/registration/activation_invalid.html @@ -1,7 +1,7 @@ <%! from django.core.urlresolvers import reverse %> -<%inherit file="main.html" /> +<%inherit file="../main.html" /> -<%namespace name='static' file='static_content.html'/> +<%namespace name='static' file='../static_content.html'/>
diff --git a/lms/templates/registration/reg_complete.html b/lms/templates/registration/reg_complete.html deleted file mode 100644 index aea7e6df1a..0000000000 --- a/lms/templates/registration/reg_complete.html +++ /dev/null @@ -1,7 +0,0 @@ -
-

Thanks For Registering!

-
-
- -

Please check your email. An activation link has been sent to ${ email }, along with -instructions for activating your account.

diff --git a/lms/templates/signup_modal.html b/lms/templates/signup_modal.html index 4e29b86138..d6b493e1bb 100644 --- a/lms/templates/signup_modal.html +++ b/lms/templates/signup_modal.html @@ -7,16 +7,16 @@