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") @section("content")
<div class="row align-items-center"> <div class="row align-items-center">
<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> @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") }}"> <form method="post" action="{{ route("users.store") }}">
@csrf @csrf
@ -20,7 +22,7 @@
<button id="filterButton" type="button" class="btn btn-sde-blue mb-0">Filter</button> <button id="filterButton" type="button" class="btn btn-sde-blue mb-0">Filter</button>
</div> </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"> <input class="checkbox-inline" type="checkbox" name="checkbox" id="navn" value="navn">
<label for="navn">Navn</label> <label for="navn">Navn</label>
<input class="checkbox-inline" type="checkbox" name="checkbox" id="titel" value="titel"> <input class="checkbox-inline" type="checkbox" name="checkbox" id="titel" value="titel">
@ -38,8 +40,12 @@
<th>Titel</th> <th>Titel</th>
<th>E-mail</th> <th>E-mail</th>
<th>Tlf</th> <th>Tlf</th>
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/pencil.svg') }}" alt="Update"></th> @if(auth()->user()->can('contact.edit'))
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/trashcan.svg') }}" alt="Delete"></th> <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> </tr>
@foreach($contacts as $contact) @foreach($contacts as $contact)
<tr> <tr>
@ -47,14 +53,18 @@
<td>{{ $contact->title }}</td> <td>{{ $contact->title }}</td>
<td>{{ $contact->email }}</td> <td>{{ $contact->email }}</td>
<td>{{ $contact->phone }}</td> <td>{{ $contact->phone }}</td>
<td><a href="{{ route("contacts.edit", [ "contact" => $contact ]) }}"><img class="w-100" src="{{ asset('/images/icons/pencil-dark.svg') }}" alt="Update"></a></td> @if(auth()->user()->can('contact.edit'))
<td><form method="post" action="{{ route("contacts.destroy", [ "contact" => $contact ]) }}" class="w-100 nostyle"> <td><a href="{{ route("contacts.edit", [ "contact" => $contact ]) }}"><img class="w-100" src="{{ asset('/images/icons/pencil-dark.svg') }}" alt="Update"></a></td>
@csrf @endif
@method("delete") @if(auth()->user()->can('contact.delete'))
<td><form method="post" action="{{ route("contacts.destroy", [ "contact" => $contact ]) }}" class="w-100 nostyle">
@csrf
@method("delete")
<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> <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> </form>
</td> </td>
@endif
</tr> </tr>
@endforeach @endforeach
</table> </table>

View File

@ -14,7 +14,9 @@
date_default_timezone_set('Europe/Copenhagen'); date_default_timezone_set('Europe/Copenhagen');
?> ?>
<div class="row align-items-center"> <div class="row align-items-center">
<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> @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") }}"> <form method="post" action="{{ route("events.store") }}">
@csrf @csrf
@ -28,8 +30,12 @@
<th>Aktivitet Ansvarlig</th> <th>Aktivitet Ansvarlig</th>
<th>Aktivitet Dato</th> <th>Aktivitet Dato</th>
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/eye.svg') }}" alt="Show"></th> <th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/eye.svg') }}" alt="Show"></th>
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/pencil.svg') }}" alt="Update"></th> @if(auth()->user()->can('event.edit'))
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/trashcan.svg') }}" alt="Delete"></th> <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> </tr>
@foreach($events as $event) @foreach($events as $event)
@if (date('Y-m-d H:i', strtotime('-1 day')) < date('Y-m-d H:i', strtotime($event->date))) @if (date('Y-m-d H:i', strtotime('-1 day')) < date('Y-m-d H:i', strtotime($event->date)))
@ -38,14 +44,18 @@
<td>{{ $event->accountable }}</td> <td>{{ $event->accountable }}</td>
<td>{{ \Illuminate\Support\Facades\Date::createFromTimeStamp(strtotime($event->date))->format('d/m/Y \k\l\. H:i') }}</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> <td><a href="{{ route("events.signups", [ "event" => $event ]) }}"><img class="w-100" src="{{ asset('/images/icons/eye-dark.svg') }}" alt="Show"></a></td>
<td><a href="{{ route("events.edit", [ "event" => $event ]) }}"><img class="w-100" src="{{ asset('/images/icons/pencil-dark.svg') }}" alt="Update"></a></td> @if(auth()->user()->can('event.edit'))
<td><form method="post" action="{{ route("events.destroy", [ "event" => $event ]) }}" class="w-100 nostyle"> <td><a href="{{ route("events.edit", [ "event" => $event ]) }}"><img class="w-100" src="{{ asset('/images/icons/pencil-dark.svg') }}" alt="Update"></a></td>
@csrf @endif
@method("delete") @if(auth()->user()->can('event.delete'))
<td><form method="post" action="{{ route("events.destroy", [ "event" => $event ]) }}" class="w-100 nostyle">
@csrf
@method("delete")
<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> <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> </form>
</td> </td>
@endif
</tr> </tr>
@endif @endif
@endforeach @endforeach

