This commit is contained in:
frederikpyt 2020-08-31 11:56:17 +02:00
commit 56cdd63fbb
11 changed files with 211 additions and 113 deletions

View File

@ -11,7 +11,9 @@
@section("content")
<div class="row align-items-center">
@if(auth()->user()->can('contact.create'))
<a class="btn btn-inline btn-sde-blue mb-0" href="{{ route('contacts.create') }}"><img src="{{ asset('/images/icons/plus.svg') }}" alt="Create">Opret Kontakt</a>
@endif
<form method="post" action="{{ route("users.store") }}">
@csrf
@ -20,7 +22,7 @@
<button id="filterButton" type="button" class="btn btn-sde-blue mb-0">Filter</button>
</div>
<div id="showHideCheckbox" class="mt-1 ">
<div id="showHideCheckbox" class="mt-1">
<input class="checkbox-inline" type="checkbox" name="checkbox" id="navn" value="navn">
<label for="navn">Navn</label>
<input class="checkbox-inline" type="checkbox" name="checkbox" id="titel" value="titel">
@ -38,8 +40,12 @@
<th>Titel</th>
<th>E-mail</th>
<th>Tlf</th>
@if(auth()->user()->can('contact.edit'))
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/pencil.svg') }}" alt="Update"></th>
@endif
@if(auth()->user()->can('contact.delete'))
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/trashcan.svg') }}" alt="Delete"></th>
@endif
</tr>
@foreach($contacts as $contact)
<tr>
@ -47,7 +53,10 @@
<td>{{ $contact->title }}</td>
<td>{{ $contact->email }}</td>
<td>{{ $contact->phone }}</td>
@if(auth()->user()->can('contact.edit'))
<td><a href="{{ route("contacts.edit", [ "contact" => $contact ]) }}"><img class="w-100" src="{{ asset('/images/icons/pencil-dark.svg') }}" alt="Update"></a></td>
@endif
@if(auth()->user()->can('contact.delete'))
<td><form method="post" action="{{ route("contacts.destroy", [ "contact" => $contact ]) }}" class="w-100 nostyle">
@csrf
@method("delete")
@ -55,6 +64,7 @@
<button class="w-100 nostyle" onclick="return confirm('Are you sure you want to delete?');" type="submit"><img class="w-100 cursor-pointer" src="{{ asset('/images/icons/trashcan-dark.svg') }}" alt="Delete"></button>
</form>
</td>
@endif
</tr>
@endforeach
</table>

View File

@ -14,7 +14,9 @@
date_default_timezone_set('Europe/Copenhagen');
?>
<div class="row align-items-center">
@if(auth()->user()->can('event.show'))
<a class="btn btn-inline btn-sde-blue mb-0" href="{{ route('events.create') }}"><img src="{{ asset('/images/icons/plus.svg') }}" alt="Create">Opret Aktivitet</a>
@endif
<form method="post" action="{{ route("events.store") }}">
@csrf
@ -28,8 +30,12 @@
<th>Aktivitet Ansvarlig</th>
<th>Aktivitet Dato</th>
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/eye.svg') }}" alt="Show"></th>
@if(auth()->user()->can('event.edit'))
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/pencil.svg') }}" alt="Update"></th>
@endif
@if(auth()->user()->can('event.delete'))
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/trashcan.svg') }}" alt="Delete"></th>
@endif
</tr>
@foreach($events as $event)
@if (date('Y-m-d H:i', strtotime('-1 day')) < date('Y-m-d H:i', strtotime($event->date)))
@ -38,7 +44,10 @@
<td>{{ $event->accountable }}</td>
<td>{{ \Illuminate\Support\Facades\Date::createFromTimeStamp(strtotime($event->date))->format('d/m/Y \k\l\. H:i') }}</td>
<td><a href="{{ route("events.signups", [ "event" => $event ]) }}"><img class="w-100" src="{{ asset('/images/icons/eye-dark.svg') }}" alt="Show"></a></td>
@if(auth()->user()->can('event.edit'))
<td><a href="{{ route("events.edit", [ "event" => $event ]) }}"><img class="w-100" src="{{ asset('/images/icons/pencil-dark.svg') }}" alt="Update"></a></td>
@endif
@if(auth()->user()->can('event.delete'))
<td><form method="post" action="{{ route("events.destroy", [ "event" => $event ]) }}" class="w-100 nostyle">
@csrf
@method("delete")
@ -46,6 +55,7 @@
<button class="w-100 nostyle" onclick="return confirm('Are you sure you want to delete?');" type="submit"><img class="w-100 cursor-pointer" src="{{ asset('/images/icons/trashcan-dark.svg') }}" alt="Delete"></button>
</form>
</td>
@endif
</tr>
@endif
@endforeach

