The Bookings module provides a dual-interface for managing reservations. It synchronizes a visual calendar with a searchable, interactive list, allowing for seamless check-ins and detail management.
- Dual-View Interface: A split-screen layout featuring a FullCalendar v6 integration on the left and a detailed booking list on the right.
- Real-time Check-in: Integrated AJAX-based check-in system that updates the database and the UI without reloading the page.
- Dynamic Search: Instant filtering of bookings by name or date using Vanilla JS.
- Performance Optimized: Uses the Intersection Observer API for lazy-loading/animations of booking cards.
- API-Driven: Calendar events are fetched dynamically from a dedicated Django JSON endpoint.
- FullCalendar: Initialized in
dayGridMonthwithtimeGridDaydrill-down on date click. - Bootstrap 5 Modals: Used for displaying detailed booking information fetched from the DOM or API.
- Vanilla JS: No jQuery dependency. All logic for search, modal filling, and AJAX is written in pure JavaScript.
- Models: Extends the core system with
first_name,last_name,booking_from,booking_to, andchecked_instatus. - API Endpoints:
/bookings/api/bookings/: Returns JSON events for the calendar./bookings/api/bookings/<id>/checkin/: POST endpoint for status updates (requires CSRF token).
| File | Purpose |
|---|---|
templates/bookings.html |
The main dashboard layout for the booking module. |
static/bookings/bookings.js |
Contains calendar init, search logic, and AJAX handlers. |
static/bookings/bookings.css |
Custom styling for the booking cards and scroll containers. |
- Calendar Navigation: Click on any date in the Booking Calendar to switch to the day-view for detailed time slots. Use the navigation buttons to navigate between months.
- Search: Type in the search bar to filter bookings by name or date.
- Check-in:
- Locate the guest in the booking list.
- Click the green Check-in button.
- The status badge will update to "Checked In" immediately via AJAX, and the calendar will refresh to reflect the new status.
- View Details: Click the Details button on any card to open a modal with the full guest information.