View File

@ -34,20 +34,24 @@
<th style="width: 6em;">Dato</th> <th style="width: 6em;">Dato</th>
<th>Feedback Besked</th> <th>Feedback Besked</th>
<th style="width: 5em;">Ris el. Ros</th> <th style="width: 5em;">Ris el. Ros</th>
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/trashcan.svg') }}" alt="Delete"></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> </tr>
@foreach($feedback as $fb) @foreach($feedback as $fb)
<tr> <tr>
<td>{{ date('d-m-Y', strtotime($fb->created_at)) }}</td> <td>{{ date('d-m-Y', strtotime($fb->created_at)) }}</td>
<td>{{ $fb->message }}</td> <td>{{ $fb->message }}</td>
<td>{{ $fb->suggestion_form }}</td> <td>{{ $fb->suggestion_form }}</td>
<td><form method="post" action="{{ route("feedbacks.destroy", [ "feedback" => $fb ]) }}" class="w-100 nostyle"> @if(auth()->user()->can('feedback.delete'))
@csrf <td><form method="post" action="{{ route("feedbacks.destroy", [ "feedback" => $fb ]) }}" class="w-100 nostyle">
@method("delete") @csrf
@method("delete")
<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> <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> </form>
</td> </td>
@endif
</tr> </tr>
@endforeach @endforeach
</table> </table>

View File

@ -10,26 +10,36 @@
@endsection @endsection
@section("content") @section("content")
<div class="row align-items-center"> @if(auth()->user()->can('guides.create'))
<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 class="row align-items-center mb-2">
</div> <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>
<table class="tbl mt-2"> </div>
@endif
<table class="tbl">
<tr> <tr>
<th>Navn</th> <th>Navn</th>
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/pencil.svg') }}" alt="Update"></th> @if(auth()->user()->can('guides.edit'))
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/trashcan.svg') }}" alt="Delete"></th> <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> </tr>
@foreach($guides as $guide) @foreach($guides as $guide)
<tr> <tr>
<td>{{$guide->name}}</td> <td>{{$guide->name}}</td>
<td><a href="{{ route("guides.edit", [ "guide" => $guide ]) }}"><img class="w-100" src="{{ asset('/images/icons/pencil-dark.svg') }}" alt="Update"></a></td> @if(auth()->user()->can('guides.edit'))
<td><form method="post" action="{{ route("guides.destroy", [ "guide" => $guide ]) }}" class="w-100 nostyle"> <td><a href="{{ route("guides.edit", [ "guide" => $guide ]) }}"><img class="w-100" src="{{ asset('/images/icons/pencil-dark.svg') }}" alt="Update"></a></td>
@csrf @endif
@method("delete") @if(auth()->user()->can('guides.delete'))
<td><form method="post" action="{{ route("guides.destroy", [ "guide" => $guide ]) }}" class="w-100 nostyle">
@csrf
@method("delete")
<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> <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> </form>
</td> </td>
@endif
</tr> </tr>
@endforeach @endforeach
</table> </table>

View File

@ -10,28 +10,38 @@
@endsection @endsection
@section("content") @section("content")
<div class="row align-items-center"> @if(auth()->user()->can('locations.create'))
<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 class="row align-items-center mb-2">
</div> <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>
<table class="tbl mt-2"> </div>
@endif
<table class="tbl">
<tr> <tr>
<th>Navn</th> <th>Navn</th>
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/eye.svg') }}" alt="Show"></th> <th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/eye.svg') }}" alt="Show"></th>
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/pencil.svg') }}" alt="Update"></th> @if(auth()->user()->can('locations.edit'))
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/trashcan.svg') }}" alt="Delete"></th> <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> </tr>
@foreach($locations as $location) @foreach($locations as $location)
<tr> <tr>
<td>{{$location->name}}</td> <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> <td><a href="{{ route("locations.show", [ "location" => $location ]) }}"><img class="w-100" src="{{ asset('/images/icons/eye-dark.svg') }}" alt="Show"></a></td>
<td><a href="{{ route("locations.edit", [ "location" => $location ]) }}"><img class="w-100" src="{{ asset('/images/icons/pencil-dark.svg') }}" alt="Update"></a></td> @if(auth()->user()->can('locations.edit'))
<td><form method="post" action="{{ route("locations.destroy", [ "location" => $location ]) }}" class="w-100 nostyle"> <td><a href="{{ route("locations.edit", [ "location" => $location ]) }}"><img class="w-100" src="{{ asset('/images/icons/pencil-dark.svg') }}" alt="Update"></a></td>
@csrf @endif
@method("delete") @if(auth()->user()->can('locations.delete'))
<td><form method="post" action="{{ route("locations.destroy", [ "location" => $location ]) }}" class="w-100 nostyle">
@csrf
@method("delete")
<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> <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> </form>
</td> </td>
@endif
</tr> </tr>
@endforeach @endforeach
</table> </table>

