Ekapp/skolehjem/resources/views/app/layout/base.blade.php

183 lines
7.5 KiB
PHP
Raw Normal View History

2020-06-08 13:08:46 +00:00
<!DOCTYPE html>
<html lang="en">
2020-06-08 13:08:46 +00:00
<head>
2020-06-09 06:38:05 +00:00
<title>@yield("title")</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
2020-08-21 11:44:33 +00:00
<link type="text/css" rel="stylesheet" href="{{ asset("/css/normalize.css") }}">
2020-10-15 09:14:29 +00:00
<link rel='icon' href='{{ asset('/images/icons/pencil-dark.svg') }}' type='image/x-icon'>
2020-08-10 12:53:49 +00:00
@if(request()->cookie("mode") == "dark")
<link type="text/css" rel="stylesheet" href="{{ mix("/css/webappdark.css") }}">
@else
<link type="text/css" rel="stylesheet" href="{{ mix("/css/webapp.css") }}">
@endif
2020-08-11 13:08:09 +00:00
<script type="text/javascript">
function setMain() {
var main = document.getElementsByTagName("main")[0];
var header = document.getElementsByTagName("header")[0];
2020-08-25 12:16:47 +00:00
main.style.minHeight = 'calc(100% - ' + (header.clientHeight+10) + 'px)';
2020-08-11 13:08:09 +00:00
}
</script>
2020-06-08 13:08:46 +00:00
</head>
2020-10-15 10:54:59 +00:00
<body onresize="setMain()" onload="setMain(); fullScreen();">
2020-08-25 12:07:20 +00:00
<header class="row align-items-center" id="header" style="position: fixed; top: 0; width: calc(100% - 1.75rem - 1.75rem); background: #00788a; transition: top 0.3s;">
2020-08-10 12:53:49 +00:00
@if(request()->cookie("mode") == "dark")
<img class="w-50" id="sdeLogo" src="{{URL::asset('/images/logos/Logo-hvid.svg')}}" onclick="location.href = '{{ route("root.index") }}';" alt="Syddansk Erhvervsskole">
@else
2020-08-25 12:07:20 +00:00
<img class="w-50" id="sdeLogo" src="{{URL::asset('/images/logos/Logo-hvid.svg')}}" onclick="location.href = '{{ route("root.index") }}';" alt="Syddansk Erhvervsskole">
2020-08-10 12:53:49 +00:00
@endif
2020-06-25 13:11:59 +00:00
<button class="ml-auto" id="toggle">
2020-08-10 13:19:53 +00:00
<i id="icon" class="fas fa-bars" style="color: black;"></i>
2020-06-24 07:25:59 +00:00
</button>
</header>
<div class="d-none bg-sde-blue col" id="menu">
2020-06-29 07:21:17 +00:00
<a href="{{ route("root.index") }}">
2020-10-07 10:20:58 +00:00
<img src="{{URL::asset('/images/icons/Home.svg')}}" alt="Nyheder">
{{ __('msg.nyheder') }}
2020-06-29 07:21:17 +00:00
</a>
2020-08-31 07:36:10 +00:00
@if(auth()->user()->can('menuplan.show'))
2020-06-26 11:14:02 +00:00
<a href="{{ route("menu-plans.index") }}">
2020-06-24 07:25:59 +00:00
<img src="{{URL::asset('/images/icons/Menuplan.svg')}}" alt="Menuplan">
2020-08-06 13:31:38 +00:00
{{ __('msg.menuplan') }}
2020-06-24 07:25:59 +00:00
</a>
2020-08-31 07:36:10 +00:00
@endif
@if(auth()->user()->can('event.show'))
2020-06-26 11:14:02 +00:00
<a href="{{ route("events.index") }}">
2020-06-24 07:25:59 +00:00
<img src="{{URL::asset('/images/icons/Aktiviteter.svg')}}" alt="Aktiviteter">
2020-08-06 13:31:38 +00:00
{{ __('msg.aktiviteter') }}
2020-06-24 07:25:59 +00:00
</a>
2020-08-31 07:36:10 +00:00
@endif
@if(auth()->user()->can('washing.machine.reservation.show'))
2020-08-03 10:57:14 +00:00
<a href="{{ route("washing-reservations.appindex") }}">
<img src="{{URL::asset('/images/icons/Vaske booking liste.svg')}}" alt="Reservationer">
2020-08-06 13:31:38 +00:00
{{ __('msg.reservationer') }}
2020-06-24 07:25:59 +00:00
</a>
2020-08-31 07:36:10 +00:00
@endif
@if(auth()->user()->can('contact.show'))
<a href="{{ route("contacts.index") }}">
2020-08-11 10:37:31 +00:00
<img src="{{URL::asset('/images/icons/Kontoret.svg')}}" alt="Kontakter">
2020-08-06 13:31:38 +00:00
{{ __('msg.kontoret') }}
2020-06-24 07:25:59 +00:00
</a>
2020-08-31 07:36:10 +00:00
@endif
2020-06-29 07:21:17 +00:00
<a href="{{ route("phones.index") }}">
2020-06-24 07:25:59 +00:00
<img src="{{URL::asset('/images/icons/Vagttelefon-hvid.svg')}}" alt="Vagttelefon">
2020-08-06 13:31:38 +00:00
{{ __('msg.vagttelefon') }}
2020-06-24 07:25:59 +00:00
</a>
2020-08-31 07:36:10 +00:00
@if(auth()->user()->can('guides.show'))
<a href="{{ route("guides.index") }}">
2020-08-04 15:06:46 +00:00
<img src="{{URL::asset('/images/icons/Vejledninger.svg')}}" alt="Guide">
2020-08-06 13:31:38 +00:00
{{ __('msg.vejledning') }}
</a>
2020-08-31 07:36:10 +00:00
@endif
@if(auth()->user()->can('feedback.create'))
<a href="{{ route('feedbacks.create') }}">
<img src="{{URL::asset('/images/icons/feedback.svg')}}" alt="Feedback">
{{__('msg.givfeedback')}}
</a>
@endif
2020-08-05 06:32:27 +00:00
<a href="{{ route("users.account") }}">
<img src="{{URL::asset('/images/icons/user-hvid.svg')}}" alt="Konto">
2020-08-06 13:31:38 +00:00
{{ __('msg.konto') }}
2020-08-05 06:32:27 +00:00
</a>
2020-08-11 10:37:31 +00:00
<a href="{{ route("settings.index") }}">
<img src="{{URL::asset('/images/icons/settings-hvid.svg')}}" alt="Indstillinger">
{{ __('msg.indstillinger') }}
</a>
2020-08-12 11:08:47 +00:00
<a href="{{ route('about.index') }}">
2020-08-13 08:26:43 +00:00
<img src="{{URL::asset('/images/icons/about.svg')}}" alt="Omkring">
2020-08-12 11:08:47 +00:00
{{ __('msg.omkring') }}
</a>
2020-06-30 11:03:41 +00:00
<a href="{{ route('users.logout') }}">
2020-07-30 10:20:52 +00:00
<img src="{{URL::asset('/images/icons/Logout.svg')}}" alt="Logud">
2020-08-06 13:31:38 +00:00
{{ __('msg.logud') }}
2020-06-30 11:03:41 +00:00
</a>
2020-06-24 07:25:59 +00:00
</div>
<style>
option, textarea {
color: black;
}
</style>
2020-06-24 07:25:59 +00:00
@yield("content")
<script src="{{ mix("/js/app.js") }}"></script>
2020-08-10 13:19:53 +00:00
@if(request()->cookie("mode") == "dark")
<script type="text/javascript">
function toggleMenu(menu) {
let menuElement = document.getElementById(menu);
let logoElement = document.getElementById("sdeLogo");
let htmlElement = document.getElementsByTagName('html')[0];
2020-08-11 07:13:48 +00:00
let bodyElement = document.getElementsByTagName('body')[0];
2020-08-10 13:19:53 +00:00
let mainElement = document.getElementsByTagName('main')[0];
let iconElement = document.getElementById("icon");
let headerElement = document.getElementById("header");
if(menuElement.classList.contains("hide")) {
menuElement.classList.remove("hide");
mainElement.classList.remove("d-none");
htmlElement.style.backgroundColor = '';
2020-08-11 07:13:48 +00:00
bodyElement.style.backgroundColor = '#666666';
2020-08-10 13:19:53 +00:00
logoElement.src = '/images/logos/Logo-hvid.svg';
iconElement.classList.remove("fa-times");
iconElement.classList.add("fa-bars");
2020-08-25 12:07:20 +00:00
headerElement.style.position = 'fixed';
2020-08-10 13:19:53 +00:00
} else {
menuElement.classList.add("hide");
mainElement.classList.add("d-none");
htmlElement.style.backgroundColor = 'rgb(0, 120, 138)';
2020-08-11 07:13:48 +00:00
bodyElement.style.backgroundColor = 'rgb(0, 120, 138)';
2020-08-10 13:19:53 +00:00
logoElement.src = '/images/logos/Logo-hvid.svg';
iconElement.classList.remove("fa-bars");
iconElement.classList.add("fa-times");
2020-08-25 12:07:20 +00:00
headerElement.style.position = 'relative';
headerElement.style.top = '0';
2020-08-10 13:19:53 +00:00
}
}
if(document.getElementById("toggle"))
document.getElementById("toggle").onclick = function () {
toggleMenu('menu');
};
</script>
@endif
2020-08-11 13:08:09 +00:00
@yield("scripts")
2020-08-25 12:07:20 +00:00
<script>
var prevScrollpos = window.pageYOffset;
window.onscroll = function() {
var currentScrollPos = window.pageYOffset;
if (prevScrollpos > currentScrollPos) {
document.getElementById("header").style.top = "0";
} else if(document.getElementById("header").style.position !== "relative" && window.scrollY > document.getElementById("header").clientHeight - 10) {
document.getElementById("header").style.top = "-" + document.getElementById("header").clientHeight + "px";
}
prevScrollpos = currentScrollPos;
}
document.getElementsByTagName("main")[0].style.paddingTop = (10+document.getElementById("header").clientHeight) + "px";
//document.getElementById("menu").style.paddingTop = document.getElementById("header").clientHeight + "px";
2020-10-15 10:54:59 +00:00
/*
Make the application fullscreen
*/
//Get all html
var elem = document.documentElement;
function fullScreen() {
if (elem.requestFullscreen) {
elem.requestFullscreen();
} else if (elem.mozRequestFullScreen) { //Support for Firefox browser
elem.mozRequestFullScreen();
} else if (elem.webkitRequestFullscreen) { //Support for Safari, Chrome and Opera browser
elem.webkitRequestFullscreen();
} else if (elem.msRequestFullscreen) { //And support for the old ass internet browser IE and Edge
elem.msRequestFullscreen();
}
}
2020-08-25 12:07:20 +00:00
</script>
2020-06-08 13:08:46 +00:00
</body>
</html>