Merge branch 'master' of https://github.com/sebathefox/skolehjem-webapp into master
This commit is contained in:
commit
5aebe1328d
|
@ -31,7 +31,7 @@ class NewsController extends Controller
|
||||||
*/
|
*/
|
||||||
public function index(Request $request)
|
public function index(Request $request)
|
||||||
{
|
{
|
||||||
$news = News::query()->paginate($request->input("limit", 20));
|
$news = News::query()->orderBy('id', 'asc')->paginate(2);
|
||||||
|
|
||||||
return Response::detect("news.index", [ "news" => $news ]);
|
return Response::detect("news.index", [ "news" => $news ]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use App\News;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Http\Response;
|
use Illuminate\Http\Response;
|
||||||
|
|
||||||
|
@ -14,9 +15,20 @@ class RootController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
public function index() {
|
public function index() {
|
||||||
if(auth()->user()->can('admin.panel.show'))
|
$perPage = 2;
|
||||||
return Response::detect("root.index");
|
|
||||||
else
|
if(auth()->user()->can('admin.panel.show')) {
|
||||||
return view('app.root.index');
|
if(Response::detect("root.index")->name() == "admin.root.index")
|
||||||
|
return Response::detect("root.index");
|
||||||
|
else {
|
||||||
|
$news = News::query()->orderBy('id', 'asc')->paginate($perPage);
|
||||||
|
return Response::detect("root.index", ["news" => $news]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$news = News::query()->orderBy('id', 'asc')->paginate($perPage);
|
||||||
|
|
||||||
|
return view('app.root.index', ["news" => $news]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -157,6 +157,42 @@ input.appinput {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nav > .pagination {
|
||||||
|
display: flex;
|
||||||
|
list-style: none;
|
||||||
|
-webkit-padding-start: unset;
|
||||||
|
padding-inline-start: unset;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pagination > .page-item {
|
||||||
|
display: block;
|
||||||
|
list-style: none;
|
||||||
|
padding-right: 8px;
|
||||||
|
font-size: 1.5rem;
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pagination > .page-item:last-child {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pagination > .page-item.disabled {
|
||||||
|
color: darkgrey;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pagination > .page-item.active {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-item.active > span {
|
||||||
|
font-size: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pagination > .page-item.disabled > .page-link {
|
||||||
|
font-size: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
.text-white {
|
.text-white {
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
}
|
}
|
||||||
|
|
|
@ -157,6 +157,42 @@ input.appinput {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nav > .pagination {
|
||||||
|
display: flex;
|
||||||
|
list-style: none;
|
||||||
|
-webkit-padding-start: unset;
|
||||||
|
padding-inline-start: unset;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pagination > .page-item {
|
||||||
|
display: block;
|
||||||
|
list-style: none;
|
||||||
|
padding-right: 8px;
|
||||||
|
font-size: 1.5rem;
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pagination > .page-item:last-child {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pagination > .page-item.disabled {
|
||||||
|
color: darkgrey;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pagination > .page-item.active {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-item.active > span {
|
||||||
|
font-size: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pagination > .page-item.disabled > .page-link {
|
||||||
|
font-size: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
.text-white {
|
.text-white {
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
}
|
}
|
||||||
|
|
|
@ -157,6 +157,42 @@ input.appinput {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nav > .pagination {
|
||||||
|
display: flex;
|
||||||
|
list-style: none;
|
||||||
|
-webkit-padding-start: unset;
|
||||||
|
padding-inline-start: unset;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pagination > .page-item {
|
||||||
|
display: block;
|
||||||
|
list-style: none;
|
||||||
|
padding-right: 8px;
|
||||||
|
font-size: 1.5rem;
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pagination > .page-item:last-child {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pagination > .page-item.disabled {
|
||||||
|
color: darkgrey;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pagination > .page-item.active {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-item.active > span {
|
||||||
|
font-size: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pagination > .page-item.disabled > .page-link {
|
||||||
|
font-size: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
.text-white {
|
.text-white {
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,3 +27,40 @@
|
||||||
.cursor-pointer {
|
.cursor-pointer {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
nav > .pagination {
|
||||||
|
display: flex;
|
||||||
|
list-style: none;
|
||||||
|
padding-inline-start: unset;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pagination > .page-item {
|
||||||
|
display: block;
|
||||||
|
list-style: none;
|
||||||
|
padding-right: 8px;
|
||||||
|
font-size: 1.5rem;
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pagination > .page-item:last-child {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pagination > .page-item.disabled {
|
||||||
|
color: darkgrey;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pagination > .page-item.active {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-item.active > span {
|
||||||
|
font-size: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pagination > .page-item.disabled > .page-link {
|
||||||
|
font-size: 24px;
|
||||||
|
}
|
||||||
|
|
|
@ -13,22 +13,27 @@
|
||||||
<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;">
|
||||||
<?php $i = 1; ?>
|
<?php
|
||||||
|
date_default_timezone_set('Europe/Copenhagen');
|
||||||
|
$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($i % 3 == 1)
|
@if (date('Y-m-d H:i:s', strtotime('-1 hour')) < $reservation->time)
|
||||||
|
@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);">
|
|
||||||
<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++; ?>
|
|
||||||
@endforeach
|
@endforeach
|
||||||
@endforeach
|
@endforeach
|
||||||
@if($i == 1)
|
@if($i == 1)
|
||||||
|
@ -38,6 +43,13 @@
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<script src="{{ mix("/js/app.js") }}"></script>
|
<script src="{{ mix("/js/app.js") }}"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function () {
|
||||||
|
setTimeout(function(){
|
||||||
|
location.reload(true);
|
||||||
|
}, (60000*5));
|
||||||
|
});
|
||||||
|
</script>
|
||||||
@yield("scripts")
|
@yield("scripts")
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -79,6 +79,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@endforeach
|
@endforeach
|
||||||
|
{{ $events->links() }}
|
||||||
@else
|
@else
|
||||||
<p class="text-center" style="margin-bottom: auto">{{__('msg.dereringenaktiviteter')}}!</p>
|
<p class="text-center" style="margin-bottom: auto">{{__('msg.dereringenaktiviteter')}}!</p>
|
||||||
@endif
|
@endif
|
||||||
|
|
|
@ -54,6 +54,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@endforeach
|
@endforeach
|
||||||
|
{{ $guides->links() }}
|
||||||
@else
|
@else
|
||||||
<p style="margin: 0 18px; margin-bottom: auto; text-align: center">{{__('msg.dereringenvejledninger')}}.</p>
|
<p style="margin: 0 18px; margin-bottom: auto; text-align: center">{{__('msg.dereringenvejledninger')}}.</p>
|
||||||
@endif
|
@endif
|
||||||
|
|
|
@ -69,8 +69,11 @@
|
||||||
@endforeach
|
@endforeach
|
||||||
@if(count(\App\News::query()->orderBy("created_at", "desc")->get()) == 0)
|
@if(count(\App\News::query()->orderBy("created_at", "desc")->get()) == 0)
|
||||||
<p class="text-center">{{__('msg.ingennyheder')}}</p>
|
<p class="text-center">{{__('msg.ingennyheder')}}</p>
|
||||||
|
@else
|
||||||
|
{{ $news->links() }}
|
||||||
@endif
|
@endif
|
||||||
<div id="snackbar"></div>
|
<div id="snackbar"></div>
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
@endsection
|
@endsection
|
||||||
@section("scripts")
|
@section("scripts")
|
||||||
|
|
|
@ -22,6 +22,8 @@
|
||||||
@endforeach
|
@endforeach
|
||||||
@if(count($reservations) < 1)
|
@if(count($reservations) < 1)
|
||||||
<p style="margin: 0 18px;">{{__('msg.duharingenreservationer')}}.</p>
|
<p style="margin: 0 18px;">{{__('msg.duharingenreservationer')}}.</p>
|
||||||
|
@else
|
||||||
|
{{ $reservations->links() }}
|
||||||
@endif
|
@endif
|
||||||
<a href="{{ route("washing-reservations.create") }}" class="btn btn-sde-blue mt-auto mb-1">{{__('msg.reservervaskemaskine')}}</a>
|
<a href="{{ route("washing-reservations.create") }}" class="btn btn-sde-blue mt-auto mb-1">{{__('msg.reservervaskemaskine')}}</a>
|
||||||
</main>
|
</main>
|
||||||
|
|
Loading…
Reference in New Issue