View File

@ -11,29 +11,39 @@
@section("content") @section("content")
<script src="{{ asset("/js/jquery-3.2.1.min.js") }}"></script> <script src="{{ asset("/js/jquery-3.2.1.min.js") }}"></script>
<div class="row align-items-center"> @if(auth()->user()->can('menuplan.create'))
<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 class="row align-items-center mb-2">
</div> <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> <tr>
<th>Uge</th> <th>Uge</th>
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/print-hvid.svg') }}" alt="Print"></th> <th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/print-hvid.svg') }}" alt="Print"></th>
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/pencil.svg') }}" alt="Update"></th> @if(auth()->user()->can('menuplan.edit'))
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/trashcan.svg') }}" alt="Delete"></th> <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> </tr>
@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 ]) }}" target="_blank"><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> @if(auth()->user()->can('menuplan.edit'))
<td><form method="post" action="{{ route("menu-plans.destroy", [ "menu_plan" => $menuplan ]) }}" class="w-100 nostyle"> <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>
@csrf @endif
@method("delete") @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")
<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> <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> </form>
</td> </td>
@endif
</tr> </tr>
@endforeach @endforeach
</table> </table>

View File

@ -10,26 +10,36 @@
@endsection @endsection
@section("content") @section("content")
<div class="row align-items-center"> @if(auth()->user()->can('news.create'))
<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 class="row align-items-center mb-2">
</div> <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>
<table class="tbl mt-2"> </div>
@endif
<table class="tbl">
<tr> <tr>
<th>Navn</th> <th>Navn</th>
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/pencil.svg') }}" alt="Update"></th> @if(auth()->user()->can('news.edit'))
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/trashcan.svg') }}" alt="Delete"></th> <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> </tr>
@foreach($news as $new) @foreach($news as $new)
<tr> <tr>
<td>{{$new->subname}}</td> <td>{{$new->subname}}</td>
<td><a href="{{ route("news.edit", [ "news" => $new ]) }}"><img class="w-100" src="{{ asset('/images/icons/pencil-dark.svg') }}" alt="Update"></a></td> @if(auth()->user()->can('news.edit'))
<td><form method="post" action="{{ route("news.destroy", [ "news" => $new ]) }}" class="w-100 nostyle"> <td><a href="{{ route("news.edit", [ "news" => $new ]) }}"><img class="w-100" src="{{ asset('/images/icons/pencil-dark.svg') }}" alt="Update"></a></td>
@csrf @endif
@method("delete") @if(auth()->user()->can('news.delete'))
<td><form method="post" action="{{ route("news.destroy", [ "news" => $new ]) }}" class="w-100 nostyle">
@csrf
@method("delete")
<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> <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> </form>
</td> </td>
@endif
</tr> </tr>
@endforeach @endforeach
</table> </table>

View File

@ -11,7 +11,9 @@
@section("content") @section("content")
<div class="row align-items-center"> <div class="row align-items-center">
<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> @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") }}"> <form method="post" action="{{ route("roles.store") }}">
@csrf @csrf
@ -23,21 +25,29 @@
<tr> <tr>
<th>Navn</th> <th>Navn</th>
<th>Beskrivelse</th> <th>Beskrivelse</th>
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/pencil.svg') }}" alt="Update"></th> @if(auth()->user()->can('roles.edit'))
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/trashcan.svg') }}" alt="Delete"></th> <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> </tr>
@foreach($roles as $role) @foreach($roles as $role)
<tr> <tr>
<td>{{ $role->name }}</td> <td>{{ $role->name }}</td>
<td>{{ $role->description }}</td> <td>{{ $role->description }}</td>
<td><a href="{{ route("roles.edit", [ "role" => $role->id ]) }}"><img class="w-100" src="{{ asset('/images/icons/pencil-dark.svg') }}" alt="Update"></a></td> @if(auth()->user()->can('roles.edit'))
<td><form method="post" action="{{ route("roles.destroy", [ "role" => $role ]) }}" class="w-100 nostyle"> <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 @csrf
@method("delete") @method("delete")
<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> <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> </form>
</td> </td>
@endif
</tr> </tr>
@endforeach @endforeach
</table> </table>

View File