View File

@ -34,13 +34,16 @@
<th style="width: 6em;">Dato</th>
<th>Feedback Besked</th>
<th style="width: 5em;">Ris el. Ros</th>
@if(auth()->user()->can('feedback.delete'))
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/trashcan.svg') }}" alt="Delete"></th>
@endif
</tr>
@foreach($feedback as $fb)
<tr>
<td>{{ date('d-m-Y', strtotime($fb->created_at)) }}</td>
<td>{{ $fb->message }}</td>
<td>{{ $fb->suggestion_form }}</td>
@if(auth()->user()->can('feedback.delete'))
<td><form method="post" action="{{ route("feedbacks.destroy", [ "feedback" => $fb ]) }}" class="w-100 nostyle">
@csrf
@method("delete")
@ -48,6 +51,7 @@
<button onclick="return confirm('Are you sure you want to delete?');" class="w-100 nostyle" type="submit"><img class="w-100 cursor-pointer" src="{{ asset('/images/icons/trashcan-dark.svg') }}" alt="Delete"></button>
</form>
</td>
@endif
</tr>
@endforeach
</table>

View File

@ -10,19 +10,28 @@
@endsection
@section("content")
<div class="row align-items-center">
@if(auth()->user()->can('guides.create'))
<div class="row align-items-center mb-2">
<a class="btn btn-inline btn-sde-blue mb-0" href="{{ route('guides.create') }}"><img src="{{ asset('/images/icons/plus.svg') }}" alt="Create">Opret Bruger Vejledning</a>
</div>
<table class="tbl mt-2">
@endif
<table class="tbl">
<tr>
<th>Navn</th>
@if(auth()->user()->can('guides.edit'))
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/pencil.svg') }}" alt="Update"></th>
@endif
@if(auth()->user()->can('guides.delete'))
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/trashcan.svg') }}" alt="Delete"></th>
@endif
</tr>
@foreach($guides as $guide)
<tr>
<td>{{$guide->name}}</td>
@if(auth()->user()->can('guides.edit'))
<td><a href="{{ route("guides.edit", [ "guide" => $guide ]) }}"><img class="w-100" src="{{ asset('/images/icons/pencil-dark.svg') }}" alt="Update"></a></td>
@endif
@if(auth()->user()->can('guides.delete'))
<td><form method="post" action="{{ route("guides.destroy", [ "guide" => $guide ]) }}" class="w-100 nostyle">
@csrf
@method("delete")
@ -30,6 +39,7 @@
<button onclick="return confirm('Are you sure you want to delete?');" class="w-100 nostyle" type="submit"><img class="w-100 cursor-pointer" src="{{ asset('/images/icons/trashcan-dark.svg') }}" alt="Delete"></button>
</form>
</td>
@endif
</tr>
@endforeach
</table>

View File

