1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-29 18:52:22 +01:00

improved feature tour for managers

This commit is contained in:
Sylvain 2020-04-29 16:30:39 +02:00
parent 6aa7ba89e8
commit b97ff2ec5b
10 changed files with 108 additions and 30 deletions

View File

@ -582,15 +582,27 @@ Application.Controllers.controller('InvoicesController', ['$scope', '$state', 'I
$scope.setupInvoicesTour = function () {
// get the tour defined by the ui-tour directive
const uitour = uiTourService.getTourByName('invoices');
uitour.createStep({
selector: 'body',
stepId: 'welcome',
order: 0,
title: _t('app.admin.tour.invoices.welcome.title'),
content: _t('app.admin.tour.invoices.welcome.content'),
placement: 'bottom',
orphan: true
});
if (AuthService.isAuthorized('admin')) {
uitour.createStep({
selector: 'body',
stepId: 'welcome',
order: 0,
title: _t('app.admin.tour.invoices.welcome.title'),
content: _t('app.admin.tour.invoices.welcome.content'),
placement: 'bottom',
orphan: true
});
} else {
uitour.createStep({
selector: 'body',
stepId: 'welcome_manager',
order: 0,
title: _t('app.admin.tour.invoices.welcome_manager.title'),
content: _t('app.admin.tour.invoices.welcome_manager.content'),
placement: 'bottom',
orphan: true
});
}
if (!Fablab.withoutInvoices && $scope.invoices.length > 0) {
uitour.createStep({
selector: '.invoices-management .invoices-list',

View File

@ -22,7 +22,7 @@ Application.Controllers.controller('HomeController', ['$scope', '$stateParams',
*/
$scope.setupHomeTour = function () {
if (AuthService.isAuthorized(['admin', 'manager'])) {
// Workaround for the following bug: as a manager, when the feature tour is shown, the translations keys are not
// Workaround for the following bug: sometimes, when the feature tour is shown, the translations keys are not
// interpreted. This is an ugly hack, but we can't do better for now because angular-ui-tour does not support
// removing steps (this would allow us to recreate the steps when the translations are loaded), and we can't use
// promises with _t's translations (this would be a very big refactoring)

View File

@ -222,29 +222,51 @@ Application.Controllers.controller('MachinesController', ['$scope', '$state', '_
if (AuthService.isAuthorized(['admin', 'manager'])) {
// get the tour defined by the ui-tour directive
const uitour = uiTourService.getTourByName('machines');
uitour.createStep({
selector: 'body',
stepId: 'welcome',
order: 0,
title: _t('app.public.tour.machines.welcome.title'),
content: _t('app.public.tour.machines.welcome.content'),
placement: 'bottom',
orphan: true
});
if (AuthService.isAuthorized('admin')) {
uitour.createStep({
selector: 'body',
stepId: 'welcome',
order: 0,
title: _t('app.public.tour.machines.welcome.title'),
content: _t('app.public.tour.machines.welcome.content'),
placement: 'bottom',
orphan: true
});
if ($scope.machines.length > 0) {
uitour.createStep({
selector: '.machines-list .show-button',
stepId: 'view',
order: 1,
title: _t('app.public.tour.machines.view.title'),
content: _t('app.public.tour.machines.view.content'),
placement: 'top'
});
}
} else {
uitour.createStep({
selector: 'body',
stepId: 'welcome_manager',
order: 0,
title: _t('app.public.tour.machines.welcome_manager.title'),
content: _t('app.public.tour.machines.welcome_manager.content'),
placement: 'bottom',
orphan: true
});
}
if ($scope.machines.length > 0) {
uitour.createStep({
selector: '.machines-list .show-button',
stepId: 'view',
order: 1,
title: _t('app.public.tour.machines.view.title'),
content: _t('app.public.tour.machines.view.content'),
selector: '.machines-list .reserve-button',
stepId: 'reserve',
order: 2,
title: _t('app.public.tour.machines.reserve.title'),
content: _t('app.public.tour.machines.reserve.content'),
placement: 'top'
});
}
uitour.createStep({
selector: 'body',
stepId: 'conclusion',
order: 2,
order: 3,
title: _t('app.public.tour.conclusion.title'),
content: _t('app.public.tour.conclusion.content'),
placement: 'bottom',

View File

@ -134,6 +134,7 @@ Application.Controllers.controller('SpacesController', ['$scope', '$state', 'spa
if (AuthService.isAuthorized(['admin', 'manager'])) {
// get the tour defined by the ui-tour directive
const uitour = uiTourService.getTourByName('spaces');
if (AuthService.isAuthorized('admin')) {
uitour.createStep({
selector: 'body',
stepId: 'welcome',
@ -153,10 +154,31 @@ Application.Controllers.controller('SpacesController', ['$scope', '$state', 'spa
placement: 'top'
});
}
} else {
uitour.createStep({
selector: 'body',
stepId: 'welcome_manager',
order: 0,
title: _t('app.public.tour.spaces.welcome_manager.title'),
content: _t('app.public.tour.spaces.welcome_manager.content'),
placement: 'bottom',
orphan: true
});
}
if ($scope.spaces.length > 0) {
uitour.createStep({
selector: '.spaces-list .reserve-button',
stepId: 'reserve',
order: 2,
title: _t('app.public.tour.spaces.reserve.title'),
content: _t('app.public.tour.spaces.reserve.content'),
placement: 'top'
});
}
uitour.createStep({
selector: 'body',
stepId: 'conclusion',
order: 2,
order: 3,
title: _t('app.public.tour.conclusion.title'),
content: _t('app.public.tour.conclusion.content'),
placement: 'bottom',

View File

@ -537,7 +537,6 @@
}
li.level-2-tab > a {
background: #eee;
line-height: 14px;
font-size: 12px;
}

View File

@ -1,3 +1,7 @@
<p class="alert alert-info m-t-lg" translate>
{{ 'app.admin.members.managers_info' }}
</p>
<div class="col-md-5 m-t-lg">
<div class="form-group">
<div class="input-group">

View File

@ -59,7 +59,7 @@
<div class="text-center clearfix">
<div class="col-sm-6 b-r no-padder">
<div class="btn btn-default btn-block no-b padder-v red" ng-click="reserveMachine(machine, $event)" ng-hide="machine.disabled">
<div class="btn btn-default btn-block no-b padder-v red reserve-button" ng-click="reserveMachine(machine, $event)" ng-hide="machine.disabled">
<i class="fa fa-bookmark m-r-xs"></i>
<span class="hidden-sm" translate>{{ 'app.public.machines_list.book' }}</span>
</div>

View File

@ -60,7 +60,7 @@
<div class="text-center clearfix">
<div class="col-sm-6 b-r no-padder">
<div class="btn btn-default btn-block no-b padder-v red" ng-click="reserveSpace(space, $event)" ng-hide="space.disabled">
<div class="btn btn-default btn-block no-b padder-v red reserve-button" ng-click="reserveSpace(space, $event)" ng-hide="space.disabled">
<i class="fa fa-bookmark m-r-xs"></i>
<span class="hidden-sm" translate>{{ 'app.public.spaces_list.book' }}</span>
</div>

View File

@ -605,6 +605,7 @@ en:
search_for_an_administrator: "Search for an administrator"
add_a_new_administrator: "Add a new administrator"
managers: "Managers"
managers_info: "A manager is a restricted administrator that cannot modify the settings of the application. However, he will be able to take reservations for any members and for all managers, including himself, and to process payments and refunds."
search_for_a_manager: "Search for a manager"
add_a_new_manager: "Add a new manager"
delete_this_manager: "Do you really want to delete this manager? This cannot be undone."
@ -1090,9 +1091,12 @@ en:
welcome:
title: "Trainings"
content: "Here you can create, modify and delete trainings. It is also the place where you can validate the training courses followed by your members."
welcome_manager:
title: "Trainings"
content: "This is the place where you can view the trainings and their associations with the machines. It is also the place where you can validate the training courses followed by your members."
trainings:
title: "Manage trainings"
content: "<p>When creating a training, you can define a default number of places. However, the number of actual places may be modified for each session.</p><p>The training sessions are scheduled from the administrator tab « Calendar ».</p><p>Another thing: it is possible to associate one or more machines with a training. This makes it a prerequisite for the reservation of these machines.</p>"
content: "<p>With each training, a default number of places is associated. However, the number of actual places may be modified for each session.</p><p>The training sessions are scheduled from the administrator tab « Calendar ».</p><p>Furthermore, a training may be associated with one or more machines. This makes it a prerequisite for the reservation of these machines.</p>"
filter:
title: "Filter"
content: "By default, only active courses are displayed here. Display the others by choosing another filter here."
@ -1150,6 +1154,9 @@ en:
welcome:
title: "Invoices"
content: "<p>Here you will be able to download invoices and credit notes issued, as well as manage everything related to accounting and invoicing.</p><p>If you use third-party software to manage your invoices, it is possible to deactivate the billing module. For this, contact your system administrator.</p>"
welcome_manager:
title: "Invoices"
content: "Here you will be able to download invoices and create credit notes."
list:
title: "Invoices list"
content: "By default, this table lists all the invoices and credit notes issued by Fab-manager. You can sort the list in a different order by clicking on the header of each column."

View File

@ -424,13 +424,25 @@ en:
welcome:
title: "Machines"
content: "<p>Machines are the tools available for your users. You must create here the machines which can then be reserved by the members.</p><p>You can also create entries for non-bookable or free access machines, then you just need to not associate availability slots with them.</p>"
welcome_manager:
title: "Machines"
content: "Machines are the tools available for the users to reserve."
view:
title: "View"
content: "To modify or delete a machine, click here first. You will not be able to delete a machine that has already been associated with availability slots, but you can deactivate it."
reserve:
title: "Reserve"
content: "Click here to access an agenda showing free slots. This will let you book this machine for an user and manage exiting reservations."
spaces:
welcome:
title: "Spaces"
content: "<p>Spaces are places available for your users. For example, a meeting room or a woodshop. You must create here the spaces which can then be reserved by members.</p><p>The specificity of the spaces is that they can be reserved by several users at the same time.</p>"
welcome_manager:
title: "Spaces"
content: "<p>Spaces are the places available for the users to reserve. For example, a meeting room or a woodshop.</p><p>The specificity of the spaces is that they can be reserved by several users at the same time.</p>"
view:
title: "View"
content: "To modify or delete a space, click here first. You will not be able to delete a space that has already been associated with availability slots, but you can deactivate it."
reserve:
title: "Reserve"
content: "Click here to access an agenda showing free slots. This will let you book this space for an user and manage exiting reservations."