95 lines
4.6 KiB
PHP
95 lines
4.6 KiB
PHP
@extends("admin.layout.base")
|
|
@extends("admin.layout.header")
|
|
|
|
@section("title")
|
|
Opret Bruger Vejledning
|
|
@endsection
|
|
|
|
@section("path")
|
|
<a href="{{ route('guides.index') }}" class="text-white">Vis Vejledning</a> /
|
|
@endsection
|
|
|
|
@section("content")
|
|
<style>
|
|
.letterSpaceTable{
|
|
letter-spacing: 1.2px;
|
|
}
|
|
</style>
|
|
@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>
|
|
<a class="btn btn-inline btn-sde-blue mb-0 ml-1" href="{{ route('guides-category.create') }}"><img src="{{ asset('/images/icons/plus.svg') }}" alt="Create">Opret vejlednings kategori</a>
|
|
</div>
|
|
@endif
|
|
<div id="guides" class="letterSpaceTable">
|
|
<label>Vejledninger</label>
|
|
<table class="tbl">
|
|
<tr>
|
|
<th>Navn</th>
|
|
<th>Kategori</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>
|
|
<td>{{ \App\GuidesCategory::query()->where('id', '=', $guide->guide_category_id)->first()->guidesCategoryName }}</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")
|
|
|
|
<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
|
|
@if(count($guides) == 0)
|
|
<tr>
|
|
<td colspan="4">Ingen vejledninger</td>
|
|
</tr>
|
|
@endif
|
|
</table>
|
|
</div>
|
|
|
|
<div id="guidesCategory" class="mt-2 letterSpaceTable">
|
|
<label>Kategorier til de forskellige vejledninger</label>
|
|
<table class="tbl">
|
|
<tr>
|
|
<th>Vejlednings kategorier</th>
|
|
@if(auth()->user()->can('guides.edit'))<!--Jeg ved ikke om vi lave mere specifike permissions-->
|
|
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/pencil.svg') }}" alt="Update"></th>
|
|
@endif
|
|
@if(auth()->user()->can('guides.delete'))<!--Jeg ved ikke om vi lave mere specifike permissions-->
|
|
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/trashcan.svg') }}" alt="Delete"></th>
|
|
@endif
|
|
</tr>
|
|
@foreach(\App\GuidesCategory::query()->get() as $guideCategory)
|
|
<tr>
|
|
<td>{{$guideCategory->guidesCategoryName}}</td>
|
|
@if(auth()->user()->can('guides.edit'))
|
|
<td><a href="{{ route("guides-category.edit", $guideCategory) }}"><img class="w-100" src="{{ asset('/images/icons/pencil-dark.svg') }}" alt="Update2"></a></td>
|
|
@endif
|
|
@if(auth()->user()->can('guides.delete'))
|
|
<td><form method="post" action="{{ route("guides-category.destroy", $guideCategory) }}" class="w-100 nostyle">
|
|
@csrf
|
|
@method("delete")
|
|
|
|
<button onclick="return confirm('Are you sure you want to delete? You will also delete all guides with this category!');" 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>
|
|
</div>
|
|
@endsection
|