mirror of
https://github.com/sismics/docs.git
synced 2025-12-22 06:01:42 +00:00
Closes #309: store onboarding status server side
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
/**
|
||||
* Document default controller.
|
||||
*/
|
||||
angular.module('docs').controller('DocumentDefault', function ($scope, $rootScope, $state, Restangular, Upload, $translate, $uibModal, $dialog) {
|
||||
angular.module('docs').controller('DocumentDefault', function ($scope, $rootScope, $state, Restangular, Upload, $translate, $uibModal, $dialog, User) {
|
||||
// Load user audit log
|
||||
Restangular.one('auditlog').get().then(function (data) {
|
||||
$scope.logs = data.logs;
|
||||
@@ -145,48 +145,51 @@ angular.module('docs').controller('DocumentDefault', function ($scope, $rootScop
|
||||
|
||||
// Onboarding
|
||||
$translate('onboarding.step1.title').then(function () {
|
||||
if (localStorage.onboardingDisplayed || $(window).width() < 1000) {
|
||||
return;
|
||||
}
|
||||
localStorage.onboardingDisplayed = true;
|
||||
|
||||
$rootScope.onboardingEnabled = true;
|
||||
|
||||
$rootScope.onboardingSteps = [
|
||||
{
|
||||
title: $translate.instant('onboarding.step1.title'),
|
||||
description: $translate.instant('onboarding.step1.description'),
|
||||
position: 'centered',
|
||||
width: 300
|
||||
},
|
||||
{
|
||||
title: $translate.instant('onboarding.step2.title'),
|
||||
description: $translate.instant('onboarding.step2.description'),
|
||||
attachTo: '#document-add-btn',
|
||||
position: 'right',
|
||||
width: 300
|
||||
},
|
||||
{
|
||||
title: $translate.instant('onboarding.step3.title'),
|
||||
description: $translate.instant('onboarding.step3.description'),
|
||||
attachTo: '#quick-upload-zone',
|
||||
position: 'left',
|
||||
width: 300
|
||||
},
|
||||
{
|
||||
title: $translate.instant('onboarding.step4.title'),
|
||||
description: $translate.instant('onboarding.step4.description'),
|
||||
attachTo: '#search-box',
|
||||
position: 'right',
|
||||
width: 300
|
||||
},
|
||||
{
|
||||
title: $translate.instant('onboarding.step5.title'),
|
||||
description: $translate.instant('onboarding.step5.description'),
|
||||
attachTo: '#navigation-tag',
|
||||
position: "right",
|
||||
width: 300
|
||||
User.userInfo().then(function(userData) {
|
||||
if (!userData.onboarding || $(window).width() < 1000) {
|
||||
return;
|
||||
}
|
||||
];
|
||||
Restangular.one('user').post('onboarded');
|
||||
$rootScope.userInfo.onboarding = false;
|
||||
|
||||
$rootScope.onboardingEnabled = true;
|
||||
|
||||
$rootScope.onboardingSteps = [
|
||||
{
|
||||
title: $translate.instant('onboarding.step1.title'),
|
||||
description: $translate.instant('onboarding.step1.description'),
|
||||
position: 'centered',
|
||||
width: 300
|
||||
},
|
||||
{
|
||||
title: $translate.instant('onboarding.step2.title'),
|
||||
description: $translate.instant('onboarding.step2.description'),
|
||||
attachTo: '#document-add-btn',
|
||||
position: 'right',
|
||||
width: 300
|
||||
},
|
||||
{
|
||||
title: $translate.instant('onboarding.step3.title'),
|
||||
description: $translate.instant('onboarding.step3.description'),
|
||||
attachTo: '#quick-upload-zone',
|
||||
position: 'left',
|
||||
width: 300
|
||||
},
|
||||
{
|
||||
title: $translate.instant('onboarding.step4.title'),
|
||||
description: $translate.instant('onboarding.step4.description'),
|
||||
attachTo: '#search-box',
|
||||
position: 'right',
|
||||
width: 300
|
||||
},
|
||||
{
|
||||
title: $translate.instant('onboarding.step5.title'),
|
||||
description: $translate.instant('onboarding.step5.description'),
|
||||
attachTo: '#navigation-tag',
|
||||
position: "right",
|
||||
width: 300
|
||||
}
|
||||
];
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user