From dbbf306bf2fdeaf02c4368ff114100b9568e4d0c Mon Sep 17 00:00:00 2001 From: Sylvain Date: Mon, 15 Jun 2020 15:43:28 +0200 Subject: [PATCH] complete features-tour for projects page --- .../javascripts/controllers/admin/projects.js | 19 +++++++++++++++++-- .../templates/admin/projects/index.html.erb | 10 +++++----- config/locales/app.admin.en.yml | 3 +++ config/locales/app.admin.fr.yml | 3 +++ 4 files changed, 28 insertions(+), 7 deletions(-) diff --git a/app/assets/javascripts/controllers/admin/projects.js b/app/assets/javascripts/controllers/admin/projects.js index f306a913f..fd75f957d 100644 --- a/app/assets/javascripts/controllers/admin/projects.js +++ b/app/assets/javascripts/controllers/admin/projects.js @@ -26,6 +26,9 @@ Application.Controllers.controller('AdminProjectsController', ['$scope', '$state // Application settings $scope.allSettings = settingsPromise; + // default tab: materials + $scope.tabs = { active: 0 }; + /** * Saves a new component / Update an existing material to the server (form validation callback) * @param data {Object} component name @@ -168,7 +171,6 @@ Application.Controllers.controller('AdminProjectsController', ['$scope', '$state } }; - /** * For use with 'ng-class', returns the CSS class name for the uploads previews. * The preview may show a placeholder or the content of the file depending on the upload state. @@ -227,15 +229,28 @@ Application.Controllers.controller('AdminProjectsController', ['$scope', '$state placement: 'bottom', popupClass: 'shift-left-40' }); + uitour.createStep({ + selector: '.projects .settings-tab', + stepId: 'settings', + order: 2, + title: _t('app.admin.tour.projects.settings.title'), + content: _t('app.admin.tour.projects.settings.content'), + placement: 'bottom', + popupClass: 'shift-left-50' + }); uitour.createStep({ selector: 'body', stepId: 'conclusion', - order: 2, + order: 3, title: _t('app.admin.tour.conclusion.title'), content: _t('app.admin.tour.conclusion.content'), placement: 'bottom', orphan: true }); + // on step change, change the active tab if needed + uitour.on('stepChanged', function (nextStep) { + if (nextStep.stepId === 'settings') { $scope.tabs.active = 3; } + }); // on tour end, save the status in database uitour.on('ended', function () { if (uitour.getStatus() === uitour.Status.ON && $scope.currentUser.profile.tours.indexOf('projects') < 0) { diff --git a/app/assets/templates/admin/projects/index.html.erb b/app/assets/templates/admin/projects/index.html.erb index 94346b3cb..7e03eb9cc 100644 --- a/app/assets/templates/admin/projects/index.html.erb +++ b/app/assets/templates/admin/projects/index.html.erb @@ -29,17 +29,17 @@
- - + + '"> - + '"> - + '"> - + '"> diff --git a/config/locales/app.admin.en.yml b/config/locales/app.admin.en.yml index 18a1947a0..5fe6f3d92 100644 --- a/config/locales/app.admin.en.yml +++ b/config/locales/app.admin.en.yml @@ -1371,6 +1371,9 @@ en: abuses: title: "Manage reports" content: "

Access here the management of reports.

Visitors can signal projects, for example for copyright infringement or for hate speech.

GDPR requires you to delete this reporting data once the required actions have been taken.

" + settings: + title: "Settings" + content: "

Comments, CAD files ... Manage project parameters here

You can also activate OpenLab projects, in order to display the projects shared by other Fab Labs in your gallery.

" statistics: welcome: title: "Statistics" diff --git a/config/locales/app.admin.fr.yml b/config/locales/app.admin.fr.yml index a7671bae2..0c6c84d5e 100644 --- a/config/locales/app.admin.fr.yml +++ b/config/locales/app.admin.fr.yml @@ -1371,6 +1371,9 @@ fr: abuses: title: "Gérer les signalements" content: "

Accédez par ici à la gestion des signalements.

Des visiteurs peuvent effectuer des signalements sur les projets, par exemple pour une atteinte au droit d'auteur ou pour un texte incitant à la haine.

La RGPD vous impose de supprimer ces données de signalement une fois que les actions requises ont été effectuées.

" + settings: + title: "Paramètres" + content: "

Commentaires, fichiers CAO... Gérez ici les paramètres des projets

Vous pourrez également activer les projets OpenLab, afin d'afficher les projets partagés par d'autre Fab Labs dans votre galerie.

" statistics: welcome: title: "Statistiques"