Conflicts:
	skolehjem/app/Http/Controllers/RootController.php
This commit is contained in:
2020-08-31 14:29:24 +02:00
38 changed files with 323 additions and 214 deletions
@@ -47,7 +47,8 @@
</div>
@endif
<div class="container">
{!! \App\Helpers::closetags(substr($guide->guide_articles, 0, 300)) !!}
@php $tags = [ '<p>', '<b>', '<em>', '<a>', '<u>', '<s>', '<sub>', '<ul>', '<li>', '<sup>', '<div>', '<blockquote>', '<ol>', '<strong>', '<br>', '<h1>', '<h2>', '<h3>', '<h4>', '<h5>', '<h6>', '<h7>', '<span>'] @endphp
{!! \App\Helpers::closetags(substr(strip_tags($guide->guide_articles, $tags), 0, 300)) !!}
<div class="row" style="justify-content: center;">
<a style="margin: 0; padding: 0; text-align: center; font-weight: 700;" class="sde-blue" href="{{route("guides.show", ["guide" => $guide->id ])}}">{{__('msg.læsmere')}}</a>
</div>
@@ -34,30 +34,40 @@
<img src="{{URL::asset('/images/icons/Home.svg')}}" alt="Home">
Home
</a>
@if(auth()->user()->can('menuplan.show'))
<a href="{{ route("menu-plans.index") }}">
<img src="{{URL::asset('/images/icons/Menuplan.svg')}}" alt="Menuplan">
{{ __('msg.menuplan') }}
</a>
@endif
@if(auth()->user()->can('event.show'))
<a href="{{ route("events.index") }}">
<img src="{{URL::asset('/images/icons/Aktiviteter.svg')}}" alt="Aktiviteter">
{{ __('msg.aktiviteter') }}
</a>
@endif
@if(auth()->user()->can('washing.machine.reservation.show'))
<a href="{{ route("washing-reservations.appindex") }}">
<img src="{{URL::asset('/images/icons/Vaske booking liste.svg')}}" alt="Reservationer">
{{ __('msg.reservationer') }}
</a>
@endif
@if(auth()->user()->can('contact.show'))
<a href="{{ route("contacts.index") }}">
<img src="{{URL::asset('/images/icons/Kontoret.svg')}}" alt="Kontakter">
{{ __('msg.kontoret') }}
</a>
@endif
<a href="{{ route("phones.index") }}">
<img src="{{URL::asset('/images/icons/Vagttelefon-hvid.svg')}}" alt="Vagttelefon">
{{ __('msg.vagttelefon') }}
</a>
@if(auth()->user()->can('guides.show'))
<a href="{{ route("guides.index") }}">
<img src="{{URL::asset('/images/icons/Vejledninger.svg')}}" alt="Guide">
{{ __('msg.vejledning') }}
</a>
@endif
<a href="{{ route("users.account") }}">
<img src="{{URL::asset('/images/icons/user-hvid.svg')}}" alt="Konto">
{{ __('msg.konto') }}
@@ -86,8 +86,6 @@
let date = moment().locale("da").day(weekDay).week(week);
var datetext = moment().locale("da").day(weekDay).week(week).year() + "-" + prependZero((moment().locale("da").day(weekDay).week(week).month() + 1)) + "-" + prependZero(moment().locale("da").day(weekDay).week(week).date());
let dayHolder = document.createElement("div");
dayHolder.classList.add("calendar-table__col");
@@ -95,6 +93,11 @@
day.classList.add("calendar-table__item");
day.innerText = date.date();
//If any date is selected, Add selected class to the selected day
if(momentDate !== null)
if(date.diff(momentDate, 'hours') == 0)
dayHolder.classList.add("selected");
dayHolder.appendChild(day);
//If date hasn't already happened
@@ -175,7 +178,7 @@
fillMachines(data["washingmachines"], machine_id);
//Fill events (times) and remove unavailable_times
fillTimes(data["unavailable_times"], datetext);
fillTimes(data["unavailable_times"], datetext, date);
});
}
@@ -281,7 +284,7 @@
}
//Fill events (times) and remove unavailable_times
function fillTimes(unavailable_times, datetext) {
function fillTimes(unavailable_times, datetext, date) {
var element;
//If a events (times) select exists, set element to the select element
@@ -311,7 +314,7 @@
//Add times 8:00-20:00
for (let hour = 8; hour < 20; hour++) {
if(hour < new Date().getHours())
if(hour < new Date().getHours() && moment().locale("da").diff(date, 'hours') == 0)
continue;
let value = datetext + " " + prependZero(hour) + ":00:00";
@@ -15,7 +15,8 @@
<div class="reservation" style="margin: 0 32px 1.75rem 32px;">
<h3>{{ \App\WashingMachine::query()->find($reservation->machine_id)->name }}</h3>
<div class="row align-items-center">
<span style="font-size: 4vw"><b>{{__('msg.tid')}}:</b> {{ \Illuminate\Support\Facades\Date::createFromTimeStamp(strtotime($reservation->time))->format('d/m/Y \k\l\. H:i') }}</span>
<span style="font-size: 4vw; white-space: pre-line;"><b>{{__('msg.tid')}}:</b> {{ \Illuminate\Support\Facades\Date::createFromTimeStamp(strtotime($reservation->time))->format('d/m/Y \k\l\. H:i') }}
- {{ $reservation->name }}</span>
<form class="ml-auto" method="post" action="{{ route("washing-reservations.destroy", [ "washing_reservation" => $reservation ]) }}">
@csrf
@method("delete")