From 8697edc1498f0c14fbedc5008632d77131b679d6 Mon Sep 17 00:00:00 2001 From: hugh-obrien Date: Thu, 13 Sep 2018 12:22:27 +0100 Subject: [PATCH 1/3] replace profile completion CTA with affiliationa adding CTA --- .../web/app/views/project/list/side-bar.pug | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/services/web/app/views/project/list/side-bar.pug b/services/web/app/views/project/list/side-bar.pug index b2c8f11315..32868b57c4 100644 --- a/services/web/app/views/project/list/side-bar.pug +++ b/services/web/app/views/project/list/side-bar.pug @@ -115,18 +115,14 @@ span(ng-controller="LeftHandMenuPromoController", ng-cloak) .row-spaced#userProfileInformation(ng-if="hasProjects") - div(ng-controller="UserProfileController") - hr(ng-show="percentComplete < 100") - .text-centered.user-profile(ng-show="percentComplete < 100") - .progress - .progress-bar.progress-bar-info(ng-style="{'width' : (percentComplete+'%')}") - - p.small #{translate("profile_complete_percentage", {percentval:"{{percentComplete}}"})} + div(ng-controller="UserAffiliationsController") + hr(ng-show="userEmails.length == 1 && userEmails[0].affiliations == null") + .text-centered.user-profile(ng-show="userEmails.length == 1 && userEmails[0].affiliations == null") + p Are you affiliated with an institution? - button#completeUserProfileInformation.btn.btn-info( - ng-hide="formVisable", - ng-click="openUserProfileModal()" - ) #{translate("complete")} + a.btn.btn-info( + href="/user/settings" + ) Tell Us .row-spaced(ng-if="hasProjects && userHasNoSubscription", ng-cloak).text-centered From 26defd08331331c0200261712d586a59a81ba93e Mon Sep 17 00:00:00 2001 From: hugh-obrien Date: Thu, 13 Sep 2018 13:54:43 +0100 Subject: [PATCH 2/3] reword CTA --- services/web/app/views/project/list/side-bar.pug | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/web/app/views/project/list/side-bar.pug b/services/web/app/views/project/list/side-bar.pug index 32868b57c4..a35f702de7 100644 --- a/services/web/app/views/project/list/side-bar.pug +++ b/services/web/app/views/project/list/side-bar.pug @@ -122,7 +122,7 @@ a.btn.btn-info( href="/user/settings" - ) Tell Us + ) Add Affiliation .row-spaced(ng-if="hasProjects && userHasNoSubscription", ng-cloak).text-centered From 277225d8de4a01ed723b75e8264e93a4d4d8e7ff Mon Sep 17 00:00:00 2001 From: hugh-obrien Date: Tue, 18 Sep 2018 13:06:26 +0100 Subject: [PATCH 3/3] use existing left sidebar controller for affiliation cta --- services/web/app/views/project/list/side-bar.pug | 7 +++---- .../left-hand-menu-promo-controller.coffee | 12 +++++++++++- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/services/web/app/views/project/list/side-bar.pug b/services/web/app/views/project/list/side-bar.pug index a35f702de7..067f870294 100644 --- a/services/web/app/views/project/list/side-bar.pug +++ b/services/web/app/views/project/list/side-bar.pug @@ -115,16 +115,15 @@ span(ng-controller="LeftHandMenuPromoController", ng-cloak) .row-spaced#userProfileInformation(ng-if="hasProjects") - div(ng-controller="UserAffiliationsController") - hr(ng-show="userEmails.length == 1 && userEmails[0].affiliations == null") - .text-centered.user-profile(ng-show="userEmails.length == 1 && userEmails[0].affiliations == null") + div(ng-show="userEmails.length > 0 && userAffiliations.length == 0", ng-cloak) + hr + .text-centered.user-profile p Are you affiliated with an institution? a.btn.btn-info( href="/user/settings" ) Add Affiliation - .row-spaced(ng-if="hasProjects && userHasNoSubscription", ng-cloak).text-centered hr p.small #{translate("on_free_sl")} diff --git a/services/web/public/coffee/main/project-list/left-hand-menu-promo-controller.coffee b/services/web/public/coffee/main/project-list/left-hand-menu-promo-controller.coffee index 9fdb3e9ca2..5606842a70 100644 --- a/services/web/public/coffee/main/project-list/left-hand-menu-promo-controller.coffee +++ b/services/web/public/coffee/main/project-list/left-hand-menu-promo-controller.coffee @@ -2,8 +2,18 @@ define [ "base" ], (App) -> - App.controller 'LeftHandMenuPromoController', ($scope) -> + App.controller 'LeftHandMenuPromoController', ($scope, UserAffiliationsDataService) -> $scope.hasProjects = window.data.projects.length > 0 $scope.userHasNoSubscription = window.userHasNoSubscription + _userHasNoAffiliation = () -> + $scope.userEmails = [] + $scope.userAffiliations = [] + UserAffiliationsDataService.getUserEmails().then (emails) -> + $scope.userEmails = emails + for email in emails + if email.affiliation + $scope.userAffiliations.push email.affiliation + + _userHasNoAffiliation()