@ -10,21 +10,30 @@
@endsection
@section("content")
<div class="row align-items-center">
@if(auth()->user()->can('locations.create'))
<div class="row align-items-center mb-2">
<a class="btn btn-inline btn-sde-blue mb-0" href="{{ route('locations.create') }}"><img src="{{ asset('/images/icons/plus.svg') }}" alt="Create">Opret Lokation</a>
</div>
<table class="tbl mt-2">
@endif
<table class="tbl">
<tr>
<th>Navn</th>
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/eye.svg') }}" alt="Show"></th>
@if(auth()->user()->can('locations.edit'))
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/pencil.svg') }}" alt="Update"></th>
@endif
@if(auth()->user()->can('locations.delete'))
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/trashcan.svg') }}" alt="Delete"></th>
@endif
</tr>
@foreach($locations as $location)
<tr>
<td>{{$location->name}}</td>
<td><a href="{{ route("locations.show", [ "location" => $location ]) }}"><img class="w-100" src="{{ asset('/images/icons/eye-dark.svg') }}" alt="Show"></a></td>
@if(auth()->user()->can('locations.edit'))
<td><a href="{{ route("locations.edit", [ "location" => $location ]) }}"><img class="w-100" src="{{ asset('/images/icons/pencil-dark.svg') }}" alt="Update"></a></td>
@endif
@if(auth()->user()->can('locations.delete'))
<td><form method="post" action="{{ route("locations.destroy", [ "location" => $location ]) }}" class="w-100 nostyle">
@csrf
@method("delete")
@ -32,6 +41,7 @@
<button onclick="return confirm('Are you sure you want to delete?');" class="w-100 nostyle" type="submit"><img class="w-100 cursor-pointer" src="{{ asset('/images/icons/trashcan-dark.svg') }}" alt="Delete"></button>
</form>
</td>
@endif
</tr>
@endforeach
</table>

View File

@ -11,22 +11,31 @@
@section("content")
<script src="{{ asset("/js/jquery-3.2.1.min.js") }}"></script>
<div class="row align-items-center">
@if(auth()->user()->can('menuplan.create'))
<div class="row align-items-center mb-2">
<a class="btn btn-inline btn-sde-blue mb-0" href="{{ route('menu-plans.create') }}"><img src="{{ asset('/images/icons/plus.svg') }}" alt="Create">Opret Menuplan</a>
</div>
@endif
<table class="tbl mt-2">
<table class="tbl">
<tr>
<th>Uge</th>
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/print-hvid.svg') }}" alt="Print"></th>
@if(auth()->user()->can('menuplan.edit'))
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/pencil.svg') }}" alt="Update"></th>
@endif
@if(auth()->user()->can('menuplan.delete'))
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/trashcan.svg') }}" alt="Delete"></th>
@endif
</tr>
@foreach($menuPlans as $menuplan)
<tr>
<td>{{$menuplan->week}}</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>
@if(auth()->user()->can('menuplan.edit'))
<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>
@endif
@if(auth()->user()->can('menuplan.delete'))
<td><form method="post" action="{{ route("menu-plans.destroy", [ "menu_plan" => $menuplan ]) }}" class="w-100 nostyle">
@csrf
@method("delete")
@ -34,6 +43,7 @@
<button onclick="return confirm('Are you sure you want to delete?');" class="w-100 nostyle" type="submit"><img class="w-100 cursor-pointer" src="{{ asset('/images/icons/trashcan-dark.svg') }}" alt="Delete"></button>
</form>
</td>
@endif
</tr>
@endforeach
</table>

View File

