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