From e1c8dc943e682fd1df36c874fa0a734bf294f5fa Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Tue, 17 Jun 2014 14:36:17 +0100 Subject: [PATCH 1/2] added defaults of empty string into user profile, also changed account -> profile in message --- services/web/app/views/project/list.jade | 2 +- services/web/public/coffee/UserDetailsUpdater.coffee | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/services/web/app/views/project/list.jade b/services/web/app/views/project/list.jade index 32cd9648a5..1e44e12c2f 100644 --- a/services/web/app/views/project/list.jade +++ b/services/web/app/views/project/list.jade @@ -108,7 +108,7 @@ block content div(ng-show="percentComplete >= 100") h4 100% complete, well done! div(ng-hide="percentComplete >= 100") - h4 Your account is + h4 Your profile is strong {{percentComplete}}% | complete diff --git a/services/web/public/coffee/UserDetailsUpdater.coffee b/services/web/public/coffee/UserDetailsUpdater.coffee index 5a7db1db07..d29859b444 100644 --- a/services/web/public/coffee/UserDetailsUpdater.coffee +++ b/services/web/public/coffee/UserDetailsUpdater.coffee @@ -20,10 +20,10 @@ define ["libs/algolia", "libs/angular", "libs/angular-autocomplete/angular-autoc $http.get("/user/personal_info").success (data)-> $scope.userInfoForm = - first_name: data.first_name - last_name: data.last_name - role: data.role - institution: data.institution + first_name: data.first_name || "" + last_name: data.last_name || "" + role: data.role || "" + institution: data.institution || "" _csrf : window.csrfToken if getPercentComplete() != 100 @@ -41,7 +41,7 @@ define ["libs/algolia", "libs/angular", "libs/angular-autocomplete/angular-autoc $scope.percentComplete = getPercentComplete() getPercentComplete = -> - results = _.filter $scope.userInfoForm, (value)-> value? and value?.length != 0 + results = _.filter $scope.userInfoForm, (value)-> !value? or value?.length != 0 results.length * 20 $scope.updateInstitutionsList = (inputVal)-> From 92d1d4ca1a3a0edf14c2122e90510c9292dbf96a Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Tue, 17 Jun 2014 14:44:24 +0100 Subject: [PATCH 2/2] remove muted from institution auto complete as some browsers are inserting it to the input value --- services/web/public/coffee/UserDetailsUpdater.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/web/public/coffee/UserDetailsUpdater.coffee b/services/web/public/coffee/UserDetailsUpdater.coffee index d29859b444..e16981f7bf 100644 --- a/services/web/public/coffee/UserDetailsUpdater.coffee +++ b/services/web/public/coffee/UserDetailsUpdater.coffee @@ -53,7 +53,7 @@ define ["libs/algolia", "libs/angular", "libs/angular-autocomplete/angular-autoc Institutions.search $scope.userInfoForm.institution, (err, response)-> $scope.institutions = _.map response.hits, (institution)-> - "#{institution.name} (#{institution.domain})" + "#{institution.name} (#{institution.domain})"