From c69e13c446637a214275495fa0f3fb00c2d5c161 Mon Sep 17 00:00:00 2001 From: Torsten Date: Thu, 23 Jun 2022 08:05:32 +0200 Subject: [PATCH] Tour.show: Only offer rooms with free slots in modal --- motorradig/resources/views/tour/show.blade.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/motorradig/resources/views/tour/show.blade.php b/motorradig/resources/views/tour/show.blade.php index a0f1995..ded7225 100644 --- a/motorradig/resources/views/tour/show.blade.php +++ b/motorradig/resources/views/tour/show.blade.php @@ -74,7 +74,6 @@ Ok @if(!App\Tour::has_participant($tour->id, Auth::user()->id)) - @else @@ -85,7 +84,7 @@ - + @@ -103,7 +102,7 @@ @if ($room_id="") @endif @foreach($rooms as $room) - @if( $room->room_id != 0) + @if( $room->room_id != 0 and $room->free_slots >0) @if ($room_id != $room->room_id) @if(strlen($room_id))
@@ -182,17 +181,20 @@ var span = document.getElementsByClassName("close")[0]; // When the user clicks on the button, open the modal - btn.onclick = function() { + btn.onclick = function(e) { + e.preventDefault(); modal.style.display = "block"; } // When the user clicks on (x), close the modal - span.onclick = function() { + span.onclick = function(e) { + e.preventDefault(); modal.style.display = "none"; } // When the user clicks anywhere outside of the modal, close it window.onclick = function(event) { + event.preventDefault(); if (event.target == modal) { modal.style.display = "none"; }