2015-11-23 15:12:17 +00:00
|
|
|
define [
|
|
|
|
"base"
|
|
|
|
], (App) ->
|
|
|
|
|
2018-09-18 12:06:26 +00:00
|
|
|
App.controller 'LeftHandMenuPromoController', ($scope, UserAffiliationsDataService) ->
|
2016-06-21 12:28:08 +00:00
|
|
|
|
2015-11-23 15:12:17 +00:00
|
|
|
$scope.hasProjects = window.data.projects.length > 0
|
2016-07-19 10:37:58 +00:00
|
|
|
$scope.userHasNoSubscription = window.userHasNoSubscription
|
2016-11-29 14:38:25 +00:00
|
|
|
|
2018-09-18 12:06:26 +00:00
|
|
|
_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()
|