mirror of
https://github.com/overleaf/overleaf.git
synced 2025-01-28 23:02:23 +00:00
Merge pull request #915 from sharelatex/hb-affiliation-cta
Replace profile completion CTA with affiliations CTA
This commit is contained in:
commit
78ad6e7e5c
2 changed files with 18 additions and 13 deletions
|
@ -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
|
||||||
|
|
|
@ -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()
|
||||||
|
|
Loading…
Reference in a new issue