@ -50,7 +50,9 @@
<div class="row align-items-center"> <div class="row align-items-center">
<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> @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") }}"> <form method="post" action="{{ route("users.store") }}">
@csrf @csrf
@ -82,8 +84,12 @@
<th>Tlf nr</th> <th>Tlf nr</th>
<th>Rolle(r)</th> <th>Rolle(r)</th>
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/eye.svg') }}" alt="ShowImage"></th> <th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/eye.svg') }}" alt="ShowImage"></th>
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/pencil.svg') }}" alt="Update"></th> @if(auth()->user()->can('user.edit'))
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/trashcan.svg') }}" alt="Delete"></th> <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> </tr>
@foreach($users as $user) @foreach($users as $user)
<tr> <tr>
@ -106,14 +112,18 @@
@else @else
<td style="overflow: visible"><a class="showUsers noImages"><img src="{{ asset('/images/icons/eye-dark.svg') }}"><img src="" class="showUserImages"></a></td> <td style="overflow: visible"><a class="showUsers noImages"><img src="{{ asset('/images/icons/eye-dark.svg') }}"><img src="" class="showUserImages"></a></td>
@endif @endif
<td><a href="{{ route("users.edit", [ "user" => $user->id ]) }}"><img class="w-100" src="{{ asset('/images/icons/pencil-dark.svg') }}" alt="Update"></a></td> @if(auth()->user()->can('user.edit'))
<td><form method="post" action="{{ route("users.destroy", [ "user" => $user ]) }}" class="w-100 nostyle"> <td><a href="{{ route("users.edit", [ "user" => $user->id ]) }}"><img class="w-100" src="{{ asset('/images/icons/pencil-dark.svg') }}" alt="Update"></a></td>
@csrf @endif
@method("delete") @if(auth()->user()->can('user.delete'))
<td><form method="post" action="{{ route("users.destroy", [ "user" => $user ]) }}" class="w-100 nostyle">
@csrf
@method("delete")
<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> <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> </form>
</td> </td>
@endif
</tr> </tr>
@endforeach @endforeach
</table> </table>

View File

@ -11,7 +11,9 @@
@section("content") @section("content")
<div class="row align-items-center"> <div class="row align-items-center">
<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> @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"> <div class="mt-1 ml-1">
<select name="risRosName" id="locationID"> <select name="risRosName" id="locationID">
<option selected="selected" name="all" value="all">Alle</option> <option selected="selected" name="all" value="all">Alle</option>
@ -25,21 +27,29 @@
<tr> <tr>
<th>Navn</th> <th>Navn</th>
<th>Lokation</th> <th>Lokation</th>
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/pencil.svg') }}" alt="Update"></th> @if(auth()->user()->can('washing.machine.edit'))
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/trashcan.svg') }}" alt="Delete"></th> <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> </tr>
@foreach($machines as $machine) @foreach($machines as $machine)
<tr> <tr>
<td>{{$machine->name}}</td> <td>{{$machine->name}}</td>
<td>{{\App\Location::query()->where("id", "=", $machine->location_id)->first()->name}}</td> <td>{{\App\Location::query()->where("id", "=", $machine->location_id)->first()->name}}</td>
<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> @if(auth()->user()->can('washing.machine.edit'))
<td><form method="post" action="{{ route('washing-machines.destroy', [ 'washing_machine' => $machine ]) }}" class="w-100 nostyle"> <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>
@csrf @endif
@method("delete") @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")
<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> <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> </form>
</td> </td>
@endif
</tr> </tr>
@endforeach @endforeach
</table> </table>

View File

@ -19,7 +19,9 @@
<th>Vaskemaskine</th> <th>Vaskemaskine</th>
<th>Tidspunkt</th> <th>Tidspunkt</th>
<th>Bruger</th> <th>Bruger</th>
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/trashcan.svg') }}" alt="Delete"></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> </tr>
@foreach($reservations as $reservation) @foreach($reservations as $reservation)
@if(date('Y-m-d H:i:s', strtotime('-1 hour')) < $reservation->time) @if(date('Y-m-d H:i:s', strtotime('-1 hour')) < $reservation->time)
@ -28,13 +30,15 @@
<td>{{ \App\WashingMachine::query()->find($reservation->machine_id)->name }}</td> <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>{{ \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> <td>{{ ucfirst(\App\User::query()->find($reservation->user_id)->name_first) }} {{ ucfirst(\App\User::query()->find($reservation->user_id)->name_last) }}</td>
<td><form method="post" action="{{ route('washing-reservations.destroy', ['washing_reservation' => $reservation]) }}" class="w-100 nostyle"> @if(auth()->user()->can('washing.machine.reservation.delete'))
@csrf <td><form method="post" action="{{ route('washing-reservations.destroy', ['washing_reservation' => $reservation]) }}" class="w-100 nostyle">
@method("delete") @csrf
@method("delete")
<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> <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> </form>
</td> </td>
@endif
</tr> </tr>
@endif @endif
@endforeach @endforeach