2020-05-19 09:02:56 +00:00
|
|
|
import App from '../../base'
|
2018-11-05 10:06:39 +00:00
|
|
|
|
2021-04-14 13:17:21 +00:00
|
|
|
export default App.controller(
|
|
|
|
'LeftHandMenuPromoController',
|
|
|
|
function ($scope, UserAffiliationsDataService, eventTracking) {
|
|
|
|
$scope.hasProjects = window.data.projects.length > 0
|
|
|
|
$scope.userHasNoSubscription = window.userHasNoSubscription
|
2020-02-03 14:11:36 +00:00
|
|
|
|
2021-04-14 13:17:21 +00:00
|
|
|
$scope.upgradeSubscription = function () {
|
|
|
|
eventTracking.send('subscription-funnel', 'project-page', 'upgrade')
|
|
|
|
}
|
2020-02-03 14:11:36 +00:00
|
|
|
|
2021-04-14 13:17:21 +00:00
|
|
|
$scope.share = function () {
|
|
|
|
eventTracking.send('subscription-funnel', 'project-page', 'sharing')
|
|
|
|
}
|
2018-11-05 10:06:39 +00:00
|
|
|
|
2021-04-14 13:17:21 +00:00
|
|
|
const _userHasNoAffiliation = function () {
|
|
|
|
$scope.withAffiliations = window.data.userAffiliations.length > 0
|
|
|
|
$scope.userOnPayingUniversity = window.data.userAffiliations.some(
|
|
|
|
affiliation => affiliation.licence && affiliation.licence !== 'free'
|
|
|
|
)
|
|
|
|
}
|
2020-05-19 09:02:56 +00:00
|
|
|
|
2021-04-14 13:17:21 +00:00
|
|
|
_userHasNoAffiliation()
|
|
|
|
}
|
|
|
|
)
|