1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-01 12:24:28 +01:00

(front) add is-empty class to the calendar-admin-info side panel if no events are selected

This commit is contained in:
Sylvain 2022-04-12 17:22:47 +02:00
parent 78be7bb276
commit c77e6c8a65
3 changed files with 13 additions and 6 deletions

View File

@ -494,6 +494,9 @@ Application.Controllers.controller('AdminCalendarController', ['$scope', '$state
$scope.availability = event; $scope.availability = event;
$scope.availability.plans = availabilityPlans(); $scope.availability.plans = availabilityPlans();
// mark the side panel as available to be opened
$('label.calendar-admin-info').removeClass('is-empty');
if ($scope.availabilityDom) { if ($scope.availabilityDom) {
$scope.availabilityDom.classList.remove('fc-selected'); $scope.availabilityDom.classList.remove('fc-selected');
} }
@ -546,6 +549,9 @@ Application.Controllers.controller('AdminCalendarController', ['$scope', '$state
// we unselect the current event to keep consistency // we unselect the current event to keep consistency
$scope.availability = null; $scope.availability = null;
$scope.availabilityDom = null; $scope.availabilityDom = null;
// mark the side panel as available to hide because no event is selected anymore
$('label.calendar-admin-info').addClass('is-empty');
}; };
// !!! MUST BE CALLED AT THE END of the controller // !!! MUST BE CALLED AT THE END of the controller

View File

@ -58,10 +58,10 @@
<div ui-calendar="calendarConfig" ng-model="eventSources" calendar="calendar" class="wrapper-lg"></div> <div ui-calendar="calendarConfig" ng-model="eventSources" calendar="calendar" class="wrapper-lg"></div>
</div> </div>
<label class="calendar-admin-info"> <label class="calendar-admin-info is-empty">
<input type="checkbox"> <input type="checkbox">
<div class="content"> <div class="content">
<p class="placeholder">Veuillez sélectionner un créneau</p> <p class="placeholder" translate>{{ 'app.admin.calendar.select_a_slot' }}</p>
<div class="widget panel b-a" ng-if="availability" ng-show="(availability.slot_duration || availability.tags.length > 0) && availability.available_type !== 'event'"> <div class="widget panel b-a" ng-if="availability" ng-show="(availability.slot_duration || availability.tags.length > 0) && availability.available_type !== 'event'">
<div class="panel-heading b-b small"> <div class="panel-heading b-b small">
<h3><i class="fa fa-info-circle m-r" aria-hidden="true"></i><span translate>{{ 'app.admin.calendar.info' }}</span></h3> <h3><i class="fa fa-info-circle m-r" aria-hidden="true"></i><span translate>{{ 'app.admin.calendar.info' }}</span></h3>

View File

@ -18,6 +18,7 @@ en:
events: "Events" events: "Events"
availabilities: "Availabilities" availabilities: "Availabilities"
availabilities_notice: "Export to an Excel workbook every slots available for reservation, and their occupancy rate." availabilities_notice: "Export to an Excel workbook every slots available for reservation, and their occupancy rate."
select_a_slot: "Please select a slot"
info: "Info" info: "Info"
tags: "Tags" tags: "Tags"
slot_duration: "Slot duration: {DURATION} minutes" slot_duration: "Slot duration: {DURATION} minutes"