From 99b5f408be0aee9b553c852080bf6a87cbe3b5f1 Mon Sep 17 00:00:00 2001 From: Struan Donald Date: Thu, 3 Apr 2014 11:19:19 +0100 Subject: Need to confirm title on password screen as well Yet another place where we confirm the name and hence need to confirm the title if required --- src/js/views/submit.js | 10 ++++++++++ src/templates/en/submit_password.html | 8 ++++++++ 2 files changed, 18 insertions(+) (limited to 'src') diff --git a/src/js/views/submit.js b/src/js/views/submit.js index 647edec..6a7c946 100644 --- a/src/js/views/submit.js +++ b/src/js/views/submit.js @@ -336,6 +336,13 @@ this.validationError('form_password', FMS.validationStrings.password ); } + if ( $('#form_name').val() && this.model.get('titles_list') && this.model.get('titles_list').length > 0 ) { + if ( $('#form_title').val() === '' ) { + this.validationError('form_title', FMS.strings.required); + isValid = 0; + } + } + return isValid; }, @@ -350,6 +357,9 @@ this.model.set('may_show_name', $('#form_may_show_name').is(':checked')); FMS.currentUser.set('name', $('#form_name').val()); FMS.currentUser.set('may_show_name', $('#form_may_show_name').is(':checked')); + if ( this.model.get('titles_list') && this.model.get('titles_list').length > 0 ) { + FMS.currentUser.set('title', $('#form_title').val()); + } FMS.currentUser.save(); } else { // if this is set then we are registering a password diff --git a/src/templates/en/submit_password.html b/src/templates/en/submit_password.html index c2708da..fb61d20 100644 --- a/src/templates/en/submit_password.html +++ b/src/templates/en/submit_password.html @@ -21,6 +21,14 @@ Please confirm your name, if you want it to be public and optionally your phone number.

+ <% if ( typeof model.titles_list !== 'undefined' ) { %> +
+ +
+ <% } %>
-- cgit v1.2.3