diff --git a/services/web/app/views/project/list/side-bar.pug b/services/web/app/views/project/list/side-bar.pug index b2c8f11315..067f870294 100644 --- a/services/web/app/views/project/list/side-bar.pug +++ b/services/web/app/views/project/list/side-bar.pug @@ -115,19 +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-show="userEmails.length > 0 && userAffiliations.length == 0", ng-cloak) + hr + .text-centered.user-profile + 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" + ) Add Affiliation .row-spaced(ng-if="hasProjects && userHasNoSubscription", ng-cloak).text-centered hr 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()