v0.10.14e - Location site now reloads with the div instead of the whole page

This commit is contained in:
Anders 2020-08-24 14:25:50 +02:00
parent fa5cd1c3e2
commit 3e18809584
1 changed files with 21 additions and 21 deletions

View File

@ -12,41 +12,41 @@
<img src="{{ URL::asset('/images/logos/Logo-hvid.svg') }}" class="brand" alt="Syddansk Erhvervsskole"> <img src="{{ URL::asset('/images/logos/Logo-hvid.svg') }}" class="brand" alt="Syddansk Erhvervsskole">
<p class="text-white" style="margin-left: auto; padding-right: 24px; font-size: 1vw;">Lokation: {{ $location->name }}</p> <p class="text-white" style="margin-left: auto; padding-right: 24px; font-size: 1vw;">Lokation: {{ $location->name }}</p>
</header> </header>
<main style="min-height: calc(100% - 72px); background-color: #ffffff;"> <main style="min-height: calc(100% - 72px); background-color: #ffffff;" id="mainDiv">
<?php <?php
date_default_timezone_set('Europe/Copenhagen'); date_default_timezone_set('Europe/Copenhagen');
$i = 1; $i = 1;
?> ?>
<div class="row"> <div class="row">
@foreach(\App\WashingMachine::query()->where("location_id", "=", $location->id)->get() as $machine) @foreach(\App\WashingMachine::query()->where("location_id", "=", $location->id)->get() as $machine)
@foreach(\App\WashingReservation::query()->where("machine_id", "=", $machine->id)->where("time", "LIKE", date("Y-m-d"). "%")->orderBy("time", "asc")->get() as $reservation) @foreach(\App\WashingReservation::query()->where("machine_id", "=", $machine->id)->where("time", "LIKE", date("Y-m-d"). "%")->orderBy("time", "asc")->get() as $reservation)
@if (date('Y-m-d H:i:s', strtotime('-1 hour')) < $reservation->time) @if (date('Y-m-d H:i:s', strtotime('-1 hour')) < $reservation->time)
@if($i % 3 == 1) @if($i % 3 == 1)
</div>
<div class="row w-100">
@endif
<div class="reservation col align-items-center" style="margin: 0 32px 1.75rem 32px; width: calc(33% - 64px);">
<h2 style="font-size: 2vw">{{ \App\WashingMachine::query()->find($reservation->machine_id)->name }}</h2>
<div class="col align-items-center">
<span style="font-size: 1vw"><b>Dato:</b> {{ \Illuminate\Support\Facades\Date::createFromTimeStamp(strtotime($reservation->time))->format('d/m/Y') }}</span>
<span style="font-size: 2vw"><b>Tid:</b> {{ \Illuminate\Support\Facades\Date::createFromTimeStamp(strtotime($reservation->time))->format('\k\l\. H:i') }} - {{ \App\User::query()->where("id", "=", $reservation->user_id)->first()->name_first }} {{ \App\User::query()->where("id", "=", $reservation->user_id)->first()->name_last }}</span>
</div>
</div> </div>
<div class="row w-100"> <?php $i++; ?>
@endif @endif
<div class="reservation col align-items-center" style="margin: 0 32px 1.75rem 32px; width: calc(33% - 64px);"> @endforeach
<h2 style="font-size: 2vw">{{ \App\WashingMachine::query()->find($reservation->machine_id)->name }}</h2>
<div class="col align-items-center">
<span style="font-size: 1vw"><b>Dato:</b> {{ \Illuminate\Support\Facades\Date::createFromTimeStamp(strtotime($reservation->time))->format('d/m/Y') }}</span>
<span style="font-size: 2vw"><b>Tid:</b> {{ \Illuminate\Support\Facades\Date::createFromTimeStamp(strtotime($reservation->time))->format('\k\l\. H:i') }} - {{ \App\User::query()->where("id", "=", $reservation->user_id)->first()->name_first }} {{ \App\User::query()->where("id", "=", $reservation->user_id)->first()->name_last }}</span>
</div>
</div>
<?php $i++; ?>
@endif
@endforeach @endforeach
@endforeach @if($i == 1)
@if($i == 1) <b class="w-100 text-center" style="font-size: 2vw; padding-top: 16px;">Der er ingen vaskemaskine reservationer for i dag.</b>
<b class="w-100 text-center" style="font-size: 2vw; padding-top: 16px;">Der er ingen vaskemaskine reservationer for i dag.</b> @endif
@endif
</div> </div>
</main> </main>
<script src="{{ mix("/js/app.js") }}"></script> <script src="{{ mix("/js/app.js") }}"></script>
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function () { $(document).ready(function () {
setTimeout(function(){ setInterval(function(){ // There has to be a space between " and # or it will not load correctly
location.reload(true); $('#mainDiv').load(" #mainDiv").fadeIn();
}, (60000*5)); }, (60000*5));
}); });
</script> </script>