@ -10,19 +10,28 @@
@endsection
@section("content")
<div class="row align-items-center">
@if(auth()->user()->can('news.create'))
<div class="row align-items-center mb-2">
<a class="btn btn-inline btn-sde-blue mb-0" href="{{ route('news.create') }}"><img src="{{ asset('/images/icons/plus.svg') }}" alt="Create">Opret Nyheder</a>
</div>
<table class="tbl mt-2">
@endif
<table class="tbl">
<tr>
<th>Navn</th>
@if(auth()->user()->can('news.edit'))
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/pencil.svg') }}" alt="Update"></th>
@endif
@if(auth()->user()->can('news.delete'))
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/trashcan.svg') }}" alt="Delete"></th>
@endif
</tr>
@foreach($news as $new)
<tr>
<td>{{$new->subname}}</td>
@if(auth()->user()->can('news.edit'))
<td><a href="{{ route("news.edit", [ "news" => $new ]) }}"><img class="w-100" src="{{ asset('/images/icons/pencil-dark.svg') }}" alt="Update"></a></td>
@endif
@if(auth()->user()->can('news.delete'))
<td><form method="post" action="{{ route("news.destroy", [ "news" => $new ]) }}" class="w-100 nostyle">
@csrf
@method("delete")
@ -30,6 +39,7 @@
<button onclick="return confirm('Are you sure you want to delete?');" class="w-100 nostyle" type="submit"><img class="w-100 cursor-pointer" src="{{ asset('/images/icons/trashcan-dark.svg') }}" alt="Delete"></button>
</form>
</td>
@endif
</tr>
@endforeach
</table>

View File

@ -11,7 +11,9 @@
@section("content")
<div class="row align-items-center">
@if(auth()->user()->can('roles.create'))
<a class="btn btn-inline btn-sde-blue mb-0" href="{{ route('roles.create') }}"><img src="{{ asset('/images/icons/plus.svg') }}" alt="Create">Opret Rolle</a>
@endif
<form method="post" action="{{ route("roles.store") }}">
@csrf
@ -23,14 +25,21 @@
<tr>
<th>Navn</th>
<th>Beskrivelse</th>
@if(auth()->user()->can('roles.edit'))
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/pencil.svg') }}" alt="Update"></th>
@endif
@if(auth()->user()->can('roles.delete'))
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/trashcan.svg') }}" alt="Delete"></th>
@endif
</tr>
@foreach($roles as $role)
<tr>
<td>{{ $role->name }}</td>
<td>{{ $role->description }}</td>
@if(auth()->user()->can('roles.edit'))
<td><a href="{{ route("roles.edit", [ "role" => $role->id ]) }}"><img class="w-100" src="{{ asset('/images/icons/pencil-dark.svg') }}" alt="Update"></a></td>
@endif
@if(auth()->user()->can('roles.delete'))
<td><form method="post" action="{{ route("roles.destroy", [ "role" => $role ]) }}" class="w-100 nostyle">
@csrf
@method("delete")
@ -38,6 +47,7 @@
<button onclick="return confirm('Are you sure you want to delete?');" class="w-100 nostyle" type="submit"><img class="w-100 cursor-pointer" src="{{ asset('/images/icons/trashcan-dark.svg') }}" alt="Delete"></button>
</form>
</td>
@endif
</tr>
@endforeach
</table>

View File

@ -50,7 +50,9 @@
<div class="row align-items-center">
@if(auth()->user()->can('user.create'))
<a class="btn btn-inline btn-sde-blue mb-0" href="{{ route('users.create') }}"><img src="{{ asset('/images/icons/plus.svg') }}" alt="Create">Opret Bruger</a>
@endif
<form method="post" action="{{ route("users.store") }}">
@csrf
@ -82,8 +84,12 @@
<th>Tlf nr</th>
<th>Rolle(r)</th>
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/eye.svg') }}" alt="ShowImage"></th>
@if(auth()->user()->can('user.edit'))
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/pencil.svg') }}" alt="Update"></th>
@endif
@if(auth()->user()->can('user.delete'))
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/trashcan.svg') }}" alt="Delete"></th>
@endif
</tr>
@foreach($users as $user)
<tr>
@ -106,7 +112,10 @@
@else
<td style="overflow: visible"><a class="showUsers noImages"><img src="{{ asset('/images/icons/eye-dark.svg') }}"><img src="" class="showUserImages"></a></td>
@endif
@if(auth()->user()->can('user.edit'))
<td><a href="{{ route("users.edit", [ "user" => $user->id ]) }}"><img class="w-100" src="{{ asset('/images/icons/pencil-dark.svg') }}" alt="Update"></a></td>
@endif
@if(auth()->user()->can('user.delete'))
<td><form method="post" action="{{ route("users.destroy", [ "user" => $user ]) }}" class="w-100 nostyle">
@csrf
@method("delete")
@ -114,6 +123,7 @@
<button class="w-100 nostyle" onclick="return confirm('Are you sure you want to delete?');" type="submit"><img class="w-100 cursor-pointer" src="{{ asset('/images/icons/trashcan-dark.svg') }}" alt="Delete"></button>
</form>
</td>
@endif
</tr>
@endforeach
</table>

