1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-17 06:52:27 +01:00

book slot at same time for managers

This commit is contained in:
Sylvain 2020-04-27 16:44:56 +02:00
parent 69c8d7c678
commit d376aa400c
2 changed files with 6 additions and 5 deletions

View File

@ -727,10 +727,11 @@ Application.Directives.directive('cart', [ '$rootScope', '$uibModal', 'dialogs',
/**
* Controller of modal for show reservations the same date at the same time
*/
Application.Controllers.controller('ReserveSlotSameTimeController', ['$scope', '$uibModalInstance', 'sameTimeReservations', 'growl', '_t',
function ($scope, $uibModalInstance, sameTimeReservations, growl, _t) {
Application.Controllers.controller('ReserveSlotSameTimeController', ['$scope', '$uibModalInstance', 'AuthService', 'sameTimeReservations', 'growl', '_t',
function ($scope, $uibModalInstance, AuthService, sameTimeReservations, growl, _t) {
$scope.sameTimeReservations = sameTimeReservations;
$scope.bookSlotAtSameTime = Fablab.bookSlotAtSameTime;
$scope.isAuthorized = AuthService.isAuthorized;
/**
* Confirmation callback
*/

View File

@ -3,8 +3,8 @@
<h1 translate>{{ 'app.shared.cart.slot_at_same_time' }}</h1>
</div>
<div class="modal-body">
<p ng-if="bookSlotAtSameTime || currentUser.role === 'admin'" translate>{{ 'app.shared.cart.do_you_really_want_to_book_slot_at_same_time' }}</p>
<p ng-if="!bookSlotAtSameTime && currentUser.role !== 'admin'" translate>{{ 'app.shared.cart.unable_to_book_slot_because_really_have_reservation_at_same_time' }}</p>
<p ng-if="bookSlotAtSameTime || isAuthorized(['admin', 'manager'])" translate>{{ 'app.shared.cart.do_you_really_want_to_book_slot_at_same_time' }}</p>
<p ng-if="!bookSlotAtSameTime && !isAuthorized(['admin', 'manager'])" translate>{{ 'app.shared.cart.unable_to_book_slot_because_really_have_reservation_at_same_time' }}</p>
<ul>
<li ng-repeat="r in sameTimeReservations">
<span>{{::r.reservable.name}}{{::r.reservable.title}}</span>
@ -13,6 +13,6 @@
</ul>
</div>
<div class="modal-footer">
<button ng-if="bookSlotAtSameTime || currentUser.role === 'admin'" class="btn btn-info" ng-click="ok()" translate>{{ 'app.shared.buttons.confirm' }}</button>
<button ng-if="bookSlotAtSameTime || isAuthorized(['admin', 'manager'])" class="btn btn-info" ng-click="ok()" translate>{{ 'app.shared.buttons.confirm' }}</button>
<button class="btn btn-default" ng-click="cancel()" translate>{{ 'app.shared.buttons.cancel' }}</button>
</div>