Merge pull request #915 from sharelatex/hb-affiliation-cta

Replace profile completion CTA with affiliations CTA
This commit is contained in:
Hugh O'Brien 2018-09-19 11:32:55 +01:00 committed by GitHub
commit 78ad6e7e5c
2 changed files with 18 additions and 13 deletions

View file

@ -115,19 +115,14 @@
span(ng-controller="LeftHandMenuPromoController", ng-cloak) span(ng-controller="LeftHandMenuPromoController", ng-cloak)
.row-spaced#userProfileInformation(ng-if="hasProjects") .row-spaced#userProfileInformation(ng-if="hasProjects")
div(ng-controller="UserProfileController") div(ng-show="userEmails.length > 0 && userAffiliations.length == 0", ng-cloak)
hr(ng-show="percentComplete < 100") hr
.text-centered.user-profile(ng-show="percentComplete < 100") .text-centered.user-profile
.progress p Are you affiliated with an institution?
.progress-bar.progress-bar-info(ng-style="{'width' : (percentComplete+'%')}")
p.small #{translate("profile_complete_percentage", {percentval:"{{percentComplete}}"})}
button#completeUserProfileInformation.btn.btn-info( a.btn.btn-info(
ng-hide="formVisable", href="/user/settings"
ng-click="openUserProfileModal()" ) Add Affiliation
) #{translate("complete")}
.row-spaced(ng-if="hasProjects && userHasNoSubscription", ng-cloak).text-centered .row-spaced(ng-if="hasProjects && userHasNoSubscription", ng-cloak).text-centered
hr hr

View file

@ -2,8 +2,18 @@ define [
"base" "base"
], (App) -> ], (App) ->
App.controller 'LeftHandMenuPromoController', ($scope) -> App.controller 'LeftHandMenuPromoController', ($scope, UserAffiliationsDataService) ->
$scope.hasProjects = window.data.projects.length > 0 $scope.hasProjects = window.data.projects.length > 0
$scope.userHasNoSubscription = window.userHasNoSubscription $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()