View File

@ -11,7 +11,9 @@
@section("content")
<div class="row align-items-center">
@if(auth()->user()->can('washing.machine.create'))
<a class="btn btn-inline btn-sde-blue mb-0" href="{{ route('washing-machines.create') }}"><img src="{{ asset('/images/icons/plus.svg') }}" alt="Create">Opret Vaskemaskine</a>
@endif
<div class="mt-1 ml-1">
<select name="risRosName" id="locationID">
<option selected="selected" name="all" value="all">Alle</option>
@ -25,14 +27,21 @@
<tr>
<th>Navn</th>
<th>Lokation</th>
@if(auth()->user()->can('washing.machine.edit'))
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/pencil.svg') }}" alt="Update"></th>
@endif
@if(auth()->user()->can('washing.machine.delete'))
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/trashcan.svg') }}" alt="Delete"></th>
@endif
</tr>
@foreach($machines as $machine)
<tr>
<td>{{$machine->name}}</td>
<td>{{\App\Location::query()->where("id", "=", $machine->location_id)->first()->name}}</td>
@if(auth()->user()->can('washing.machine.edit'))
<td><a href="{{ route('washing-machines.edit', [ 'washing_machine' => $machine ]) }}"><img class="w-100" src="{{ asset('/images/icons/pencil-dark.svg') }}" alt="Update"></a></td>
@endif
@if(auth()->user()->can('washing.machine.delete'))
<td><form method="post" action="{{ route('washing-machines.destroy', [ 'washing_machine' => $machine ]) }}" class="w-100 nostyle">
@csrf
@method("delete")
@ -40,6 +49,7 @@
<button class="w-100 nostyle" onclick="return confirm('Are you sure you want to delete?');" type="submit"><img class="w-100 cursor-pointer" src="{{ asset('/images/icons/trashcan-dark.svg') }}" alt="Delete"></button>
</form>
</td>
@endif
</tr>
@endforeach
</table>

View File

@ -19,7 +19,9 @@
<th>Vaskemaskine</th>
<th>Tidspunkt</th>
<th>Bruger</th>
@if(auth()->user()->can('washing.machine.reservation.delete'))
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/trashcan.svg') }}" alt="Delete"></th>
@endif
</tr>
@foreach($reservations as $reservation)
@if(date('Y-m-d H:i:s', strtotime('-1 hour')) < $reservation->time)
@ -28,6 +30,7 @@
<td>{{ \App\WashingMachine::query()->find($reservation->machine_id)->name }}</td>
<td>{{ \Illuminate\Support\Facades\Date::createFromTimeStamp(strtotime($reservation->time))->format('d/m/Y \k\l\. H:i') }}</td>
<td>{{ ucfirst(\App\User::query()->find($reservation->user_id)->name_first) }} {{ ucfirst(\App\User::query()->find($reservation->user_id)->name_last) }}</td>
@if(auth()->user()->can('washing.machine.reservation.delete'))
<td><form method="post" action="{{ route('washing-reservations.destroy', ['washing_reservation' => $reservation]) }}" class="w-100 nostyle">
@csrf
@method("delete")
@ -35,6 +38,7 @@
<button class="w-100 nostyle" onclick="return confirm('Are you sure you want to delete?');" type="submit"><img class="w-100 cursor-pointer" src="{{ asset('/images/icons/trashcan-dark.svg') }}" alt="Delete"></button>
</form>
</td>
@endif
</tr>
@endif
@endforeach