auditionadmin/resources/views/components/layout/app.blade.php

64 lines
2.1 KiB
PHP

@php use App\Settings; @endphp
@props(['page_title' => false, 'title_bar_right' => false ])
<!doctype html>
<html lang="en" class="h-full bg-gray-100">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>AuditionAdmin</title>
@vite(['resources/css/app.css', 'resources/js/app.js'])
{{-- Code below from https://codepen.io/ryangjchandler/pen/WNQQKeR --}}
{{-- JS for sorting tables by a column --}}
{{-- Sortable columns need this on their <th>: @click="sortByColumn" class="cursor-pointer select-none" --}}
{{-- One level above the table needs x-data="data()" --}}
{{-- tbody needs x-ref="tbody" --}}
<script src="{{ asset('js/sort_table_by_column.js') }}"></script>
<script src="https://cdn.jsdelivr.net/npm/sortablejs@1.14.0/Sortable.min.js"></script>
</head>
<body class="h-full">
<div class="bg-indigo-800 border-b border-b-indigo-900">
<div class="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8">
<div class="flex h-8 items-center justify-between">
<div>
<span class="text-white rounded-md px-3 py-2 text-sm text-m font-medium">AuditionAdmin</span><span class="text-white rounded-md px-3 py-2 text-sm">{{ Settings::auditionName() }}</span>
</div>
<div>
[ ADMIN ]
</div>
</div>
</div>
</div>
<div class="min-h-full">
@if(request()->is('*admin*'))
<x-layout.navbar-admin />
@else
<x-layout.navbar />
@endif
@if($page_title)
<x-layout.page-header>
{{ $page_title }}
@if($title_bar_right)
<x-slot:title_bar_right>{{ $title_bar_right }}</x-slot:title_bar_right>
@endif
</x-layout.page-header>
@endif
<main {{ $attributes }}>
<div class="mx-auto max-w-7xl py-6 sm:px-6 lg:px-8">
<x-flash_message></x-flash_message>
{{ $slot }}
</div>
</main>
</div>
</body>
</html>