From 8b5a1cd20f763b1eba7f1e4f9510fed5b7d4a849 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Mon, 29 Sep 2014 16:59:03 -0400 Subject: [PATCH] Migrate `tosAccepted` to new user fields --- .../discourse/controllers/create-account.js.es6 | 8 +------- .../templates/components/user-fields/confirm.hbs | 2 +- .../templates/components/user-fields/text.hbs | 2 +- .../discourse/templates/modal/create-account.hbs | 8 -------- app/controllers/application_controller.rb | 4 ---- app/models/site_text.rb | 1 - config/locales/server.en.yml | 4 ---- config/site_settings.yml | 3 --- db/migrate/20140929204155_migrate_tos_setting.rb | 16 ++++++++++++++++ 9 files changed, 19 insertions(+), 29 deletions(-) create mode 100644 db/migrate/20140929204155_migrate_tos_setting.rb diff --git a/app/assets/javascripts/discourse/controllers/create-account.js.es6 b/app/assets/javascripts/discourse/controllers/create-account.js.es6 index 56e8aadfa..7d846513b 100644 --- a/app/assets/javascripts/discourse/controllers/create-account.js.es6 +++ b/app/assets/javascripts/discourse/controllers/create-account.js.es6 @@ -14,7 +14,6 @@ export default DiscourseController.extend(ModalFunctionality, { rejectedEmails: Em.A([]), rejectedPasswords: Em.A([]), prefilledUsername: null, - tosAccepted: false, userFields: null, hasAuthOptions: Em.computed.notEmpty('authOptions'), @@ -42,9 +41,6 @@ export default DiscourseController.extend(ModalFunctionality, { }, submitDisabled: function() { - // Even if password is required, we respect the tos setting - if (this.get('tosAcceptRequired') && !this.get('tosAccepted')) return true; - if (!this.get('passwordRequired')) return false; // 3rd party auth if (this.get('formSubmitted')) return true; if (this.get('nameValidation.failed')) return true; @@ -62,7 +58,7 @@ export default DiscourseController.extend(ModalFunctionality, { if (anyEmpty) { return true; } } return false; - }.property('passwordRequired', 'nameValidation.failed', 'emailValidation.failed', 'usernameValidation.failed', 'passwordValidation.failed', 'formSubmitted', 'tosAccepted', 'userFields.@each.value'), + }.property('passwordRequired', 'nameValidation.failed', 'emailValidation.failed', 'usernameValidation.failed', 'passwordValidation.failed', 'formSubmitted', 'userFields.@each.value'), passwordRequired: function() { return this.blank('authOptions.auth_provider'); @@ -343,8 +339,6 @@ export default DiscourseController.extend(ModalFunctionality, { }); }, - tosAcceptRequired: Discourse.computed.setting('tos_accept_required'), - actions: { externalLogin: function(provider) { this.get('controllers.login').send('externalLogin', provider); diff --git a/app/assets/javascripts/discourse/templates/components/user-fields/confirm.hbs b/app/assets/javascripts/discourse/templates/components/user-fields/confirm.hbs index a6164962e..3e300a379 100644 --- a/app/assets/javascripts/discourse/templates/components/user-fields/confirm.hbs +++ b/app/assets/javascripts/discourse/templates/components/user-fields/confirm.hbs @@ -1,3 +1,3 @@ diff --git a/app/assets/javascripts/discourse/templates/components/user-fields/text.hbs b/app/assets/javascripts/discourse/templates/components/user-fields/text.hbs index 10b4461de..6d7234bc6 100644 --- a/app/assets/javascripts/discourse/templates/components/user-fields/text.hbs +++ b/app/assets/javascripts/discourse/templates/components/user-fields/text.hbs @@ -1,4 +1,4 @@ diff --git a/app/assets/javascripts/discourse/templates/modal/create-account.hbs b/app/assets/javascripts/discourse/templates/modal/create-account.hbs index ff5975a5e..05bb8a412 100644 --- a/app/assets/javascripts/discourse/templates/modal/create-account.hbs +++ b/app/assets/javascripts/discourse/templates/modal/create-account.hbs @@ -88,14 +88,6 @@ {{#if showCreateForm}}