2020-05-19 05:02:56 -04:00
|
|
|
import App from '../../base'
|
2018-11-05 05:06:39 -05:00
|
|
|
|
2021-04-14 09:17:21 -04:00
|
|
|
export default App.controller(
|
|
|
|
'LeftHandMenuPromoController',
|
|
|
|
function ($scope, UserAffiliationsDataService, eventTracking) {
|
|
|
|
$scope.hasProjects = window.data.projects.length > 0
|
|
|
|
$scope.userHasNoSubscription = window.userHasNoSubscription
|
2020-02-03 09:11:36 -05:00
|
|
|
|
2021-04-14 09:17:21 -04:00
|
|
|
$scope.upgradeSubscription = function () {
|
|
|
|
eventTracking.send('subscription-funnel', 'project-page', 'upgrade')
|
2022-04-06 08:33:34 -04:00
|
|
|
eventTracking.sendMB('upgrade-button-click', {
|
|
|
|
source: 'dashboard',
|
|
|
|
})
|
2021-04-14 09:17:21 -04:00
|
|
|
}
|
2020-02-03 09:11:36 -05:00
|
|
|
|
2021-04-14 09:17:21 -04:00
|
|
|
$scope.share = function () {
|
|
|
|
eventTracking.send('subscription-funnel', 'project-page', 'sharing')
|
|
|
|
}
|
2018-11-05 05:06:39 -05:00
|
|
|
|
2021-04-14 09:17:21 -04: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 05:02:56 -04:00
|
|
|
|
2021-04-14 09:17:21 -04:00
|
|
|
_userHasNoAffiliation()
|
|
|
|
}
|
|
|
|
)
|