mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
use existing left sidebar controller for affiliation cta
This commit is contained in:
parent
26defd0833
commit
277225d8de
2 changed files with 14 additions and 5 deletions
|
@ -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")}
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue