v0.10.0 - Added admin dashboard

This commit is contained in:
frederikpyt 2020-08-17 10:28:54 +02:00
parent 604d5dad19
commit 9596a426fa
7 changed files with 296 additions and 4 deletions

View File

@ -1,7 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="Encoding"> <component name="Encoding">
<file url="file://$PROJECT_DIR$/skolehjem/public/images/icons/backpack-hvid.svg" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/skolehjem/public/images/icons/eye-dark.svg" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/skolehjem/public/images/icons/eye-dark.svg" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/skolehjem/public/images/icons/print-hvid.svg" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/skolehjem/public/images/icons/print-hvid.svg" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/skolehjem/public/images/icons/users-hvid.svg" charset="UTF-8" />
</component> </component>
</project> </project>

View File

@ -0,0 +1,68 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
fill="#fff" viewBox="0 0 490.667 490.667" style="enable-background:new 0 0 490.667 490.667;" xml:space="preserve">
<g>
<g>
<circle cx="245.333" cy="160" r="74.667"/>
</g>
</g>
<g>
<g>
<circle cx="394.667" cy="224" r="53.333"/>
</g>
</g>
<g>
<g>
<circle cx="97.515" cy="224" r="53.333"/>
</g>
</g>
<g>
<g>
<path d="M245.333,256c-76.459,0-138.667,62.208-138.667,138.667c0,5.888,4.779,10.667,10.667,10.667h256
c5.888,0,10.667-4.779,10.667-10.667C384,318.208,321.792,256,245.333,256z"/>
</g>
</g>
<g>
<g>
<path d="M115.904,300.971c-6.528-1.387-13.163-2.304-19.904-2.304c-52.928,0-96,43.072-96,96c0,5.888,4.779,10.667,10.667,10.667
h76.629c-1.195-3.349-1.963-6.912-1.963-10.667C85.333,359.659,96.768,327.339,115.904,300.971z"/>
</g>
</g>
<g>
<g>
<path d="M394.667,298.667c-6.741,0-13.376,0.917-19.904,2.304c19.136,26.368,30.571,58.688,30.571,93.696
c0,3.755-0.768,7.317-1.963,10.667H480c5.888,0,10.667-4.779,10.667-10.667C490.667,341.739,447.595,298.667,394.667,298.667z"/>
</g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -0,0 +1,68 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 490.667 490.667" style="enable-background:new 0 0 490.667 490.667;" xml:space="preserve">
<g>
<g>
<circle cx="245.333" cy="160" r="74.667"/>
</g>
</g>
<g>
<g>
<circle cx="394.667" cy="224" r="53.333"/>
</g>
</g>
<g>
<g>
<circle cx="97.515" cy="224" r="53.333"/>
</g>
</g>
<g>
<g>
<path d="M245.333,256c-76.459,0-138.667,62.208-138.667,138.667c0,5.888,4.779,10.667,10.667,10.667h256
c5.888,0,10.667-4.779,10.667-10.667C384,318.208,321.792,256,245.333,256z"/>
</g>
</g>
<g>
<g>
<path d="M115.904,300.971c-6.528-1.387-13.163-2.304-19.904-2.304c-52.928,0-96,43.072-96,96c0,5.888,4.779,10.667,10.667,10.667
h76.629c-1.195-3.349-1.963-6.912-1.963-10.667C85.333,359.659,96.768,327.339,115.904,300.971z"/>
</g>
</g>
<g>
<g>
<path d="M394.667,298.667c-6.741,0-13.376,0.917-19.904,2.304c19.136,26.368,30.571,58.688,30.571,93.696
c0,3.755-0.768,7.317-1.963,10.667H480c5.888,0,10.667-4.779,10.667-10.667C490.667,341.739,447.595,298.667,394.667,298.667z"/>
</g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -6,5 +6,155 @@
@endsection @endsection
@section("content") @section("content")
<style>
.card {
min-width: 200px;
width: calc(25% - 16px);
margin: 0 8px 0 8px;
}
.content {
display: flex;
flex-wrap: wrap;
flex-direction: row;
}
.card > .head {
padding: 0 8px;
display: flex;
justify-content: center;
align-items: center;
width: calc(100% - 16px);
min-height: 170px;
}
.mr-2 {
margin-right: 1rem;
}
h3 {
margin-top: 0;
}
.event_card > .header {
padding-top: 1rem;
}
.ql-align-center {
text-align: center;
}
.ql-align-center > strong {
color: lightseagreen;
margin: auto;
}
</style>
{{-- Brugere --}}
<div class="card">
<div class="head" style="background-color: orange;">
<div>
<img style="width: 4rem;" src="{{ asset("/images/icons/users-hvid.svg") }}" alt="">
<h1 class="text-white">Brugere</h1>
</div>
<h1 class="text-white ml-auto mr-2" style="font-size: 3.5rem;">{{ count(\App\User::all()) }}</h1>
</div>
<table class="tbl mt-1">
<tr>
<th class="text-white text-center" style="background-color: orange;">Nyeste brugere</th>
</tr>
@for($i = 0; $i < 5 && $i < count(\App\User::query()->orderByDesc("id")->get()); $i++)
<tr>
<td>{{ ucfirst(strtolower(\App\User::query()->orderByDesc("id")->get()[$i]->name_first)) . ' ' . ucfirst(strtolower(\App\User::query()->orderByDesc("id")->get()[$i]->name_last)) }}</td>
</tr>
@endfor
</table>
</div>
{{-- Aktiviteter --}}
<div class="card">
<div class="head" style="background-color: red;">
<div>
<img style="margin-top: 8px;width: 3rem;" src="{{ asset("/images/icons/Aktiviteter.svg") }}" alt="">
<h1 class="text-white">Aktiviteter</h1>
</div>
<h1 class="text-white ml-auto mr-2" style="font-size: 3.5rem;">{{ count(\App\Event::all()) }}</h1>
</div>
<table class="tbl mt-1">
<tr>
<th class="text-white text-center" style="background-color: red;">Næste aktivitet</th>
</tr>
</table>
@if(\App\Event::query()->orderByDesc("date")->first() !== null)
<div class="event_card">
@if(\App\Event::query()->orderByDesc("date")->first()->resource_id !== null)
<div class="header" style="background-size: cover; background-image: url('{{ asset(\App\Resource::query()->where("id", "=", \App\Event::query()->orderByDesc("date")->first()->resource_id)->first()->filename) }}');">
<h3 style="text-shadow: 2px 2px 2px #00788A;" class="text-white text-center">{{ \App\Event::query()->orderByDesc("date")->first()->name }}</h3>
<p style="text-shadow: 2px 2px 2px #00788A"; class="text-white text-center mt-0">{{__('msg.af')}}: {{ \App\Event::query()->orderByDesc("date")->first()->accountable }}</p>
<p style="text-shadow: 2px 2px 2px #00788A"; class="text-white text-center mt-0">{{ \Illuminate\Support\Facades\Date::createFromTimeStamp(strtotime(\App\Event::query()->orderByDesc("date")->first()->date))->format('d/m/Y \k\l\. H:i') }}</p>
</div>
@else
<div class="header">
<h3>{{ \App\Event::query()->orderByDesc("date")->first()->name }}</h3>
<p class="text-center mt-0">Af: {{ \App\Event::query()->orderByDesc("date")->first()->accountable }}</p>
<p class="text-center mt-0">{{ \Illuminate\Support\Facades\Date::createFromTimeStamp(strtotime(\App\Event::query()->orderByDesc("date")->first()->date))->format('d/m/Y \k\l\. H:i') }}</p>
</div>
@endif
<div class="container" style="margin-top: 8px;">
{!! \App\Helpers::closetags(substr(\App\Event::query()->orderByDesc("date")->first()->description, 0, 300) )!!}
<input type="hidden" name="event_id" value="{{ \App\Event::query()->orderByDesc("date")->first()->id }}">
<div class="row" style="justify-content: space-between; margin-top: 16px;">
<a style="margin: 0; padding: 0; font-weight: 700;" class="sde-blue text-center" href="{{route("events.accountsignups", ["event" => \App\Event::query()->orderByDesc("date")->first()->id ])}}">{{__('msg.sedeltagere')}}</a>
</div>
</div>
</div>
@else
<p style="padding: 0 4px">Der er ingen aktiviteter</p>
@endif
</div>
<div class="card">
<div class="head" style="background-color: deepskyblue;">
<div>
<img style="width: 4rem;" src="{{ asset("/images/icons/Vejledninger.svg") }}" alt="">
<h1 class="text-white">Vejledninger</h1>
</div>
<h1 class="text-white ml-auto mr-2" style="font-size: 3.5rem;">{{ count(\App\Guide::all()) }}</h1>
</div>
<table class="tbl mt-1">
<tr>
<th class="text-white text-center" style="background-color: deepskyblue;">Seneste Vejledninger</th>
</tr>
@if(count(\App\Guide::all()) > 0)
@for($i = 0; $i < 5 && $i < count(\App\Guide::query()->orderByDesc("id")->get()); $i++)
<tr>
<td>{{ ucfirst(strtolower(\App\Guide::query()->orderByDesc("id")->get()[$i]->name)) }}</td>
</tr>
@endfor
@else
<tr>
<td class="text-center">Der er ingen vejledninger</td>
</tr>
@endif
</table>
</div>
<div class="card">
<div class="head" style="background-color: lightseagreen;">
<div>
<img style="width: 4rem;" src="{{ asset("/images/icons/Menuplan.svg") }}" alt="">
<h1 class="text-white">Menuplan</h1>
</div>
<h1 class="text-white ml-auto mr-2" style="font-size: 3.5rem;">{{ count(\App\MenuPlan::all()) }}</h1>
</div>
<table class="tbl mt-1">
<tr>
<th class="text-white text-center" style="background-color: lightseagreen;">Ugens Menuplan</th>
</tr>
</table>
@if(\App\MenuPlan::query()->where("week", "=", date('W'))->first() !== null)
{!! \App\MenuPlan::query()->where("week", "=", date('W'))->first()->menu !!}
@else
<p class="text-center">Der er ingen menuplan for denne uge</p>
@endif
</div>
@endsection @endsection

View File

@ -1,6 +1,6 @@
@section("header") @section("header")
<header class="row align-items-center" style="background-color: #00788a;"> <header class="row align-items-center" style="background-color: #00788a;">
<img src="{{ URL::asset('/images/logos/Logo-hvid.svg') }}" class="brand" alt="Syddansk Erhvervsskole"> <img src="{{ URL::asset('/images/logos/Logo-hvid.svg') }}" style="cursor: pointer;" onclick="window.location.href = '{{ route("root.index") }}';" class="brand" alt="Syddansk Erhvervsskole">
@auth @auth
<a href="{{ route("users.account") }}" class="btn btn-dark text-white m-0 ml-auto">Bruger: {{ ucfirst(Auth::user()->name_first) }} {{ ucfirst(Auth::user()->name_last) }}</a> <a href="{{ route("users.account") }}" class="btn btn-dark text-white m-0 ml-auto">Bruger: {{ ucfirst(Auth::user()->name_first) }} {{ ucfirst(Auth::user()->name_last) }}</a>

View File

@ -26,7 +26,7 @@
@foreach($menuPlans as $menuplan) @foreach($menuPlans as $menuplan)
<tr> <tr>
<td>{{$menuplan->week}}</td> <td>{{$menuplan->week}}</td>
<td><a href="{{ route("pdf.genPDF", [ "menuPlan" => $menuplan ]) }}"><img class="w-100" src="{{ asset('/images/icons/print.svg') }}" alt="Print"></a></td> <td><a href="{{ route("pdf.genPDF", [ "menuPlan" => $menuplan ]) }}" target="_blank"><img class="w-100" src="{{ asset('/images/icons/print.svg') }}" alt="Print"></a></td>
<td><a href="{{ route("menu-plans.edit", [ "menu_plan" => $menuplan ]) }}"><img class="w-100" src="{{ asset('/images/icons/pencil-dark.svg') }}" alt="Update"></a></td> <td><a href="{{ route("menu-plans.edit", [ "menu_plan" => $menuplan ]) }}"><img class="w-100" src="{{ asset('/images/icons/pencil-dark.svg') }}" alt="Update"></a></td>
<td><form method="post" action="{{ route("menu-plans.destroy", [ "menu_plan" => $menuplan ]) }}" class="w-100 nostyle"> <td><form method="post" action="{{ route("menu-plans.destroy", [ "menu_plan" => $menuplan ]) }}" class="w-100 nostyle">
@csrf @csrf

View File

@ -12,8 +12,12 @@
@foreach($menuPlans as $menuplan) @foreach($menuPlans as $menuplan)
@if($menuplan->week == $Week) @if($menuplan->week == $Week)
<h1 class="text-center sde-blue mb-0">{{ __('msg.menuplan') }}</h1> <h1 class="text-center sde-blue mb-0">{{ __('msg.menuplan') }}</h1>
@if(request()->cookie("mode") !== "dark")
<span class="text-center sde-black-80 bold">{{ __('msg.ugestor') }}: {{$menuplan->week}}</span> <span class="text-center sde-black-80 bold">{{ __('msg.ugestor') }}: {{$menuplan->week}}</span>
<div class="col w-100 mt-auto"> @else
<span class="text-center text-white bold">{{ __('msg.ugestor') }}: {{$menuplan->week}}</span>
@endif
<div class="col w-100 mt-1">
{!! $menuplan->menu !!} {!! $menuplan->menu !!}
</div> </div>
@endif @endif